I get an error when compiling the games i try to make with devc++
the error is undefined reference to `WinMain@16’
can anyone help me??
Please log in or register to post a reply.
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:
Actually yes I do write this line
but can you say the second part in pure english?? I dont undersand
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?
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.)
Can you tell me which compiler do you use?
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.