Mohamed A. Bamakhrama Posted October 1, 2021 Report Share Posted October 1, 2021 Hi all, I am running into a very weird exception when I try to build SystemC applications that contain `SC_THREAD` under Visual Studio 2019. I managed to prepare a small reproduction example (see attached file) which looks like: #include <systemc> SC_MODULE(Test) { SC_HAS_PROCESS(Test); explicit Test(sc_core::sc_module_name name) : sc_module(name) { SC_THREAD(busy); } void busy(void) { for(int i = 0; i < 10; i++) { sc_core::wait(1, sc_core::SC_NS); printf("busy\n"); } sc_core::sc_stop(); } }; int sc_main(int, char *[]) { Test ttt("ttt"); sc_core::sc_start(); return EXIT_SUCCESS; } The program is compiled using the attached CMakeLists.txt file. Upon execution, it runs into an exception and when I look in the debugger, the exception comes from: The same program runs without any issues when compiled using GCC 9.2 on CentOS 7. On Windows, I am using Windows 10 with VS 2019 Enterprise. Did anyone else run into similar issues when trying SystemC 2.3.3 with VS 2019? Edit 1: Issue has been resolved. It turns out that you need to pass `/GR` and `/vmg` in the compile flags. Best Regards, Mohamed CMakeLists.txt ctor.cc David Black 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.