lex.yy.cpp:(.text+0xac1): undefined reference to `yylval'

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
arrummzen
Insys Pilot
Insys Pilot
Posts: 2
Joined: Tue Jun 13, 2006 12:03 am

lex.yy.cpp:(.text+0xac1): undefined reference to `yylval'

Post by arrummzen »

I am trying to compile a copy of vegastrike that I copied out of svn last night. When I run make vegastrike I get a link error as shown below.

Code: Select all

g++  -g -O2 -pipe  -falign-loops=2 -falign-jumps=2 -falign-functions=2  -I/usr/include/SDL -D_REENTRANT -pthread -pipe  -L/usr/X11R6/lib -L/usr/X11R6/lib  -o vegastrike  src/cmd/ai/vegastrike-aggressive.o src/cmd/ai/vegastrike-comm_ai.o src/cmd/ai/vegastrike-communication_xml.o src/cmd/ai/vegastrike-communication.o src/cmd/ai/vegastrike-docking.o src/cmd/ai/vegastrike-event_xml.o src/cmd/ai/vegastrike-fire.o src/cmd/ai/vegastrike-fireall.o src/cmd/ai/vegastrike-flybywire.o src/cmd/ai/vegastrike-hard_coded_scripts.o src/cmd/ai/vegastrike-ikarus.o src/cmd/ai/vegastrike-missionscript.o src/cmd/ai/vegastrike-navigation.o src/cmd/ai/vegastrike-order_comm.o src/cmd/ai/vegastrike-order.o src/cmd/ai/vegastrike-script.o src/cmd/ai/vegastrike-tactics.o src/cmd/ai/vegastrike-turretai.o src/cmd/ai/vegastrike-warpto.o src/cmd/vegastrike-alphacurve.o src/cmd/vegastrike-asteroid_generic.o src/cmd/vegastrike-atmosphere_generic.o src/cmd/vegastrike-beam_generic.o src/cmd/vegastrike-bolt_generic.o src/cmd/vegastrike-building_generic.o src/cmd/vegastrike-collection.o src/cmd/vegastrike-collide_map.o src/cmd/vegastrike-collide.o src/cmd/vegastrike-container.o src/cmd/vegastrike-csv.o src/cmd/vegastrike-faction_xml.o src/cmd/vegastrike-missile_generic.o src/cmd/vegastrike-mount.o src/cmd/vegastrike-nebula_generic.o src/cmd/vegastrike-planet_generic.o src/cmd/vegastrike-role_bitmask.o src/cmd/vegastrike-unit_bsp.o src/cmd/vegastrike-unit_collide.o src/cmd/vegastrike-unit_const_cache.o src/cmd/vegastrike-unit_csv.o src/cmd/vegastrike-unit_factory_generic.o src/cmd/vegastrike-unit_functions_generic.o src/cmd/vegastrike-unit_generic.o src/cmd/vegastrike-unit_util_generic.o src/cmd/vegastrike-unit_xml.o src/cmd/vegastrike-weapon_xml.o src/cmd/collide/vegastrike-box.o src/cmd/collide/vegastrike-matrix3.o src/cmd/collide/vegastrike-pbuild.o src/cmd/collide/vegastrike-peigen.o src/cmd/collide/vegastrike-prapid.o src/cmd/collide/vegastrike-vector3.o src/gui/vegastrike-button.o src/gui/vegastrike-control.o src/gui/vegastrike-eventmanager.o src/gui/vegastrike-eventresponder.o src/gui/vegastrike-font.o src/gui/vegastrike-general.o src/gui/vegastrike-glut_support.o src/gui/vegastrike-groupcontrol.o src/gui/vegastrike-guidefs.o src/gui/vegastrike-guitexture.o src/gui/vegastrike-modaldialog.o src/gui/vegastrike-newbutton.o src/gui/vegastrike-painttext.o src/gui/vegastrike-picker.o src/gui/vegastrike-scroller.o src/gui/vegastrike-simplepicker.o src/gui/vegastrike-slider.o src/gui/vegastrike-staticdisplay.o src/gui/vegastrike-text_area.o src/gui/vegastrike-textinputdisplay.o src/gui/vegastrike-window.o src/gui/vegastrike-windowcontroller.o src/networking/vegastrike-inet_file.o src/networking/vegastrike-inet.o src/networking/vegastrike-accountsxml.o src/networking/vegastrike-client.o src/networking/vegastrike-fileutil.o src/networking/vegastrike-savenet_util.o src/networking/vegastrike-cubicsplines.o src/networking/vegastrike-mangle.o src/networking/vegastrike-netclient_clients.o src/networking/vegastrike-netclient_devices.o src/networking/vegastrike-netclient_login.o src/networking/vegastrike-netclient.o src/networking/vegastrike-netserver_acct.o src/networking/vegastrike-netserver_clients.o src/networking/vegastrike-netserver_devices.o src/networking/vegastrike-netserver_login.o src/networking/vegastrike-netserver_net.o src/networking/vegastrike-netserver.o src/networking/vegastrike-prediction.o src/networking/vegastrike-zonemgr.o src/networking/vegastrike-networkcomm.o src/networking/vegastrike-webcam_support.o src/python/vegastrike-init.o src/python/vegastrike-python_compile.o src/python/vegastrike-unit_exports.o src/python/vegastrike-unit_exports1.o src/python/vegastrike-unit_exports2.o src/python/vegastrike-unit_exports3.o src/python/vegastrike-unit_method_defs.o src/python/vegastrike-unit_wrapper.o src/python/vegastrike-universe_util_export.o src/vegastrike-cg_global.o src/vegastrike-command.o src/vegastrike-config_xml.o src/vegastrike-debug_vs.o src/vegastrike-faction_util.o src/vegastrike-force_feedback.o src/vegastrike-gfxlib_struct.o src/vegastrike-in_joystick.o src/vegastrike-in_kb.o src/vegastrike-in_main.o src/vegastrike-in_mouse.o src/vegastrike-in_sdl.o src/vegastrike-macosx_math.o src/vegastrike-main_loop.o src/vegastrike-physics.o src/vegastrike-rendertext.o src/vegastrike-ship_commands.o src/vegastrike-star_system_jump.o src/vegastrike-star_system.o src/vegastrike-universe_util.o src/vegastrike-universe.o src/vegastrike-configxml.o src/vegastrike-easydom.o src/vegastrike-endianness.o src/vegastrike-faction_generic.o src/vegastrike-faction_util_generic.o src/vegastrike-galaxy_gen.o src/vegastrike-galaxy_xml.o src/vegastrike-galaxy.o src/vegastrike-hashtable.o src/vegastrike-lin_time.o src/vegastrike-load_mission.o src/vegastrike-pk3.o src/vegastrike-posh.o src/vegastrike-savegame.o src/vegastrike-star_system_generic.o src/vegastrike-star_system_xml.o src/vegastrike-stardate.o src/vegastrike-universe_generic.o src/vegastrike-universe_util_generic.o src/vegastrike-vs_globals.o src/vegastrike-vsfilesystem.o src/vegastrike-xml_serializer.o src/vegastrike-xml_support.o src/cmd/script/vegastrike-director_generic.o src/cmd/script/vegastrike-mission_script.o src/cmd/script/vegastrike-mission.o src/cmd/script/vegastrike-msgcenter.o src/cmd/script/vegastrike-pythonmission.o src/cmd/script/vegastrike-script_call_olist.o src/cmd/script/vegastrike-script_call_omap.o src/cmd/script/vegastrike-script_call_order.o src/cmd/script/vegastrike-script_call_string.o src/cmd/script/vegastrike-script_call_unit_generic.o src/cmd/script/vegastrike-script_callbacks.o src/cmd/script/vegastrike-script_expression.o src/cmd/script/vegastrike-script_generic.o src/cmd/script/vegastrike-script_statement.o src/cmd/script/vegastrike-script_util.o src/cmd/script/vegastrike-script_variables.o src/aldrv/vegastrike-al_globals.o src/aldrv/vegastrike-al_init.o src/aldrv/vegastrike-al_listen.o src/aldrv/vegastrike-al_sound.o src/cmd/ai/vegastrike-firekeyboard.o src/cmd/ai/vegastrike-flyjoystick.o src/cmd/ai/vegastrike-flykeyboard.o src/cmd/ai/vegastrike-input_dfa.o src/cmd/vegastrike-asteroid.o src/cmd/vegastrike-atmosphere.o src/cmd/vegastrike-base_init.o src/cmd/vegastrike-base_interface.o src/cmd/vegastrike-base_util.o src/cmd/vegastrike-base_write_python.o src/cmd/vegastrike-base_write_xml.o src/cmd/vegastrike-base_xml.o src/cmd/vegastrike-basecomputer.o src/cmd/vegastrike-beam.o src/cmd/vegastrike-bolt.o src/cmd/vegastrike-briefing.o src/cmd/vegastrike-building.o src/cmd/vegastrike-click_list.o src/cmd/vegastrike-cont_terrain.o src/cmd/vegastrike-music.o src/cmd/vegastrike-nebula.o src/cmd/vegastrike-planet.o src/cmd/script/c_alike/vegastrike-c_alike.tab.o src/cmd/script/c_alike/vegastrike-lex.yy.o src/cmd/script/vegastrike-director.o src/cmd/script/vegastrike-flightgroup.o src/cmd/script/vegastrike-script_call_briefing.o src/cmd/script/vegastrike-script_call_unit.o src/cmd/vegastrike-terrain.o src/cmd/vegastrike-unit_factory.o src/cmd/vegastrike-unit_functions.o src/cmd/vegastrike-unit_interface.o src/cmd/vegastrike-unit_util.o src/gfx/vegastrike-ani_texture.o src/gfx/vegastrike-animation.o src/gfx/vegastrike-aux_logo.o src/gfx/vegastrike-aux_palette.o src/gfx/vegastrike-aux_texture.o src/gfx/vegastrike-background.o src/gfx/vegastrike-camera.o src/gfx/vegastrike-cockpit_xml.o src/gfx/vegastrike-cockpit.o src/gfx/vegastrike-coord_select.o src/gfx/vegastrike-env_map_gent.o src/gfx/vegastrike-gauge.o src/gfx/vegastrike-halo_system.o src/gfx/vegastrike-halo.o src/gfx/vegastrike-hud.o src/gfx/vegastrike-jpeg_memory.o src/gfx/vegastrike-loc_select.o src/gfx/vegastrike-masks.o src/gfx/vegastrike-mesh_gfx.o src/gfx/nav/vegastrike-criteria_xml.o src/gfx/nav/vegastrike-criteria.o src/gfx/nav/vegastrike-drawgalaxy.o src/gfx/nav/vegastrike-drawlist.o src/gfx/nav/vegastrike-drawsystem.o src/gfx/nav/vegastrike-navcomputer.o src/gfx/nav/vegastrike-navgetxmldata.o src/gfx/nav/vegastrike-navpath.o src/gfx/nav/vegastrike-navscreen.o src/gfx/nav/vegastrike-navscreenoccupied.o src/gfx/vegastrike-particle.o src/gfx/vegastrike-pipelined_texture.o src/gfx/vegastrike-quadsquare_cull.o src/gfx/vegastrike-quadsquare_render.o src/gfx/vegastrike-quadsquare_update.o src/gfx/vegastrike-quadsquare.o src/gfx/vegastrike-quadtree_xml.o src/gfx/vegastrike-quadtree.o src/gfx/vegastrike-ring.o src/gfx/vegastrike-sphere.o src/gfx/vegastrike-sprite.o src/gfx/vegastrike-star.o src/gfx/vegastrike-stream_texture.o src/gfx/vegastrike-tex_transform.o src/gfx/vegastrike-vdu.o src/gfx/vegastrike-vsbox.o src/gfx/vegastrike-vsimage.o src/gfx/vegastrike-warptrail.o src/gldrv/vegastrike-gl_clip.o src/gldrv/vegastrike-gl_fog.o src/gldrv/vegastrike-gl_globals.o src/gldrv/vegastrike-gl_init.o src/gldrv/vegastrike-gl_light_pick.o src/gldrv/vegastrike-gl_light_state.o src/gldrv/vegastrike-gl_light.o src/gldrv/vegastrike-gl_material.o src/gldrv/vegastrike-gl_matrix.o src/gldrv/vegastrike-gl_misc.o src/gldrv/vegastrike-gl_quad_list.o src/gldrv/vegastrike-gl_sphere_list.o src/gldrv/vegastrike-gl_state.o src/gldrv/vegastrike-gl_texture.o src/gldrv/vegastrike-gl_vertex_list.o src/gldrv/vegastrike-winsys.o src/vegastrike-main.o src/python/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  -lpython2.4 -Xlinker -export-dynamic -pthread 
src/cmd/script/c_alike/vegastrike-lex.yy.o: In function `yy_load_buffer_state':
src/cmd/script/c_alike/lex.yy.cpp:1505: multiple definition of `yylineno'
src/cmd/script/c_alike/vegastrike-c_alike.tab.o:src/cmd/script/c_alike/c_alike.tab.cpp:11: first defined here
src/cmd/script/c_alike/vegastrike-lex.yy.o: In function `yylex()':
src/cmd/script/c_alike/lex.yy.cpp:731: multiple definition of `yylex()'
src/cmd/script/c_alike/vegastrike-c_alike.tab.o:src/cmd/script/c_alike/c_alike.tab.cpp:22: first defined here
/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/../../../../i686-pc-linux-gnu/bin/ld: Warning: size of symbol `yylex()' changed from 10 in src/cmd/script/c_alike/vegastrike-c_alike.tab.o to 2435 in src/cmd/script/c_alike/vegastrike-lex.yy.o
src/cmd/script/c_alike/vegastrike-lex.yy.o: In function `yylex()':
lex.yy.cpp:(.text+0xa28): undefined reference to `yylval'
lex.yy.cpp:(.text+0xa5a): undefined reference to `yylval'
lex.yy.cpp:(.text+0xa8c): undefined reference to `yylval'
lex.yy.cpp:(.text+0xac1): undefined reference to `yylval'
collect2: ld returned 1 exit status
make: *** [vegastrike] Error 1
Are you sure you want my config.log file? It is huge... is there a specific subsection I could paste?

