The Ur-Quan Masters Discussion Forum

The Ur-Quan Masters Re-Release => Technical Issues => Topic started by: abcminiuser on June 26, 2005, 04:57:40 pm



Title: Linker error; "Unresolved reference to _main&
Post by: abcminiuser on June 26, 2005, 04:57:40 pm
If I use the simple C++ code:

#include <stdio.h>
#include "SDL.h"

int main (int argc, char *argv[])
{
fprintf (stderr, "Test");

return(0); // Satisfies Compiler (Main() must return a value)
}


I get the error "LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup" when building in VC++.Net. Can anyone explain this? The code works fine if I don't include the SDL.h header file.

- Dean :twisted:


Title: Re: Linker error; "Unresolved reference to _m
Post by: abcminiuser on June 26, 2005, 05:15:33 pm
Never mind: I forgot I had to use the

#pragma comment(lib, "SDL.lib")
#pragma comment(lib, "SDLmain.lib")

commands. Thanks anyway guys!
- Dean :twisted: