The Ur-Quan Masters Home Page Welcome, Guest. Please login or register.
Did you miss your activation email?
September 16, 2024, 05:44:38 pm
Home Help Search Login Register
News: Celebrating 30 years of Star Control 2 - The Ur-Quan Masters

+  The Ur-Quan Masters Discussion Forum
|-+  The Ur-Quan Masters Re-Release
| |-+  Technical Issues (Moderator: Death 999)
| | |-+  Linker error; "Unresolved reference to _main&
« previous next »
Pages: [1] Print
Author Topic: Linker error; "Unresolved reference to _main&  (Read 2987 times)
abcminiuser
Zebranky food
*
Offline Offline

Posts: 10


I love YaBB 1G - SP1!


View Profile
Linker error; "Unresolved reference to _main&
« 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:
Logged
abcminiuser
Zebranky food
*
Offline Offline

Posts: 10


I love YaBB 1G - SP1!


View Profile
Re: Linker error; "Unresolved reference to _m
« Reply #1 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:
Logged
Pages: [1] Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!