FWGS / xash3d-fwgs

Xash3D FWGS engine
1.58k stars 240 forks source link

Can't compile: undefined reference to "cls" #1879

Closed jiffygist closed 1 week ago

jiffygist commented 1 week ago

Trying to build dedicated server on Arch Linux VPS ./waf configure -d -8 -T release ./waf build fails with an error

[herman@pi xash3d-fwgs]$ ./waf build -v
Build commands will be stored in build/compile_commands.json
Waf: Entering directory `/home/herman/xash3d-fwgs/build'
[101/101] Linking build/engine/xash
11:42:36 runner ['/usr/bin/gcc', '-Wl,--no-undefined', 'engine/common/base_cmd.c.2.o', 'engine/common/cfgscript.c.2.o', 'engine/common/cmd.c.2.o', 'engine/common/common.c.2.o', 'engine/common/con_utils.c.2.o', 'engine/common/crashhandler.c.2.o', 'engine/common/custom.c.2.o', 'engine/common/cvar.c.2.o', 'engine/common/dedicated.c.2.o', 'engine/common/filesystem_engine.c.2.o', 'engine/common/host.c.2.o', 'engine/common/host_state.c.2.o', 'engine/common/hpak.c.2.o', 'engine/common/identification.c.2.o', 'engine/common/imagelib/img_bmp.c.2.o', 'engine/common/imagelib/img_dds.c.2.o', 'engine/common/imagelib/img_ktx2.c.2.o', 'engine/common/imagelib/img_main.c.2.o', 'engine/common/imagelib/img_png.c.2.o', 'engine/common/imagelib/img_quant.c.2.o', 'engine/common/imagelib/img_tga.c.2.o', 'engine/common/imagelib/img_utils.c.2.o', 'engine/common/imagelib/img_wad.c.2.o', 'engine/common/infostring.c.2.o', 'engine/common/ipv6text.c.2.o', 'engine/common/launcher.c.2.o', 'engine/common/lib_common.c.2.o', 'engine/common/masterlist.c.2.o', 'engine/common/mod_alias.c.2.o', 'engine/common/mod_bmodel.c.2.o', 'engine/common/mod_sprite.c.2.o', 'engine/common/mod_studio.c.2.o', 'engine/common/model.c.2.o', 'engine/common/munge.c.2.o', 'engine/common/net_buffer.c.2.o', 'engine/common/net_chan.c.2.o', 'engine/common/net_encode.c.2.o', 'engine/common/net_http.c.2.o', 'engine/common/net_ws.c.2.o', 'engine/common/pm_surface.c.2.o', 'engine/common/pm_trace.c.2.o', 'engine/common/soundlib/libmpg/dct36.c.2.o', 'engine/common/soundlib/libmpg/dct64.c.2.o', 'engine/common/soundlib/libmpg/format.c.2.o', 'engine/common/soundlib/libmpg/frame.c.2.o', 'engine/common/soundlib/libmpg/index.c.2.o', 'engine/common/soundlib/libmpg/layer3.c.2.o', 'engine/common/soundlib/libmpg/libmpg.c.2.o', 'engine/common/soundlib/libmpg/mpg123.c.2.o', 'engine/common/soundlib/libmpg/parse.c.2.o', 'engine/common/soundlib/libmpg/reader.c.2.o', 'engine/common/soundlib/libmpg/synth.c.2.o', 'engine/common/soundlib/libmpg/tabinit.c.2.o', 'engine/common/soundlib/snd_main.c.2.o', 'engine/common/soundlib/snd_mp3.c.2.o', 'engine/common/soundlib/snd_utils.c.2.o', 'engine/common/soundlib/snd_wav.c.2.o', 'engine/common/sounds.c.2.o', 'engine/common/sys_con.c.2.o', 'engine/common/system.c.2.o', 'engine/common/whereami.c.2.o', 'engine/common/world.c.2.o', 'engine/common/zone.c.2.o', 'engine/server/sv_client.c.2.o', 'engine/server/sv_cmds.c.2.o', 'engine/server/sv_custom.c.2.o', 'engine/server/sv_filter.c.2.o', 'engine/server/sv_frame.c.2.o', 'engine/server/sv_game.c.2.o', 'engine/server/sv_init.c.2.o', 'engine/server/sv_log.c.2.o', 'engine/server/sv_main.c.2.o', 'engine/server/sv_move.c.2.o', 'engine/server/sv_phys.c.2.o', 'engine/server/sv_pmove.c.2.o', 'engine/server/sv_query.c.2.o', 'engine/server/sv_save.c.2.o', 'engine/server/sv_world.c.2.o', 'engine/platform/posix/lib_posix.c.2.o', 'engine/platform/posix/sys_posix.c.2.o', 'engine/platform/linux/in_evdev.c.2.o', 'engine/platform/linux/s_alsa.c.2.o', 'engine/platform/linux/sys_linux.c.2.o', 'engine/platform/linux/vid_fbdev.c.2.o', '-o/home/herman/xash3d-fwgs/build/engine/xash', '-Wl,-rpath,$ORIGIN', '-Wl,-Bstatic', '-Lpublic', '-lpublic', '-Wl,-Bdynamic', '-lm', '-lrt', '-ldl']
/usr/bin/ld: engine/common/net_http.c.2.o: warning: relocation against `cls' in read-only section `.text'
/usr/bin/ld: engine/common/net_http.c.2.o: in function `HTTP_AutoClean':
/home/herman/xash3d-fwgs/build/../engine/common/net_http.c:580:(.text+0x433): undefined reference to `cls'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
jiffygist commented 1 week ago

Went one commit back (to 199e226758e3a65f71606edd3294756aaf0270fb) and now it compiles

a1batross commented 1 week ago

Fixed in 4342689e73b8. Thanks for the report!