Jump to content

Eclipse Windows with SystemC 2.3.0


nurabha

Recommended Posts

HI

 

The issue is most probably related to earlier post:

 

SystemC in Visual Studio 2012

 

I am working on x64 Windows on 64-bit intel core 2 duo processor

 

For development I have Visual Studio 2010 Ultimate and Eclipse CDT Kepler C/C++.

 

I have built systemc-2.3.0 library (systemc.lib) for debug and release configurations using my Visual Studio.

 

I am now trying to compile a simple_fifo.cpp example in eclipse.

 

I am getting following error:

 

C1083: Cannot open include file: 'Windows.h': No such file or directory    sysc_test        line 70, external location: c:\systemc-2.3.0\src\sysc\kernel\sc_cmnhdr.h    C/C++ Problem
 

 

Below I will reproduce the releavant lines from sc_cmnhdr.h header file:

 

// Windows Version Build Option

#define _WIN32_WINNT 0x0400
#include <Windows.h> // this line no. 70 is giving error


// MSVC6.0 for() scope bug

#define for if( false ); else for

#endif

 

 

I then tried by providing the compiler with the inlcude folder path where Windows.h is located in the Windows SDK folder, but it give me more error.

 

Can anyone help me fix this error ?

 

Thanks

 

N.

Link to comment
Share on other sites

Hi. 

 

 

I then tried by providing the compiler with the inlcude folder path where Windows.h is located in the Windows SDK folder, but it give me more error.

 

You definitely need to do this step. SystemC requires Windows.h. You should add the include path in the project settings. If you get more errors after it, you have to fix them (starting with the first one).

If you need help, post your questions here. 

 

Greetings

Ralph

Link to comment
Share on other sites

There are two folders for Microsoft SDK

 

C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include

C:\Program Files\Microsoft SDKs\Windows\v6.1\Include

 

I have used the first path as it is most recent and for x86

 

Below are the errors I see on compilation (mostly linker errors) :

 

