Jump to content

Navaneet kumar

  • Posts

  • Joined

  • Last visited

Navaneet kumar's Achievements


Member (1/2)



  1. When I built SystemC as a DLL, it resolved all the issues. Thanks!
  2. I am compiling SystemC as static library (.lib). That's what is getting linked everywhere. Do you still think that can be issue?
  3. Hi, I have written a very simple sc_module and created a dll library (libmodule.dll and .lib) for the same under cygwin using msvc cmdline (corresponding to visual studio 2015). I then link this module with a sc_main program, which calls module constructor. As soon as the program is executed, I get this error: Error: (E533) module name stack is empty: did you forget to add a sc_module_name parameter to your module constructor? In file: ..\..\src\sysc\kernel\sc_object_manager.cpp:373 What could be the issue? Here is example source code: // Module.h class DLL_API myclass : public sc_core::sc_module { public: myclass(sc_core::sc_module_name name) ; void display(); }; // Module.cpp myclass::myclass(sc_core::sc_module_name name) : sc_core::sc_module(name) { std::cout << "Inside cons\n"; } void myclass::display() { std::cout << "Calling display\n"; } // DLL_API is defined as #ifdef DLL_EXPORT #define DLL_API __declspec(dllexport) #else #define DLL_API __declspec(dllimport) #endif // Main program int sc_main(int argc, char * argv[]) { myclass obj("myclass"); obj.display(); return 0; } //Compilation cmds cl /MD /EHsc /D DLL_EXPORT /I "C:\external_dep\systemc-2.3.1\src" -c Module.cpp link /SUBSYSTEM:WINDOWS /INCREMENTAL:NO /NOLOGO /DLL /OPT:REF /OPT:ICF /DYNAMICBASE:NO /NXCOMPAT /MACHINE:"X64" /LIBPATH:"C:\external_dep\systemc-2.3.1\msvc80\SystemC\x64\Release" /OUT:"libmodule.dll" SystemC.lib Module.obj cl /MD /EHsc /D DLL_EXPORT /I "C:\external_dep\systemc-2.3.1\src" -c sc_main.cpp link /SUBSYSTEM:CONSOLE /LIBPATH:"C:\external_dep\systemc-2.3.1\msvc80\SystemC\x64\Release" SystemC.lib libmodule.lib sc_main.obj ./sc_main.exe <- running this gives above error Surprisingly, when I move Module constructor body from Module.cpp to Module.h, the error goes away.
  • Create New...