C++ Including causes redifinition

Started by
12 comments, last by rip-off 11 years, 9 months ago
I removed my entry point, but now this comes up:
Error 31 error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup

FastCall22: "I want to make the distinction that my laptop is a whore-box that connects to different network"

Blog about... stuff (GDNet, WordPress): www.gamedev.net/blog/1882-the-cuboid-zone/, cuboidzone.wordpress.com/

Advertisement
If you're making a windows program you need to have a WinMain function rather than a main function.
I manually defined my entry point and now it worked, but thanks!

FastCall22: "I want to make the distinction that my laptop is a whore-box that connects to different network"

Blog about... stuff (GDNet, WordPress): www.gamedev.net/blog/1882-the-cuboid-zone/, cuboidzone.wordpress.com/

Manually defined your entry point means what? Did you create the necessary function, or did you set the "entry point" in your linker settings?

If the latter, please be aware this is very advanced functionality and almost certainly not what you should be doing. For example:

The /ENTRY option specifies an entry point function as the starting address for an .exe file or DLL.

The function must be defined with the __stdcall calling convention. The parameters and return value must be defined as documented in the Win32 API for WinMain (for an .exe file) or DllEntryPoint (for a DLL). It is recommended that you let the linker set the entry point so that the C run-time library is initialized correctly, and C++ constructors for static objects are executed.

By default, the starting address is a function name from the C run-time library. The linker selects it according to the attributes of the program, as shown in the following table.
[/quote]

This topic is closed to new replies.

Advertisement