lefti at September 22nd, 2007 12:15 — #1
I get an error when compiling the games i try to make with devc++
the error is undefined reference to `'
can anyone help me??
samuraicrow at September 22nd, 2007 12:21 — #2
Either you are linking the SDL library in the wrong order or you have made your main subroutine something other than
int main(int argc, char *argv)
It is important that you use that exact line of code for defining main because SDL has to convert the main function into WinMain.
In DevC++ the linker section of the project options under the project menu read something like this:
lefti at September 22nd, 2007 12:26 — #3
Actually yes I do write this line
but can you say the second part in pure english?? I dont undersand it...
lefti at September 22nd, 2007 12:29 — #4
Maybe I have not installed sdl properly,,, but how can this be posible,,, i have read 2 tuts on how to do it.. Any way, can you give me a link on an up-to-date tut?
samuraicrow at September 24th, 2007 12:38 — #5
Select the Project menu and click on "project options". There will be a small box that appears on the screen. Click on the file tab at the top of that box that says "linker options". Look to make sure that the linker options has a line that says "-lSDL -lmingw32" where the letter after the hyphen symbol is a lowercase L. This tells the compiler to link to the SDL library first, then the runtime library to the compiler.
(I hope this works, I'm typing this at school. I don't have DevC++ right here and am typing these instruction from memory.)
lefti at September 24th, 2007 16:05 — #6
Can you tell me which compiler do you use?
samuraicrow at September 25th, 2007 13:24 — #7
The compilers I usually use are Cygwin and MinGW when I am programming for Windows. DevC++ comes with MinGW but so does Code::Blocks and Code::Blocks is generally better if you use the nightly builds.