Description    Resource    Path    Location    Type
LNK2005: _sprintf already defined in MSVCRT.lib(MSVCR100.dll)    sysc_test        line 0    C/C++ Problem
LNK2005: _fflush already defined in MSVCRT.lib(MSVCR100.dll)    sysc_test        line 0    C/C++ Problem
LNK2005: __invalid_parameter already defined in MSVCRT.lib(MSVCR100.dll)    sysc_test        line 0    C/C++ Problem
LNK2005: __crt_debugger_hook already defined in MSVCRT.lib(MSVCR100.dll)    sysc_test        line 0    C/C++ Problem
LNK2005: "public: __thiscall std::bad_cast::bad_cast(class std::bad_cast const &)" (??0bad_cast@std@@QAE@ABV01@@Z) already defined in MSVCRT.lib(MSVCR100.dll)    sysc_test        line 0    C/C++ Problem
LNK2005: "public: virtual __thiscall std::bad_cast::~bad_cast(void)" (??1bad_cast@std@@UAE@XZ) already defined in MSVCRT.lib(MSVCR100.dll)    sysc_test        line 0    C/C++ Problem
LNK2005: "public: virtual char const * __thiscall std::exception::what(void)const " (?what@exception@std@@UBEPBDXZ) already defined in MSVCRT.lib(MSVCR100.dll)    sysc_test        line 0    C/C++ Problem
LNK2005: "public: __thiscall std::bad_cast::bad_cast(char const *)" (??0bad_cast@std@@QAE@PBD@Z) already defined in MSVCRT.lib(MSVCR100.dll)    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library    sysc_test        line 0    C/C++ Problem
LNK2005: _printf already defined in MSVCRT.lib(MSVCR100.dll)    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2005: __unlock already defined in MSVCRT.lib(MSVCR100.dll)    sysc_test        line 0    C/C++ Problem
LNK2005: _atoi already defined in MSVCRT.lib(MSVCR100.dll)    sysc_test        line 0    C/C++ Problem
LNK2005: "void __cdecl terminate(void)" (?terminate@@YAXXZ) already defined in MSVCRT.lib(MSVCR100.dll)    sysc_test        line 0    C/C++ Problem
LNK2005: __lock already defined in MSVCRT.lib(MSVCR100.dll)    sysc_test        line 0    C/C++ Problem
LNK2005: "public: __thiscall std::_Lockit::_Lockit(int)" (??0_Lockit@std@@QAE@H@Z) already defined in msvcprt.lib(MSVCP100.dll)    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2005: "public: static void __cdecl std::_Locinfo::_Locinfo_dtor(class std::_Locinfo *)" (?_Locinfo_dtor@_Locinfo@std@@SAXPAV12@@Z) already defined in msvcprt.lib(MSVCP100.dll)    sysc_test        line 0    C/C++ Problem
LNK2005: "public: static void __cdecl std::_Locinfo::_Locinfo_ctor(class std::_Locinfo *,char const *)" (?_Locinfo_ctor@_Locinfo@std@@SAXPAV12@PBD@Z) already defined in msvcprt.lib(MSVCP100.dll)    sysc_test        line 0    C/C++ Problem
LNK2005: "private: static class std::locale::_Locimp * __cdecl std::locale::_Init(void)" (?_Init@locale@std@@CAPAV_Locimp@12@XZ) already defined in msvcprt.lib(MSVCP100.dll)    sysc_test        line 0    C/C++ Problem
LNK2005: "private: static class std::locale::_Locimp * __cdecl std::locale::_Getgloballocale(void)" (?_Getgloballocale@locale@std@@CAPAV_Locimp@12@XZ) already defined in msvcprt.lib(MSVCP100.dll)    sysc_test        line 0    C/C++ Problem
LNK2005: "private: static void __cdecl std::locale::facet::_Facet_Register(class std::locale::facet *)" (?_Facet_Register@facet@locale@std@@CAXPAV123@@Z) already defined in msvcprt.lib(locale0_implib.obj)    sysc_test        line 0    C/C++ Problem
LNK2005: "public: virtual __thiscall std::exception::~exception(void)" (??1exception@std@@UAE@XZ) already defined in MSVCRT.lib(MSVCR100.dll)    sysc_test        line 0    C/C++ Problem
LNK2005: "public: __thiscall std::exception::exception(class std::exception const &)" (??0exception@std@@QAE@ABV01@@Z) already defined in MSVCRT.lib(MSVCR100.dll)    sysc_test        line 0    C/C++ Problem
LNK2005: "public: __thiscall std::exception::exception(char const * const &)" (??0exception@std@@QAE@ABQBD@Z) already defined in MSVCRT.lib(MSVCR100.dll)    sysc_test        line 0    C/C++ Problem
LNK2005: "public: __thiscall std::exception::exception(void)" (??0exception@std@@QAE@XZ) already defined in MSVCRT.lib(MSVCR100.dll)    sysc_test        line 0    C/C++ Problem
LNK2005: __unlock_file already defined in MSVCRT.lib(MSVCR100.dll)    sysc_test        line 0    C/C++ Problem
LNK2005: __lock_file already defined in MSVCRT.lib(MSVCR100.dll)    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2005: "public: __thiscall std::_Lockit::~_Lockit(void)" (??1_Lockit@std@@QAE@XZ) already defined in msvcprt.lib(MSVCP100.dll)    sysc_test        line 0    C/C++ Problem
LNK1169: one or more multiply defined symbols found    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
C4407: cast between different pointer to member representations, compiler may generate incorrect code    fifo.cpp    /sysc_test    line 101    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
C4407: cast between different pointer to member representations, compiler may generate incorrect code    fifo.cpp    /sysc_test    line 123    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2005: "public: class std::basic_streambuf<char,struct std::char_traits<char> > * __thiscall std::basic_ios<char,struct std::char_traits<char> >::rdbuf(void)const " (?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ) already defined in SystemC.lib(sc_simcontext.obj)    sysc_test        line 0    C/C++ Problem
LNK2005: "public: char __thiscall std::basic_ios<char,struct std::char_traits<char> >::fill(void)const " (?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDXZ) already defined in SystemC.lib(sc_simcontext.obj)    sysc_test        line 0    C/C++ Problem
LNK2005: "public: int __thiscall std::ios_base::flags(void)const " (?flags@ios_base@std@@QBEHXZ) already defined in SystemC.lib(sc_simcontext.obj)    sysc_test        line 0    C/C++ Problem
LNK2005: "public: __int64 __thiscall std::ios_base::width(void)const " (?width@ios_base@std@@QBE_JXZ) already defined in SystemC.lib(sc_simcontext.obj)    sysc_test        line 0    C/C++ Problem
LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __thiscall std::basic_ostream<char,struct std::char_traits<char> >::flush(void)" (?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ) already defined in SystemC.lib(sc_simcontext.obj)    sysc_test        line 0    C/C++ Problem
LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > * __thiscall std::basic_ios<char,struct std::char_traits<char> >::tie(void)const " (?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ) already defined in SystemC.lib(sc_simcontext.obj)    sysc_test        line 0    C/C++ Problem
LNK2005: "public: bool __thiscall std::ios_base::good(void)const " (?good@ios_base@std@@QBE_NXZ) already defined in SystemC.lib(sc_simcontext.obj)    sysc_test        line 0    C/C++ Problem
LNK2005: "public: void __thiscall std::basic_ostream<char,struct std::char_traits<char> >::_Osfx(void)" (?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in SystemC.lib(sc_simcontext.obj)    sysc_test        line 0    C/C++ Problem
LNK2005: "public: class std::locale::facet * __thiscall std::locale::facet::_Decref(void)" (?_Decref@facet@locale@std@@QAEPAV123@XZ) already defined in SystemC.lib(sc_process.obj)    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2005: "private: static void __cdecl std::ios_base::_Ios_base_dtor(class std::ios_base *)" (?_Ios_base_dtor@ios_base@std@@CAXPAV12@@Z) already defined in msvcprt.lib(MSVCP100.dll)    sysc_test        line 0    C/C++ Problem
LNK2005: "public: static void __cdecl std::ios_base::_Addstd(class std::ios_base *)" (?_Addstd@ios_base@std@@SAXPAV12@@Z) already defined in msvcprt.lib(MSVCP100.dll)    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in fifo.obj    sysc_test        line 0    C/C++ Problem
LNK2005: "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::endl(class std::basic_ostream<char,struct std::char_traits<char> > &)" (?endl@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z) already defined in SystemC.lib(sc_simcontext.obj)    sysc_test        line 0    C/C++ Problem
LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __thiscall std::basic_ostream<char,struct std::char_traits<char> >::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > & (__cdecl*)(class std::basic_ostream<char,struct std::char_traits<char> > &))" (??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z) already defined in SystemC.lib(sc_simcontext.obj)    sysc_test        line 0    C/C++ Problem
LNK2005: "public: __int64 __thiscall std::ios_base::width(__int64)" (?width@ios_base@std@@QAE_J_J@Z) already defined in SystemC.lib(sc_simcontext.obj)    sysc_test        line 0    C/C++ Problem
LNK2005: "public: void __thiscall std::basic_ios<char,struct std::char_traits<char> >::setstate(int,bool)" (?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z) already defined in SystemC.lib(sc_simcontext.obj)    sysc_test        line 0    C/C++ Problem
LNK2005: "public: int __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sputc(char)" (?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z) already defined in SystemC.lib(sc_simcontext.obj)    sysc_test        line 0    C/C++ Problem
LNK2005: "public: __int64 __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sputn(char const *,__int64)" (?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE_JPBD_J@Z) already defined in SystemC.lib(sc_simcontext.obj)    sysc_test        line 0    C/C++ Problem

 

 

 

