|
View:
New views
6 Messages
—
Rating Filter:
Alert me
|
|
|
ld.exe cannot find -lSDLmain Code::Blocks 8.02This is getting me a bit annoyed. I started learning C/C++ a month ago and nailed down all the basics and decided to try out LazyFoo's tutorial series. So I go to lesson 1, setting up SDL and try configuring CodeBlocks/Dev C++/etc. Each compiler gives errors. I finally figured out all the errors except this one:
I've spent about 16 hours on this one problem so far. Googled and all... I found one source on a french website, the google translation of it was so bad I couldn't understand it fully, but they suggested manually linking to libSDLmain.a and libSDL.a Any help is much appreciated! I am running 64-bit Windows 7 by the way... main.cpp:
_______________________________________________ SDL mailing list SDL@... http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
||||||||||||||||||
|
|
Re: ld.exe cannot find -lSDLmain Code::Blocks 8.02On Fri, Nov 6, 2009 at 7:57 PM, Otoris <klixkelix@...> wrote:
Try these setup instructions -- http://www.noquarterarcade.com/setting-up-a-codeblocks-project-with-sdl-on-windows
_______________________________________________ SDL mailing list SDL@... http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
||||||||||||||||||
|
|
Re: ld.exe cannot find -lSDLmain Code::Blocks 8.02Try building under MinGW/MSys instead.
After building and installing SDL like this: svn co http://svn.libsdl.org/trunk/SDL cd SDL ./autogen.sh ./configure --prefix=/mingw make make install or extracting the mingw development package to c:\MinGW do this: gcc -o out.exe in.c `sdl-config --cflags --libs` or this: g++ -o out.exe in.cpp `sdl-config --cflags --libs` You may need to install some additional packages from the MinGW/MSys project to get SDL to build without errors. It should be obvious which ones you need from the error messages. _______________________________________________ SDL mailing list SDL@... http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
||||||||||||||||||
|
|
Re: ld.exe cannot find -lSDLmain Code::Blocks 8.02That message means that the linker can't find the libSDLmain.a file. If you do have it, you should copy it to the compiler's 'lib' directory (something like C:\Program Files (x86)\CodeBlocks\MinGW\lib) or, alternatively, add the path to the file to CodeBlocks' linker search directories: Project->Build options...->[Search directories]->[Linker]
Jonny D
On Fri, Nov 6, 2009 at 7:57 PM, Otoris <klixkelix@...> wrote:
_______________________________________________ SDL mailing list SDL@... http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
||||||||||||||||||
|
|
Re: ld.exe cannot find -lSDLmain Code::Blocks 8.02You're checking out SDL 1.3, which I believe no longer has a need for SDLmain.
Since the tutorial you're using is most likely for SDL 1.2, just download the newest SDL 1.2 source archive from the main page. That, or remove SDLmain from the linker and use the backwards compatibility layer. _______________________________________________ SDL mailing list SDL@... http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
||||||||||||||||||
|
|
Re: ld.exe cannot find -lSDLmain Code::Blocks 8.02That said, there was a known issue with that release (it's not still findable on the Code::Blocks forums?) that the SDL project did not have the correct library paths set up and so wouldn't find the libs in the SDL subdirectory. As another poster has already written, adding the library path or copying the libs from the SDL subdirectory to the top libs directory are two possible solutions.
Asides from this, if you can bother with the techicalities, getting a more recent build of C::B should also fix this as well as adding a whole bunch of improvements but there's no friendly installer. --- On Sun, 11/8/09, nfries88 <nfries88@...> wrote: > From: nfries88 <nfries88@...> > Subject: Re: [SDL] ld.exe cannot find -lSDLmain Code::Blocks 8.02 > To: sdl@... > Date: Sunday, November 8, 2009, 12:34 AM > > > > > > > > > > You're checking out SDL 1.3, > which I believe no > longer has a need for SDLmain. > > Since the tutorial you're using is most likely for SDL > 1.2, just download the newest SDL 1.2 source archive from > the main page. That, or remove SDLmain from the linker and > use the backwards compatibility layer. > > > > -----Inline Attachment Follows----- > > _______________________________________________ > SDL mailing list > SDL@... > http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org > _______________________________________________ SDL mailing list SDL@... http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
| Free embeddable forum powered by Nabble | Forum Help |