[SDL] Dev C++ Linking Issues
Elden Armbrust
earmbrust at xero-soft.com
Fri Sep 30 19:59:30 PDT 2005
Glad to hear it wasn't something horrible and life threatening ;)
Best of luck with your project.
-Elden
Tim Swast wrote:
> Thank you very much. All I had to do was add the int argc, char
> *argv[] parameters to main and it linked fine. I would have never
> thought that those parameters would have been the problem.
>
> On 9/29/05, *Tyler Montbriand* <tsm at accesscomm.ca
> <mailto:tsm at accesscomm.ca>> wrote:
>
>
> 1) It has to be int main(int argc, char *argv[]), not int main().
> SDL expects, nay, *demands* it take those two parameters.
>
> 2) If your main is in a C++ file, chances are your 'main' function
> is not
> really called 'main' as far as the linker's concerned, but
> 1502347xcgxf532189_main@ or some other garbage. C++ mangles the
> names to
> prevent overloaded functions from having the same names.
>
> Fortunately, there's a way to tell C++ to do that. Try:
> extern "C" int main(int argc, char *argv[])
> instead of
> int main()
>
> and tell me how it goes :)
>
>
>
>
> --
> Tim Swast
> Purple {Programming} Monkey King
>
>------------------------------------------------------------------------
>
>_______________________________________________
>SDL mailing list
>SDL at libsdl.org
>http://www.libsdl.org/mailman/listinfo/sdl
>
>
>------------------------------------------------------------------------
>
>No virus found in this incoming message.
>Checked by AVG Anti-Virus.
>Version: 7.0.344 / Virus Database: 267.11.9/116 - Release Date: 9/30/2005
>
>
More information about the SDL
mailing list