One notable warning is

 

LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library    sysc_test        line 0    C/C++ Problem

Link to comment
Share on other sites

I have managed to remove the error by changing the following linker flag

- Project -> Properties -> C/C++ Build -> Settings -> Tool Settings -> C++ compiler -> Code Genearation -> Run-time library : from /MD (msvcrt.lib: import library for the release DLL version of the CRT ) to /MTd (links libcmtd.lib: static CRT link library for a debug build).

 

 

Then I get some different warnings:

 

cl /c /EHs /MTd /Zi "/IC:\\systemc-2.3.0\\src" "/IC:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\Include" /nologo /Fofifo.obj "..\\fifo.cpp"
fifo.cpp
Unknown compiler version - please run the configure tests and report the results
..\fifo.cpp(101) : warning C4407: cast between different pointer to member representations, compiler may generate incorrect code
..\fifo.cpp(123) : warning C4407: cast between different pointer to member representations, compiler may generate incorrect code
link /debug /nologo "/libpath:D:\\Downloads\\Binaries\\EDA Softwares\\SystemC\\systemc-2.3.0\\msvc80\\SystemC\\Debug" "/libpath:C:\\Program Files\\Microsoft SDKs\\Windows\\v6.1\\Lib" /OUT:sysc_test.exe fifo.obj "C:\\systemc-2.3.0\\msvc80\\SystemC\\Debug\\SystemC.lib"

 


These two warnings come for the code lines where method "process" is registered as a simulation process

 

 SC_THREAD( process ); // warning C4407:

...

...

 SC_THREAD( process ); // warning C4407:

 

 

In addition when I try to run simulation by executing the fifo.exe, I get an error:

 


             SystemC 2.3.0-ASI --- Jul 26 2013 10:48:21
        Copyright © 1996-2012 by all Contributors,
        ALL RIGHTS RESERVED


Error: (E549) uncaught exception: Access violation - no RTTI data!
In file: c:\systemc-2.3.0\src\sysc\kernel\sc_except.cpp:98

Link to comment
Share on other sites

  • 7 years later...
  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...