Page 1 of 1

Compile Error - 1 File :P

Posted: 14 Mar 2008, 03:54
by schmoau
Tried my best, done everything possible, using codeblocks, what the hell am i missing.. compile on win2k3

ld.exe||cannot find -lGL|
||=== Build finished: 1 errors, 0 warnings ===|

Re: Compile Error - 1 File :P

Posted: 14 Mar 2008, 08:04
by schmoau
Alright folks, been working on this for hours lmao, finally got it to this point, any ideas why im getting these SDL related problems ?


Z:\tmw\src\gui\skill.cpp||In member function `void Skill_Tab::update()':|
Z:\tmw\src\gui\skill.cpp|197|warning: converting to `int' from `float'|
.objs\src\game.o||In function `_ZN4GameC2Ev':|
Z:\tmw\src\game.cpp|284|undefined reference to `_SDL_AddTimer'|
Z:\tmw\src\game.cpp|285|undefined reference to `_SDL_AddTimer'|
.objs\src\game.o||In function `_ZN4GameC1Ev':|
Z:\tmw\src\game.cpp|284|undefined reference to `_SDL_AddTimer'|
Z:\tmw\src\game.cpp|285|undefined reference to `_SDL_AddTimer'|
.objs\src\game.o||In function `_ZN4GameD2Ev':|
Z:\tmw\src\game.cpp|333|undefined reference to `_SDL_RemoveTimer'|
Z:\tmw\src\game.cpp|334|undefined reference to `_SDL_RemoveTimer'|
.objs\src\game.o||In function `_ZN4GameD1Ev':|
Z:\tmw\src\game.cpp|333|undefined reference to `_SDL_RemoveTimer'|
Z:\tmw\src\game.cpp|334|undefined reference to `_SDL_RemoveTimer'|
.objs\src\game.o||In function `_ZN4GameD0Ev':|
Z:\tmw\src\game.cpp|333|undefined reference to `_SDL_RemoveTimer'|
.objs\src\game.o:Z:\tmw\src\game.cpp|334|more undefined references to `_SDL_RemoveTimer' follow|
.objs\src\game.o||In function `_ZN4Game5logicEv':|
Z:\tmw\src\game.cpp|406|undefined reference to `_SDL_GetAppState'|
Z:\tmw\src\game.cpp|424|undefined reference to `_SDL_Delay'|
Z:\tmw\src\game.cpp|429|undefined reference to `_SDL_Delay'|
.objs\src\game.o||In function `_ZN4Game11handleInputEv':|
Z:\tmw\src\game.cpp|461|undefined reference to `_SDL_PollEvent'|
Z:\tmw\src\game.cpp|656|undefined reference to `_SDL_FreeSurface'|
.objs\src\graphics.o||In function `_ZN8Graphics12setVideoModeEiiibb':|
Z:\tmw\src\graphics.cpp|62|undefined reference to `_SDL_SetVideoMode'|
Z:\tmw\src\graphics.cpp|70|undefined reference to `_SDL_VideoDriverName'|
Z:\tmw\src\graphics.cpp|77|undefined reference to `_SDL_GetVideoInfo'|
.objs\src\graphics.o||In function `_ZN8Graphics9drawImageEP5Imageiiiiiib':|
Z:\tmw\src\graphics.cpp|148|undefined reference to `_SDL_UpperBlit'|
.objs\src\graphics.o||In function `_ZN8Graphics12updateScreenEv':|
Z:\tmw\src\graphics.cpp|237|undefined reference to `_SDL_Flip'|
.objs\src\graphics.o||In function `_ZN8Graphics13getScreenshotEv':|
Z:\tmw\src\graphics.cpp|254|undefined reference to `_SDL_CreateRGBSurface'|
Z:\tmw\src\graphics.cpp|256|undefined reference to `_SDL_UpperBlit'|
.objs\src\gui\debugwindow.o||In function `_ZN11DebugWindow5logicEv':|
Z:\tmw\src\gui\debugwindow.cpp|76|undefined reference to `_SDL_GetMouseState'|
.objs\src\gui\gui.o||In function `_ZN3Gui4drawEv':|
Z:\tmw\src\gui\gui.cpp|188|undefined reference to `_SDL_GetMouseState'|
Z:\tmw\src\gui\gui.cpp|190|undefined reference to `_SDL_GetAppState'|
.objs\src\gui\gui.o||In function `_ZN3Gui18setUseCustomCursorEb':|
Z:\tmw\src\gui\gui.cpp|212|undefined reference to `_SDL_ShowCursor'|
Z:\tmw\src\gui\gui.cpp|226|undefined reference to `_SDL_ShowCursor'|
.objs\src\gui\itemshortcutcontainer.o||In function `_ZN21ItemShortcutContainer4drawEPN3gcn8GraphicsE':|
Z:\tmw\src\gui\itemshortcutcontainer.cpp|86|undefined reference to `_SDL_GetKeyName'|
.objs\src\gui\sdlinput.o||In function `_ZN8SDLInput9pushInputE9SDL_Event':|
Z:\tmw\src\gui\sdlinput.cpp|161|undefined reference to `_SDL_GetTicks'|
Z:\tmw\src\gui\sdlinput.cpp|171|undefined reference to `_SDL_GetTicks'|
Z:\tmw\src\gui\sdlinput.cpp|180|undefined reference to `_SDL_GetTicks'|
.objs\src\gui\setup_keyboard.o||In function `_ZN14Setup_Keyboard18refreshAssignedKeyEi':|
Z:\tmw\src\gui\setup_keyboard.cpp|161|undefined reference to `_SDL_GetKeyName'|
.objs\src\gui\setup_video.o||In function `_ZN13ModeListModelC2Ev':|
Z:\tmw\src\gui\setup_video.cpp|87|undefined reference to `_SDL_ListModes'|
.objs\src\gui\setup_video.o||In function `_ZN13ModeListModelC1Ev':|
Z:\tmw\src\gui\setup_video.cpp|87|undefined reference to `_SDL_ListModes'|
.objs\src\gui\truetypefont.o||In function `_ZNSt10_List_baseI9TextChunkSaIS0_EE7_M_initEv':|
F:\Program Files (x86)\CodeBlocks\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\c++\3.4.5\bits\stl_list.h:(.text+0xa5)||undefined reference to `_SDL_GetError'|
F:\Program Files (x86)\CodeBlocks\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\c++\3.4.5\bits\stl_list.h:(.text+0x438)||undefined reference to `_SDL_GetError'|
.objs\src\gui\truetypefont.o||In function `_ZN12TrueTypeFontC1ERKSsi':|
Z:\tmw\src\gui\truetypefont.cpp|91|undefined reference to `_SDL_GetError'|
Z:\tmw\src\gui\truetypefont.cpp|100|undefined reference to `_SDL_GetError'|
.objs\src\gui\truetypefont.o||In function `_ZNSt10_List_baseI9TextChunkSaIS0_EE7_M_initEv':|
)]+0xa9)||undefined reference to `_SDL_GetError'|
)]+0x213)||undefined reference to `_SDL_FreeSurface'|
.objs\src\gui\updatewindow.o||In function `_Z8fadler32P6_iobuf':|
Z:\tmw\src\gui\updatewindow.cpp|64|undefined reference to `_adler32'|
Z:\tmw\src\gui\updatewindow.cpp|65|undefined reference to `_adler32'|
.objs\src\gui\updatewindow.o||In function `_ZN13UpdaterWindowD2Ev':|
Z:\tmw\src\gui\updatewindow.cpp|134|undefined reference to `_SDL_WaitThread'|
.objs\src\gui\updatewindow.o||In function `_ZN13UpdaterWindowD1Ev':|
Z:\tmw\src\gui\updatewindow.cpp|134|undefined reference to `_SDL_WaitThread'|
.objs\src\gui\updatewindow.o||In function `_ZN13UpdaterWindowD0Ev':|
Z:\tmw\src\gui\updatewindow.cpp|134|undefined reference to `_SDL_WaitThread'|
.objs\src\gui\updatewindow.o||In function `_ZN13UpdaterWindow8downloadEv':|
Z:\tmw\src\gui\updatewindow.cpp|388|undefined reference to `_SDL_CreateThread'|
.objs\src\gui\updatewindow.o||In function `_ZN13UpdaterWindow5logicEv':|
Z:\tmw\src\gui\updatewindow.cpp|409|undefined reference to `_SDL_KillThread'|
Z:\tmw\src\gui\updatewindow.cpp|414|undefined reference to `_SDL_WaitThread'|
Z:\tmw\src\gui\updatewindow.cpp|452|undefined reference to `_SDL_WaitThread'|
.objs\src\gui\viewport.o||In function `_ZN8Viewport5logicEv':|
Z:\tmw\src\gui\viewport.cpp|260|undefined reference to `_SDL_GetMouseState'|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 1 warnings ===|

Re: Compile Error - 1 File :P

Posted: 15 Mar 2008, 02:00
by leeor_net
The compiler is telling you that game.cpp uses a function defined as SDL_AddTimer but it can't find a reference to it anywhere. It goes on to list the same sort of error in every file it can find. Believe me, you have way more than 50 errors there.

Simple solution -- you're not linking the SDL libraries. Be sure to download the devpak that Crush put together.

Once done, you may still have problems compiling with GUIChan's KEY.HPP. Do a quick forum search for KEY.HPP for a solution.

EDIT:
I forgot to mention this -- a lot of beginners will just download a copy of Code::blocks from the Downloads page. This will not work. You must use a recent nightly build (e.g., Jan/Feb editions). Look on the forums -- there are posts there to help you get nightly builds working.

Re: Compile Error - 1 File :P

Posted: 15 Mar 2008, 02:07
by Crush
Three corrections:

1. ElvenProgrammer maintains the DevPak, not me

2. A few weeks ago the Code::Blocks team put a new stable version on their download page which runs very well.

3. You have to add the folder with the SDL includes to the project file.

Re: Compile Error - 1 File :P

Posted: 15 Mar 2008, 03:12
by leeor_net
Whoops, sorry Crush... :oops:

Didn't know about the new Code::Blocks release... looks pretty good... :)

As for the SDL includes, you could do that but I always just put it in a standard directory so I can update as necessary and just specify the "additional include folders" (or whatever CB's equivalent is) and it works fine.

Re: Compile Error - 1 File :P

Posted: 16 Mar 2008, 18:13
by Newbie
schmoau wrote:Tried my best, done everything possible, using codeblocks, what the hell am i missing.. compile on win2k3

ld.exe||cannot find -lGL|
||=== Build finished: 1 errors, 0 warnings ===|
I've got the same error right now. Could you tell how you did get rid of it?

Trying to compile the new client (https://themanaworld.svn.sourceforge.ne ... /tmw/trunk) on Vista
with Code::Block. I've already got the DevPack and included it in Settings->Compiler and debugger->Search directories->Compiler.
Got enet.lib too.

And here's the error message

Code: Select all

C:\Users\User\Documents\DevCpp\The Mana World\src\gui\skill.cpp||In member function `void Skill_Tab::update()':|
C:\Users\User\Documents\DevCpp\The Mana World\src\gui\skill.cpp|197|warning: converting to `int' from `float'|
ld.exe||cannot find -lGL|
||=== Build finished: 1 errors, 1 warnings ===|
Edit:
Uhh..just compiled the client on Ubuntu and had no problems. Though I still want to solve the problem on Vista.
So, anyone? ;p

