cpp wasn' t being included in the build correctly. Go to the solution explorer, right click on the file and select " Properties". the file is included in the build and; the Tool is. The main function must be in the global namespace. C+ + is not C# / Java where all functions must be inside classes. error LNK: unresolved external symbol _ main referenced in function _ _ _ tmainCRTStartup · Ask Question. before our main function. This is clearly a. You need a main( ) function so the program knows where to start. I encountered the LNK error while working on a DLL project in Visual Studio.

Referenced external unresolved

This resulted in the LNK error. Even if your project has a main( ) method, the linker sometimes gets confused. You can solve this issue in Visual Studio by going to. Project - > Properties - > Configuration Properties - > Linker - > System. obj) : error LNK: unresolved external symbol _ main referenced in function _ _ _ tmainCRTStartup. obj) : symbol _ main referenced in function _ _ _ tmainCRTStartup. Almost four years later I finally revisited this issue and after going through all object files to see which one was the culprit I finally found the error in src/ SDL. It has these lines at the end: # if defined( _ _ WIN32_ _ ) # if. Another option would actually to define your own main with the usual parameters. Then if you don' t use those parameters and you also want to get rid of the compiler warning you could do that trick in your main function. The reason you were getting an error at _ tmain at some point was probably because you did not change the type of argv. In your main class, use the standard C+ + main function protoype that others have already mentioned :.

h" internally includes " SDL_ main. h", which contains a weird # define : # define main SDL_ main. which is almost certainly screwing up your own main. Try adding # undef main after include " SDL.