c++windowseclipsecygwinsystemc

How to integrate Eclipse, systemc-2.3.3, and cygwin on Windows?


How to integrate Eclipse, systemc-2.3.3, and cygwin on Windows?


Solution

  • Below I am going to share how I could integrate eclipse, systemc-2.3.3, and cygwin on a windows operating system.

    Requirements:

    Instructions:

    1. Please read the content of the INSTALL file included in the systemc extracted folder.
    2. Open CygWin64 terminal.
    3. Navigate to the folder you have extracted the systemc zip file.
    4. Create temporary directory "objdir" via "mkdir objdir" as explained in the INSTALL file.
    5. Change to the temporary directory via "cd objdir" as explained in the INSTALL file.
    6. Choose your compiler export CXX="g++ -std=c++14". If you would like to include fixed-point library you need to add DSC_INCLUDE_FX flag to the compiler definition, i.e., export CXX="g++ -std=c++14 -DSC_INCLUDE_FX ".
    7. run configure file as "../configure --prefix="location of the libs", e.g., "/sysclibs"
    8. After MakeFile is successfully created run it via "make"
    9. After the run is successful execute "make install". At this point you have created the system c libraries in "cygwin64/syslibs".
    10. Now open eclipse and create a C++ project, and select "Cygwin GCC" in the Toolchains listbox.
    11. Go to "project properties" and under "C/C++ Build" menu select "Settings"->"Cygwin C++ Compiler". In the "Command" editor type "g++ -std=c++14". Press "Apply". Do the same for "Cygwin C++ Linker". If you have included the fixed-point library, add -SC_INCLUDE_FX to the Miscellaneous of the C++ compiler.
    12. Under "C/C++ General" menu select "Path and Symbols". Under "Includes" tap add the path to systemc compiled include folder, e.g., "cygwin64/syslibs/include".
    13. Under "Library Paths" add the path to the compile system c libraries, e.g., "cygwin64/syslibs/lib-cygwin64".
    14. Under "Libraries" tap, add "systemc". Just press add and type "systemc".
    15. Compile the following code, and if there is no error, you have set up your environment properly.
    #include <iostream>
    using namespace std;
    #include "systemc.h"
    
    int sc_main(int, char* []) {
        cout << "Done." << endl; // prints !!!Hello World!!!
        return 0;
    }
    

    If you have included the fixed-point library, and Eclipse cannot resolve the defined fixed-point types, do as what follows.