Edit2:
So there's another library file which is not found: png.
Though I got that one fixed by renaming it (in Linked libraries list) from "png" to "png12".
So only not found library left is "GL". Hints? ;p

Edit3:
"GL" == "opengl32" ? ehh..
Way too tired to mess with this, got to get some sleep and continue tomorrow..damn..

Re: Compile Error - 1 File :P

Posted: 17 Mar 2008, 08:17
by ElvenProgrammer
The project file should be fixed in the latest revision.

Re: Compile Error - 1 File :P

Posted: 17 Mar 2008, 10:39
by Newbie
ElvenProgrammer wrote:The project file should be fixed in the latest revision.
Thank you!
Finally got it compiled and running :D

Re: Compile Error - 1 File :P

Posted: 17 Mar 2008, 21:54
by leeor_net
Getting this to work properly on Win32 is a pain, eh? Took me a couple of hours to finally get it to work properly.

I may take the time to come up with a proper Visual Studio Project file with proper dependancies included. Might make the lives of beginners a little easier... :)

Re: Compile Error - 1 File :P

Posted: 18 Mar 2008, 09:19
by ElvenProgrammer
leeor_net wrote:Getting this to work properly on Win32 is a pain, eh? Took me a couple of hours to finally get it to work properly.

I may take the time to come up with a proper Visual Studio Project file with proper dependancies included. Might make the lives of beginners a little easier... :)
That's even harder, believe me, trying to find all the dependencies for the vc++ compiler is the real pain.

Re: Compile Error - 1 File :P

Posted: 18 Mar 2008, 17:36
by leeor_net
That's even harder, believe me, trying to find all the dependencies for the vc++ compiler is the real pain.
Yes, this I know. I generally use Visual Studio which is why I ended up using Code::Blocks. However, now that I'm aware of the various compile problems (and the likely reason it may have failed so miserably with VS), I'm at least willing to give it a try.

As for the dependancies, I've been able to find them all in the past, I don't think it'll be too hard to get them all again.