Skip to main content
GameDev.net gamedev.net
🔒 Locked

Agar linking problem

Started by Wh1sp3r Jun 17, 2010 at 7:32 AM 0 replies 1.5k views
Original Post
Wh1sp3r
Wh1sp3r
Hi, I recently found the Agar library(http://libagar.org/) and was trying to compile my first application when I ran into linker problems.

I'm using Visual Studio Express 2010, and when I try to compile my application with /SUBSYSTEM:WINDOWS in the linker settings, I get the following errors :

1>SDLmain.lib(SDL_win32_main.obj) : error LNK2005: _main already defined in main.obj
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>SDLmain.lib(SDL_win32_main.obj) : error LNK2019: unresolved external symbol _SDL_main referenced in function _main
1>C:\mydata\dev\project01\Debug\project01.exe : fatal error LNK1120: 1 unresolved externals

When I switch to /SUBSYSTEM:CONSOLE, everything works fine.
samuraicrow
samuraicrow
Since it is looking for _SDL_main, you may have forgotten to specify that you are not using the SDL backend. OpenGL is the best backend for most platforms.

Also, Agar is designed using the GNU toolchain on BSD Unix so the MinGW compiler and the MSYS command line may work better with it than Visual Studio Express 2010 despite the better debugger in the Microsoft compiler.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.