链接:致命错误LNK1561:必须在Visual Studio 2015上的SystemC上定义入口点



当试图构建一个简单的helloworld程序时,下一个错误显示在上

链接:致命错误LNK1561:必须定义入口点

我正试图在Visual Studio 2015中使用systemc库,也许这是问题所在,因为我找不到任何帮助,只能为VS2010配置systemc的VS。程序如下:

// All systemc modules should include systemc.h header file
#include "systemc.h"
// Hello_world is module name
SC_MODULE (hello_world) {
  SC_CTOR (hello_world) {
    // Nothing in constructor 
  }
  void say_hello() {
    //Print "Hello World" to the console.
    cout << "Hello World.n";
  }
};
// sc_main in top level function like in C++ main
int sc_main(int argc, char* argv[]) {
  hello_world hello("HELLO");
  // Print the hello world
  hello.say_hello();
  return(0);
}

奇怪的是,如果我用sc_main交换main,它会构建但不起作用。

您的代码很好,因此存在构建问题。检查是否指向正确的SystemC include和SystemC.lib文件。

在Visual Studio 2015中构建当前的SystemC 2.3.1存在问题。http://forums.accellera.org/topic/5026-microsoft-visual-studio-community-2015/

VS2013运行良好。

最新更新