linking error with a weird fix

You have a problem with TA3D, it doesn't run or it crashes...
/
Vous avez un problème avec TA3D, il ne se lance pas ou plante...
Post Reply
User avatar
yoshi314
Posts: 54
Joined: Sat Feb 23, 2008 3:30 pm
Location: PL
Contact:

linking error with a weird fix

Post by yoshi314 » Sat Feb 23, 2008 3:34 pm

i had build errors with ta3d for a while, i learned that using gcc-4.1.2 instead of 4.2.x helps. so i forced configure to use gcc-4.1.2 and i was getting this at the very end:

Code: Select all

/usr/bin/g++-4.1.2  -g -O2 -I/usr/include -ffast-math -mmmx   -o ta3d ta3d.o main.o i18n.o cTA3D_Engine.o cTAFileParser.o gfx.o pathfinding.o menu.o 3do.o cob.o console.o EngineClass.o UnitEngine.o fbi.o gaf.o glfunc.o gui.o intro.o particles.o lzw.o tdf.o tnt.o weapons.o script.o ai.o taconfig.o icon.o stdafx.o TA3D_Audio.o TA3D_Exception.o TA3D_hpi.o TA3D_NameSpace.o cThread.o cCriticalSection.o cInterface.o cLogger.o cError.o decode.o encode.o io.o ta3d_jpg.o  -lfmodex -lz -lGLU -lGL  -L/usr/lib -lalleg -lm -lXxf86vm -lXcursor -lXpm -lXext -lX11 -lpthread -ldl -lagl -llua
/usr/lib/libagl.so: undefined reference to `set_dialog_color'
/usr/lib/libagl.so: undefined reference to `_gui_button_proc'
/usr/lib/libagl.so: undefined reference to `broadcast_dialog_message'
/usr/lib/libagl.so: undefined reference to `update_dialog'
/usr/lib/libagl.so: undefined reference to `gui_strlen'
/usr/lib/libagl.so: undefined reference to `gui_mouse_b'
/usr/lib/libagl.so: undefined reference to `_gui_shadow_box_proc'
/usr/lib/libagl.so: undefined reference to `shutdown_dialog'
/usr/lib/libagl.so: undefined reference to `d_yield_proc'
/usr/lib/libagl.so: undefined reference to `_gui_ctext_proc'
/usr/lib/libagl.so: undefined reference to `init_dialog'
/usr/lib/libagl.so: undefined reference to `centre_dialog'
collect2: ld returned 1 exit status
the fix is very weird -

Code: Select all

/usr/bin/g++-4.1.2  -g -O2 -I/usr/include -ffast-math -mmmx   -o ta3d ta3d.o main.o i18n.o cTA3D_Engine.o cTAFileParser.o gfx.o pathfinding.o menu.o 3do.o cob.o console.o EngineClass.o UnitEngine.o fbi.o gaf.o glfunc.o gui.o intro.o particles.o lzw.o tdf.o tnt.o weapons.o script.o ai.o taconfig.o icon.o stdafx.o TA3D_Audio.o TA3D_Exception.o TA3D_hpi.o TA3D_NameSpace.o cThread.o cCriticalSection.o cInterface.o cLogger.o cError.o decode.o encode.o io.o ta3d_jpg.o  -lfmodex -lz -lGLU -lGL  -L/usr/lib -lalleg -lm -lXxf86vm -lXcursor -lXpm -lXext -lX11 -lpthread -ldl -lagl -llua -lalleg
i just added -lalleg at the end. it is already specified, right after -L/usr/lib; seems like the order is important, though.

can somebody explain why does it help? some build-system quirk, perhaps?

edit: i'm using current svn sources all the time.

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Post by zuzuf » Sat Feb 23, 2008 3:45 pm

hm, yes the order may be important, that's weird. I know it is important with mingw32 but I never had any problem with GCC on Linux !!

How are you building it to get a -lalleg ?? Normally allegro should linked with something like -lalleg-4.2.2

I am using gcc 4.1.3 and I don't have this problem ...

I'll see if it builds with the allegro reference at the end, and change to it if it works.

PS : I've just checked, it builds with -lalleg*** at the end, so I've uploaded a commit to SVN so you can test
=>;-D Penguin Powered

User avatar
yoshi314
Posts: 54
Joined: Sat Feb 23, 2008 3:30 pm
Location: PL
Contact:

Post by yoshi314 » Sat Feb 23, 2008 4:12 pm

okay i'll see in a few minutes

edit: okay, now it works fine, out-of-the-box :]

i'm using gentoo with gcc-4.2, i switched to 4.1.2 for configure and build time


oh, and that's probably why there is -lalleg in library list

Code: Select all

allegro-config --cppflags --libs

-I/usr/include
-L/usr/lib -lalleg -lm -lXxf86vm -lXcursor -lXpm -lXext -lX11 -lpthread -ldl

User avatar
yoshi314
Posts: 54
Joined: Sat Feb 23, 2008 3:30 pm
Location: PL
Contact:

Post by yoshi314 » Sat Feb 23, 2008 6:24 pm

okay one more problem, this time gameplay-related

Code: Select all

A error has just occured within the application.
It was trapped and logged to error.txt.
Please report this to our forums so that we might fix it.

Error:
Guard:play (menu.cpp l.1427)

String Error thrown
Unable to load file guis\CORdl.gui
Unguard: play
what am i missing here?

edit: okay, i forgot to patch the game to 3.1 :]
Last edited by yoshi314 on Sat Feb 23, 2008 6:51 pm, edited 1 time in total.

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Post by zuzuf » Sat Feb 23, 2008 6:50 pm

hm interesting, the cordl.gui & armdl.gui files aren't in the totala1.hpi file, they're in the Core Contingency add on and in the rev31.gp3 file ... and shouldn't be required to play ... I'll fix that.
=>;-D Penguin Powered

Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests