Home » U++ Library support » U++ Library : Other (not classified elsewhere) » Problem with "SDL Example" in Upp 2008.1 [BUG?]
Re: Problem with "SDL Example" in Upp 2008.1 [BUG?] [message #17339 is a reply to message #17334] |
Fri, 08 August 2008 09:55   |
mr_ped
Messages: 826 Registered: November 2005 Location: Czech Republic - Praha
|
Experienced Contributor |
|
|
Well, I have the same problem now (it's sort of weird, because I did test SDL with 2008rc for sure, and it did work back than).
I did have a quick look what's going on, and the line 50 at SDL_main.h is:
#define main SDL_main
Which will lead to this code in SDLExample\main.cpp during compilation (formatting added by me, it's single line in reality):
void ConsoleMainFn_();
int SDL_main(int argc, char *argv[]) {
Upp::AppInit__(argc, (const char **)argv);
ConsoleMainFn_();
Upp::DeleteUsrLog();
Upp::AppExit__();
return Upp::GetExitCode();
}
void ConsoleMainFn_()
As you can see, the "main" has name SDL_main, so it is not found during linking.
When you add "#undef main" ahead of CONSOLE_APP_MAIN (line 258 at main.cpp), it works well.
While I understand how the error occurs, and how to fix it, I have no idea where it comes from and what was the intention of original author. Maybe during linking with SDL library there should be used some additional flag so linker knows the "main" is SDL_main? Maybe someone else who does use SDL, will know from head what is this about.
[Updated on: Fri, 08 August 2008 09:56] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Fri Jun 27 01:15:51 CEST 2025
Total time taken to generate the page: 0.04021 seconds
|