Thank you for your time,
Arrummzen
JasonStiletto
Merchant
Merchant
Posts: 34
Joined: Sun Sep 24, 2006 8:17 pm
Contact:

Post by JasonStiletto »

in src/cmd/script/c_alike/lex.yy.cpp
around line 358

you have

extern int yylineno;
int yylineno = 1;

change it to

extern int yylineno = 1;
//int yyline = 1;

and you'll get past that error.

c++ isn't really one of the languages I'm good at though.
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 »

Can you post the output of g++ -v

Also, make sure that you are at the latest SVN revision.
JasonStiletto
Merchant
Merchant
Posts: 34
Joined: Sun Sep 24, 2006 8:17 pm
Contact:

Post by JasonStiletto »

in my case

Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: /var/tmp/portage/gcc-4.1.1-r1/work/gcc-4.1.1/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.1.1 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.1 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.1/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.1/info --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/g++-v4 --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --disable-libunwind-exceptions --disable-multilib --disable-libmudflap --disable-libssp --enable-java-awt=gtk --enable-objc-gc --enable-languages=c,c++,java,objc,obj-c++,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
Thread model: posix
gcc version 4.1.1 (Gentoo 4.1.1-r1)

likewise, using latest SVN as of this morning, been a while sense it's compiled successfully on this box, but the 4.x.x flavors of gcc are supposed to be a bit more strict about certain things.
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 »

