0

When trying to build a simple helloworld program, the next error shows up

LINK : fatal error LNK1561: entry point must be defined

I'm trying to use the systemc library in Visual Studio 2015, maybe thats the problem because, I couldn't find any help configuring this VS for systemc only for VS2010. The program is the following:

// 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);
}

The curious thing is that if I exchange the sc_main for main it builds but doesn't work.

Richard Erickson
  • 2,568
  • 8
  • 26
  • 39

2 Answers2

0

Your code is fine so you have a build issue. Check that you are pointing to the correct SystemC include and systemc.lib file.

HTLab
  • 74
  • 2
  • I did everyting that said the tutorials... the thing is there are only tutorias for VS 2010. Fortunately that version is also free for students, building the code with vs 2010 worked just fine. Thanks – Sergio Pertuz Apr 09 '16 at 18:32
0

There are issues with building current SystemC 2.3.1 in Visual Studio 2015. http://forums.accellera.org/topic/5026-microsoft-visual-studio-community-2015/

VS2013 works fine.

random
  • 3,868
  • 3
  • 22
  • 39