0

Learning C++ at the minute and am writing a program which solves a Sudoku puzzle. Just as I was ironing out some of the creases I went to run the program and the error LNK2019 has appeared.

error LNK2019: unresolved external symbol _main referenced in function __tmainCRTStartup

I've gone through and checked that I'm using SubSystem Console rather than Windows, however all of the "solutions" on the internet use external dependencies that they know of.

The only #include's I'm using are Windows.h for performance related figures, fstream for reading the puzzle and iostream for writing to the console. Oh and I'm using namespace std too.

I'm really stuck about where the error is coming from as I'm not using any other files, plus I've turned pre-compiled header files off too.

  • Do you have the main function in the program? I am no windows/VS expert but it seems you are trying to run a program that doesn't have the main function. – JohnTortugo Apr 25 '17 at 17:50
  • @JohnTortugo typically, Visual Studio will give you a "LINK : fatal error LNK1561: entry point must be defined" error if `main` is not defined. – François Andrieux Apr 25 '17 at 17:50
  • Are you sure you've set the SubSystem to Console for *all* build configurations? At the top of the project properties window, their is a pair of drop down boxes for selecting the configuration and platform to edit. Make sure they are set to All Configurations and All Platforms and then try setting the SubSystem. – François Andrieux Apr 25 '17 at 17:58
  • @FrançoisAndrieux got you ;-) – JohnTortugo Apr 25 '17 at 23:32

0 Answers0