SizzlingStats / demboyz

we dem boyz
MIT License
44 stars 13 forks source link

update gcc to use filesystem header #14

Open jpfleischer opened 3 months ago

jpfleischer commented 3 months ago
vagrant@vagrant-ubuntu-trusty-64:/vagrant/premake/gmake$ make
==== Building json_checker (debug_x32) ====
==== Building snappy (debug_x32) ====
==== Building sourcesdk (debug_x32) ====
==== Building celt (debug_x32) ====
==== Building demboyz (debug_x32) ====
jsonfile.cpp
demboyz.cpp
../../demboyz/demboyz.cpp:8:10: fatal error: filesystem: No such file or directory
 #include <filesystem>
          ^~~~~~~~~~~~
compilation terminated.
make[1]: *** [obj/x32/Debug/demboyz.o] Error 1
make: *** [demboyz] Error 2

This change fixes the above. I still have to do this while ssh'd into vagrant

vagrant@vagrant-ubuntu-trusty-64:/vagrant/bin$ ls
demboyz    libjson_checker.a  libsourcesdk.a   steam_appid.txt
libcelt.a  libsnappy.a        libsteam_api.so
vagrant@vagrant-ubuntu-trusty-64:/vagrant/bin$ ./demboyz
./demboyz: error while loading shared libraries: libsteam_api.so: cannot open shared object file: No such file or directory
vagrant@vagrant-ubuntu-trusty-64:/vagrant/bin$ export LD_LIBRARY_PATH=/vagrant/bin:$LD_LIBRARY_PATH
vagrant@vagrant-ubuntu-trusty-64:/vagrant/bin$ ./demboyz
Usage: ./demboyz <in>.dem/json <out>.dem/json/con
SizzlingCalamari commented 3 months ago

Thanks. Any specific reason for gcc 9? The 32-bit compilation can be changed to 64-bit to remove the multilib and build-essential requirements. Ideally all that's needed is apt-get install g++. I don't believe I used any data types that would change size with the move from 32 to 64-bit, but most usages of long/unsigned long in the bitbuf or other sourcesdk classes should be changed to an explicit 32-bit type just to be sure.

Also, looks like you can use -Wl,-rpath,'$ORIGIN' ld library path issue. https://stackoverflow.com/a/36183669 https://stackoverflow.com/a/38058216

jpfleischer commented 3 months ago

great! fixed