Unable to finish the compile process

Trying to build your own version of Vega Strike and having problems? Unix users, paste your config.log here (stderr output alone is not helpful).
Post Reply
Morgul
Star Pilot
Star Pilot
Posts: 4
Joined: Mon Apr 23, 2007 6:12 pm
Location: Spain

Unable to finish the compile process

Post by Morgul »

Hi all, this is my first post here :P

The failing scenario is an AMD Athlon64 running Gentoo Linux.

Today I've updated my VegaStrike tree to current SVN version (10951), and after a 'make clean' and a './configure', I've tried to compile the whole thing. The process has gone well but near the end I've gotten this message:

Code: Select all

make  all-am
(...)
make[1]: Entering directory `/home/jose/src/vegastrike/vegastrike'
(...)
g++  -march=athlon64 -O3 -fomit-frame-pointer -pipe  -falign-loops=2 -falign-jumps=2 -falign-functions=2  -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -pthread -pipe  -L/usr/X11R6/lib -L/usr/X11R6/lib  -o vegastrike  vegastrike-aggressive.o vegastrike-comm_ai.o vegastrike-communication_xml.o vegastrike-communication.o vegastrike-docking.o vegastrike-event_xml.o vegastrike-fire.o vegastrike-fireall.o vegastrike-flybywire.o vegastrike-hard_coded_scripts.o vegastrike-ikarus.o vegastrike-missionscript.o vegastrike-navigation.o vegastrike-order_comm.o vegastrike-order.o vegastrike-script.o vegastrike-tactics.o vegastrike-turretai.o vegastrike-warpto.o vegastrike-alphacurve.o vegastrike-asteroid_generic.o vegastrike-atmosphere_generic.o vegastrike-beam_generic.o vegastrike-bolt_generic.o vegastrike-building_generic.o vegastrike-collection.o vegastrike-collide_map.o vegastrike-collide.o vegastrike-container.o vegastrike-csv.o vegastrike-faction_xml.o vegastrike-missile_generic.o vegastrike-mount.o vegastrike-nebula_generic.o vegastrike-planet_generic.o vegastrike-role_bitmask.o vegastrike-unit_bsp.o vegastrike-unit_collide.o vegastrike-unit_const_cache.o vegastrike-unit_csv.o vegastrike-unit_factory_generic.o vegastrike-unit_functions_generic.o vegastrike-unit_generic.o vegastrike-pilot.o vegastrike-unit_util_generic.o vegastrike-unit_xml.o vegastrike-weapon_xml.o vegastrike-box.o vegastrike-matrix3.o vegastrike-pbuild.o vegastrike-peigen.o vegastrike-prapid.o vegastrike-vector3.o vegastrike-button.o vegastrike-control.o vegastrike-eventmanager.o vegastrike-eventresponder.o vegastrike-font.o vegastrike-general.o vegastrike-glut_support.o vegastrike-groupcontrol.o vegastrike-guidefs.o vegastrike-guitexture.o vegastrike-modaldialog.o vegastrike-newbutton.o vegastrike-painttext.o vegastrike-picker.o vegastrike-scroller.o vegastrike-simplepicker.o vegastrike-slider.o vegastrike-staticdisplay.o vegastrike-text_area.o vegastrike-textinputdisplay.o vegastrike-window.o vegastrike-windowcontroller.o vegastrike-inet_file.o vegastrike-inet.o vegastrike-accountsxml.o vegastrike-client.o vegastrike-fileutil.o vegastrike-savenet_util.o vegastrike-cubicsplines.o vegastrike-mangle.o vegastrike-netclient_clients.o vegastrike-netclient_devices.o vegastrike-netclient_login.o vegastrike-netclient.o vegastrike-netserver_acct.o vegastrike-netserver_clients.o vegastrike-netserver_devices.o vegastrike-netserver_login.o vegastrike-netserver_net.o vegastrike-netserver.o vegastrike-prediction.o vegastrike-zonemgr.o vegastrike-networkcomm.o vegastrike-webcam_support.o vegastrike-init.o vegastrike-python_compile.o vegastrike-unit_exports.o vegastrike-unit_exports1.o vegastrike-unit_exports2.o vegastrike-unit_exports3.o vegastrike-unit_method_defs.o vegastrike-unit_wrapper.o vegastrike-universe_util_export.o vegastrike-cg_global.o vegastrike-command.o vegastrike-config_xml.o vegastrike-debug_vs.o vegastrike-faction_util.o vegastrike-force_feedback.o vegastrike-gfxlib_struct.o vegastrike-in_joystick.o vegastrike-in_kb.o vegastrike-in_main.o vegastrike-in_mouse.o vegastrike-in_sdl.o vegastrike-main_loop.o vegastrike-physics.o vegastrike-rendertext.o vegastrike-ship_commands.o vegastrike-star_system_jump.o vegastrike-star_system.o vegastrike-universe_util.o vegastrike-universe.o vegastrike-configxml.o vegastrike-easydom.o vegastrike-endianness.o vegastrike-macosx_math.o vegastrike-faction_generic.o vegastrike-faction_util_generic.o vegastrike-galaxy_gen.o vegastrike-galaxy_xml.o vegastrike-galaxy.o vegastrike-hashtable.o vegastrike-lin_time.o vegastrike-load_mission.o vegastrike-pk3.o vegastrike-posh.o vegastrike-savegame.o vegastrike-SharedPool.o vegastrike-star_system_generic.o vegastrike-star_system_xml.o vegastrike-stardate.o vegastrike-universe_generic.o vegastrike-universe_util_generic.o vegastrike-vs_globals.o vegastrike-vsfilesystem.o vegastrike-xml_serializer.o vegastrike-xml_support.o vegastrike-director_generic.o vegastrike-mission_script.o vegastrike-mission.o vegastrike-msgcenter.o vegastrike-pythonmission.o vegastrike-script_call_olist.o vegastrike-script_call_omap.o vegastrike-script_call_order.o vegastrike-script_call_string.o vegastrike-script_call_unit_generic.o vegastrike-script_callbacks.o vegastrike-script_expression.o vegastrike-script_generic.o vegastrike-script_statement.o vegastrike-script_util.o vegastrike-script_variables.o vegastrike-al_globals.o vegastrike-al_init.o vegastrike-al_listen.o vegastrike-al_sound.o vegastrike-firekeyboard.o vegastrike-flyjoystick.o vegastrike-flykeyboard.o vegastrike-input_dfa.o vegastrike-asteroid.o vegastrike-atmosphere.o vegastrike-base_init.o vegastrike-base_interface.o vegastrike-base_util.o vegastrike-base_write_python.o vegastrike-base_write_xml.o vegastrike-base_xml.o vegastrike-basecomputer.o vegastrike-beam.o vegastrike-bolt.o vegastrike-briefing.o vegastrike-building.o vegastrike-click_list.o vegastrike-cont_terrain.o vegastrike-music.o vegastrike-nebula.o vegastrike-planet.o vegastrike-c_alike.tab.o vegastrike-lex.yy.o vegastrike-director.o vegastrike-flightgroup.o vegastrike-script_call_briefing.o vegastrike-script_call_unit.o vegastrike-terrain.o vegastrike-unit_factory.o vegastrike-unit_functions.o vegastrike-unit_interface.o vegastrike-unit_util.o vegastrike-ani_texture.o vegastrike-animation.o vegastrike-aux_logo.o vegastrike-aux_palette.o vegastrike-aux_texture.o vegastrike-background.o vegastrike-camera.o vegastrike-cockpit_xml.o vegastrike-cockpit.o vegastrike-coord_select.o vegastrike-env_map_gent.o vegastrike-gauge.o vegastrike-halo_system.o vegastrike-halo.o vegastrike-hud.o vegastrike-jpeg_memory.o vegastrike-loc_select.o vegastrike-masks.o vegastrike-mesh_gfx.o vegastrike-criteria_xml.o vegastrike-criteria.o vegastrike-drawgalaxy.o vegastrike-drawlist.o vegastrike-drawsystem.o vegastrike-navcomputer.o vegastrike-navgetxmldata.o vegastrike-navpath.o vegastrike-navscreen.o vegastrike-navscreenoccupied.o vegastrike-particle.o vegastrike-pipelined_texture.o vegastrike-quadsquare_cull.o vegastrike-quadsquare_render.o vegastrike-quadsquare_update.o vegastrike-quadsquare.o vegastrike-quadtree_xml.o vegastrike-quadtree.o vegastrike-ring.o vegastrike-screenshot.o vegastrike-sphere.o vegastrike-sprite.o vegastrike-star.o vegastrike-stream_texture.o vegastrike-tex_transform.o vegastrike-vdu.o vegastrike-vsbox.o vegastrike-vsimage.o vegastrike-warptrail.o vegastrike-gl_clip.o vegastrike-gl_fog.o vegastrike-gl_globals.o vegastrike-gl_init.o vegastrike-gl_light_pick.o vegastrike-gl_light_state.o vegastrike-gl_light.o vegastrike-gl_material.o vegastrike-gl_matrix.o vegastrike-gl_misc.o vegastrike-gl_quad_list.o vegastrike-gl_sphere_list.o vegastrike-gl_state.o vegastrike-gl_texture.o vegastrike-gl_vertex_list.o vegastrike-winsys.o vegastrike-main.o vegastrike-briefing_wrapper.o libboost_python.a libgfx.a libnetlowlevel.a -lz -lvorbisfile -lvorbis -logg   -lutil -lSDL -lpthread  -lGL  -lGLU  -lglut  -lXi -lXmu  -lexpat  -lpng  -ljpeg  -lopenal  -lvorbisfile -lvorbis -logg  -L/usr/lib -lpython2.4 -Xlinker -export-dynamic -pthread
vegastrike-aggressive.o: In function `__tcf_4':
aggressive.cpp:(.text+0x6): undefined reference to `SharedPool<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, StringpoolTraits>::~SharedPool()'
vegastrike-comm_ai.o: In function `__tcf_2':
comm_ai.cpp:(.text+0x6): undefined reference to `SharedPool<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, StringpoolTraits>::~SharedPool()'
vegastrike-communication_xml.o: In function `__tcf_2':
communication_xml.cpp:(.text+0x6): undefined reference to `SharedPool<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, StringpoolTraits>::~SharedPool()'
vegastrike-communication.o: In function `__tcf_2':
communication.cpp:(.text+0x46): undefined reference to `SharedPool<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, StringpoolTraits>::~SharedPool()'
vegastrike-docking.o: In function `__tcf_3':
docking.cpp:(.text+0x6): undefined reference to `SharedPool<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, StringpoolTraits>::~SharedPool()'
vegastrike-event_xml.o:event_xml.cpp:(.text+0x6): more undefined references to `SharedPool<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, StringpoolTraits>::~SharedPool()' follow
collect2: ld returned 1 exit status
make[1]: *** [vegastrike] Error 1
make[1]: Leaving directory `/home/jose/src/vegastrike/vegastrike'
make: *** [all] Error 2
I have some programming knowledge, and I've taken a look at files 'SharedPool.*'. It seems like the template class SharedPool has a destructor, but it seems the compiler doesn't match it for the template subclass (I'm not sure if this is called this way) SharedPool<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, StringpoolTraits>

Thanks for your attention.

PS: I'm attaching my config.log
You do not have the required permissions to view the files attached to this post.
ace123
Lead Network Developer
Lead Network Developer
Posts: 2560
Joined: Sun Jan 12, 2003 9:13 am
Location: Palo Alto CA
Contact:

Post by ace123 »

First, what version of GCC is this?

What revision did it break in? (you mention that you "updated").

Second, have you remade the offending file(s)? (i.e. delete the vegastrike-SharedPool object file because that is the one with the missing function, and then run make again):
rm src/vegastrike-SharedPool.o

If it comes up with the same missing reference, which is likely, then you will have to try hacks like pasting in the specific declaration that is missing, and other various hacks.

I don't see any reason why SharedPool<A,B> would not match "SharedPool<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, StringpoolTraits>"

If you now instead get a different missing reference, it looks like you must have had strange build problems, and you might just be better off doing a "make clean" and then rebuilding.

You could also try for example manually compiling SharedPool.c without optimizations to see if that changes anything.

What surprises me is that you are not having problems with the constructor, but only with the destructor, even though they are defined right next to each other.
Morgul
Star Pilot
Star Pilot
Posts: 4
Joined: Mon Apr 23, 2007 6:12 pm
Location: Spain

More details

Post by Morgul »

Well, the GCC version is "g++ (GCC) 4.1.1 (Gentoo 4.1.1-r3)" (BTW, this info is in the 'config.log' I attached... and no one downloaded :roll: )

Hmm... Now that I remember, I only changed two things from my previously working Vega Strike source code: first, I updated from a quite recent previous SVN version (I can't tell what number of revision, but IIRC only one file was updated this time); and second, I changed the optimization flags (CFLAGS and CXXFLAGS) from -O2 to -O3.

So, the problem should probably lie in that optimization change... Maybe we just found a GCC bug? :shock: I'll try to compile that file (SharedPool.c) manually as you say, but with -O2 optimizations.

I'll talk to you soon,
Morgul
Morgul
Star Pilot
Star Pilot
Posts: 4
Joined: Mon Apr 23, 2007 6:12 pm
Location: Spain

Post by Morgul »

Compiling 'SharedPool.o' and 'vegastrike-SharedPool.o' manually don't solves the problem completely: it will make 'vegastrike' executable compile but not 'vegaserver', or 'vegastrike' compile but not the other, ... Even compiling 'SharedPool.c' without optimizations won't work... it's annoying :x One of those executables always keeps failing compiling with the previous messages I quoted.

It is something related to the optimizations that GCC does at -O3, since I've compiled the whole project only with -O2 and it compiles fine.

Just another question: Why the Makefile compiles 'SharedPool.c' twice? (into 'SharedPool'.o and 'vegastrike-SharedPool.o')

Thanks for your time,
Morgul
ace123
Lead Network Developer
Lead Network Developer
Posts: 2560
Joined: Sun Jan 12, 2003 9:13 am
Location: Palo Alto CA
Contact:

Post by ace123 »

There are some slight differences between the client and server, related to disabling graphics features in the server, and having to include different files.

It takes up more space that way, so it is not ideal...

You say that it compiles either one or the other, which is really strange... What happens when you build each executable manually.
make vegastrike
make vegaserver

This is almost probably related to optimization, as O3 enables features like inlining that may confuse the way templated functions work.

Unless you are creating a serious release version of anything, I would recommend using plain -O2 at most. Generally, -O3 is unreliable, and offers comparatively few performance benefits.

-Patrick
Morgul
Star Pilot
Star Pilot
Posts: 4
Joined: Mon Apr 23, 2007 6:12 pm
Location: Spain

Post by Morgul »

Yes, it was very strange... until now. I've discovered what is going on: I didn't realised that 'SharedPool.c' was being compiled as three separate object files: 'SharedPool.o', 'vegastrike-SharedPool.o' and 'vegaserver-SharedPoo.o', and I used to think that only the first two existed :oops:

That's why compiling 'SharedPool.c' manually to generate those two first object files wasn't enough for 'vegaserver' to compile too, and after a 'make clean' and blindly compiling that 'whatever(in that moment I thought it was vegastrike, though in fact it was vegaserver)-SharedPool.o' manually I saw that 'vegaserver' was able to compile but 'vegastrike' not :roll:

(By manually I mean manually and with -O2 optimization instead of -O3)

Excuse the confusion I created. Anyway, there's a real problem, although it is a GCC one.

To summarise:

Problem: when you compile 'SharedPool.c' with -O3 (at least on my system and with the other flags I used, see first post and 'config.log' file), the build will fail at linking time with messages of undefined references that in fact are defined.

Workaround: compile manually 'SharedPool.c' into the three above mentioned object files but only with -O2 flag instead of -O3. Everything should compile (and work) fine now.

Thanks for all (for the knowledge I acquired too :D),
Morgul
Post Reply