That is incredibly odd...

For me, lex.yy.cpp is completely empty (just a filler file for the compile script I guess).

It's been empty in Subversion for a really long time.

Maybe just try emptying that file and see if it then compiles.

You may also want to look at

Code: Select all

svn status
and look for modified files.
JasonStiletto
Merchant
Merchant
Posts: 34
Joined: Sun Sep 24, 2006 8:17 pm
Contact:

Post by JasonStiletto »

Well, that's strange. it is empty to begin with, empty (I think) after configure, empty during make, then at some point in make it becomes... not empty.

cd src/cmd/script/c_alike/
rm lex.yy.cpp
touch lex.yy.cpp

cd ~/vegastrike
make vegastrike

and it finishes compiling?

I'll see if I can find out when it comes to be a bit better.
pmx
Explorer
Explorer
Posts: 8
Joined: Sat Aug 19, 2006 12:50 pm

Post by pmx »

JasonStiletto wrote:Well, that's strange. it is empty to begin with, empty (I think) after configure, empty during make, then at some point in make it becomes... notT empty.

cd src/cmd/script/c_alike/
rm lex.yy.cpp
touch lex.yy.cpp

cd ~/vegastrike
make vegastrike

and it finishes compiling?

I'll see if I can find out when it comes to be a bit better.

This is because flex is run onto the c_alike;lex file (in vegastrike/src/cmd/script/c_alike/ ), thus regenerating a new lex.yy.cpp each time.
I've posted a patch (against svn 10724) in this group (previous thread, about SharedPool.cpp deps...),.

Seems also that ace123 will add a fix in the next svn rev.

Before applying the patch, don't forget to do (from the vegatrike top dir)
svn revert -R src/cmd/script/c_alike
then, from the same vegastrike directory:
patch -p0 < trunk_vegastrike_pmx_toplevel_10724.diff.txt

Should do the trick ...
pmx
pmx
Explorer
Explorer
Posts: 8
Joined: Sat Aug 19, 2006 12:50 pm

Post by pmx »

I just checked the svn repository, the problem have been fixed there.
So, dont bother with my patch file, just do a svn update ...
pmx
Post Reply