Try #undef main
after all the SDL related headers.
Refresh. This is an invalid solution!
As indicated by HolyBlackCat, this is a pretty messy fix. The SDL replaces the main function in order to perform some initialization and / or cleaning, which would otherwise be impossible, and then refers to the actual user-defined function.
Interception works by replacing the name of the main user function with SDL_main
using a simple macro
#define main SDL_main
The user-defined function then ceases to be the entry point for the application, and the entry point provided by the SDL is used. The proposed #undef
disables the interception recklessly, and it should be argued that it should not work at all. For those who successfully compiled and launched the SDL application after this βfix,β it should just be a platform-dependent coincidence.
The correct solution to the OP error is to ensure that the file containing main
is compiled and linked, and that the function has the correct signature. As others have already written.
source share