Compile Error - 1 File :P

Ask for help regarding any technical issue or report any bug or OS independent issues.
Post Reply
schmoau
Peon
Peon
Posts: 2
Joined: Fri Mar 14, 2008 4:52 am

Compile Error - 1 File :P

Post by schmoau » Fri Mar 14, 2008 4:54 am

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 ===|
schmoau
Peon
Peon
Posts: 2
Joined: Fri Mar 14, 2008 4:52 am

Re: Compile Error - 1 File :P

Post by schmoau » Fri Mar 14, 2008 9:04 am

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 ===|
User avatar
leeor_net
Novice
Novice
Posts: 180
Joined: Sun Feb 03, 2008 10:17 am
Location: Ohio, USA
Contact:

Re: Compile Error - 1 File :P

Post by leeor_net » Sat Mar 15, 2008 3:00 am

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.
- Leeor

"Oh, no thanks. I ate a boulder on the way in." - Shrek
User avatar
Crush
TMW Adviser
TMW Adviser
Posts: 8046
Joined: Thu Aug 25, 2005 5:08 pm
Location: Germany

Re: Compile Error - 1 File :P

Post by Crush » Sat Mar 15, 2008 3:07 am

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.
  • former Manasource Programmer
  • former TMW Pixel artist
  • NOT a game master

Please do not send me any inquiries regarding player accounts on TMW.


You might have heard a certain rumor about me. This rumor is completely false. You might also have heard the other rumor about me. This rumor is 100% accurate.
User avatar
leeor_net
Novice
Novice
Posts: 180
Joined: Sun Feb 03, 2008 10:17 am
Location: Ohio, USA
Contact:

Re: Compile Error - 1 File :P

Post by leeor_net » Sat Mar 15, 2008 4:12 am

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.
- Leeor

"Oh, no thanks. I ate a boulder on the way in." - Shrek
Newbie
Peon
Peon
Posts: 12
Joined: Sun Mar 16, 2008 6:59 pm

Re: Compile Error - 1 File :P

Post by Newbie » Sun Mar 16, 2008 7:13 pm

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..
User avatar
ElvenProgrammer
TMW Adviser
TMW Adviser
Posts: 2526
Joined: Tue Apr 13, 2004 8:11 pm
Location: Italy
Contact:

Re: Compile Error - 1 File :P

Post by ElvenProgrammer » Mon Mar 17, 2008 9:17 am

The project file should be fixed in the latest revision.
Newbie
Peon
Peon
Posts: 12
Joined: Sun Mar 16, 2008 6:59 pm

Re: Compile Error - 1 File :P

Post by Newbie » Mon Mar 17, 2008 11:39 am

ElvenProgrammer wrote:The project file should be fixed in the latest revision.
Thank you!
Finally got it compiled and running :D
User avatar
leeor_net
Novice
Novice
Posts: 180
Joined: Sun Feb 03, 2008 10:17 am
Location: Ohio, USA
Contact:

Re: Compile Error - 1 File :P

Post by leeor_net » Mon Mar 17, 2008 10:54 pm

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... :)
- Leeor

"Oh, no thanks. I ate a boulder on the way in." - Shrek
User avatar
ElvenProgrammer
TMW Adviser
TMW Adviser
Posts: 2526
Joined: Tue Apr 13, 2004 8:11 pm
Location: Italy
Contact:

Re: Compile Error - 1 File :P

Post by ElvenProgrammer » Tue Mar 18, 2008 10:19 am

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.
User avatar
leeor_net
Novice
Novice
Posts: 180
Joined: Sun Feb 03, 2008 10:17 am
Location: Ohio, USA
Contact:

Re: Compile Error - 1 File :P

Post by leeor_net » Tue Mar 18, 2008 6:36 pm

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.
- Leeor

"Oh, no thanks. I ate a boulder on the way in." - Shrek
Post Reply