Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Having issues getting this edition to work on Lubuntu (Jammy Jellyfish) #384

Closed
justinfarrelldev opened this issue Aug 18, 2022 · 35 comments

Comments

@justinfarrelldev
Copy link

Hello,

I followed all of the Linux instructions as best as I could, but I still get this error when I try to run CTP2: Expected keword TURNS_TO_SUE_FRANCHISE not found (the typo in "keyword" is intentional - it's in the error message).

I am trying this on the Steam version of the game (again, on Lubuntu's latest version - Jammy Jellyfish).

Configure does say I am missing libbsd as well as the freetype directory, but I have libbsd-dev already installed (and frankly, I am not sure where to find the freetype stuff). I also installed various other deps that were needed which I am listing here (I simply sudo apt-get installed these):

automake
libtool
aclocal
autoheader
libtoolize
automake
autoconf

Output of ./configure (am I missing something?):

checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether make sets $(MAKE)... (cached) yes
checking for cl... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking whether gcc understands -c and -o together... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of gcc... gcc3
checking for cl... no
checking for g++... g++
checking whether the compiler supports GNU C++... yes
checking whether g++ accepts -g... yes
checking for g++ option to enable C++11 features... none needed
checking dependency style of g++... gcc3
checking whether g++ supports C++11 features by default... yes
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for flex... flex
checking for lex output file root... lex.yy
checking for lex library... none needed
checking for library containing yywrap... -ll
checking whether yytext is a pointer... yes
checking for byacc... /usr/bin/byacc
checking for unzip... /usr/bin/unzip
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for sdl2 >= 2.0.0... yes
checking for libavcodec/avcodec.h... yes
checking for libavformat/avformat.h... yes
checking for libswscale/swscale.h... yes
checking for X... libraries , headers
checking for gethostbyname... yes
checking for connect... yes
checking for remove... yes
checking for shmat... yes
checking for IceConnectionNumber in -lICE... yes
checking whether byte ordering is bigendian... no
checking for limits.h... yes
checking for sys/param.h... yes
checking for htlatex... no
checking for makeindex... no
checking for pdflatex... no
checking for perl... /usr/bin/perl
checking for thumbpdf... no
checking for acroread... no
checking for gpdf... no
checking whether to build with internal anet library... yes
checking that generated files are newer than configure... done
=== configuring in ctp2_code/libs/freetype-1.3.1 (/home/justinf/Documents/CProjects/civctp2/ctp2_code/libs/freetype-1.3.1)
configure: running /bin/bash ./configure '--prefix=/usr/local' --disable-option-checking  '--enable-shared=no' '--srcdir=.' --cache-file=
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
/bin/bash: /home/justinf/Documents/CProjects/civctp2/ctp2_code/libs/freetype-1.3.1/missing: No such file or directory
configure: WARNING: 'missing' script is too old or missing
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... none
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... arIt
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking target system type... x86_64-unknown-linux-gnu
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) none
checking how to run the C preprocessor... gcc -E
checking for rm... rm -f
checking for rmdir... rmdir
checking whether ln -s works... yes
checking for gethostbyname... yes
checking for socket... yes
checking for cos in -lm... yes
checking for X... libraries , headers
checking for gethostbyname... (cached) yes
checking for connect... yes
checking for remove... yes
checking for shmat... yes
checking for IceConnectionNumber in -lICE... yes
checking for stdlib.h... (cached) yes
checking fcntl.h usability... yes
checking fcntl.h presence... yesIt
checking for fcntl.h... yes
checking for unistd.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking size of int... 4
checking size of long... 8
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/param.h... yes
checking for getpagesize... yes
checking for working mmap... yes
checking for memcpy... yes
checking for memmove... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating MakeSub
config.status: creating lib/arch/unix/Makefile
config.status: creating test/arch/unix/Makefile
config.status: creating po/Makefile
config.status: creating ft_conf.h
config.status: ft_conf.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing default commands
sed: -e expression #1, char 1: unknown command: `-'
configure: creating ./config.status
config.status: creating GNUmakefile
config.status: creating ctp2_code/Makefile
config.status: creating ctp2_code/gfx/Makefile
config.status: creating ctp2_code/gfx/gfx_utils/Makefile
config.status: creating ctp2_code/gfx/layers/Makefile
config.status: creating ctp2_code/gfx/spritesys/Makefile
config.status: creating ctp2_code/gfx/tilesys/Makefile
config.status: creating ctp2_code/gs/Makefile
config.status: creating ctp2_code/gs/database/Makefile
config.status: creating ctp2_code/gs/dbgen/Makefile
config.status: creating ctp2_code/gs/events/Makefile
config.status: creating ctp2_code/gs/fileio/Makefile
config.status: creating ctp2_code/gs/gameobj/Makefile
config.status: creating ctp2_code/gs/newdb/Makefile
config.status: creating ctp2_code/gs/outcom/Makefile
config.status: creating ctp2_code/gs/slic/Makefile
config.status: creating ctp2_code/gs/utility/Makefile
config.status: creating ctp2_code/gs/world/Makefile
config.status: creating ctp2_code/libs/Makefile
config.status: creating ctp2_code/mapgen/Makefile
config.status: creating ctp2_code/os/Makefile
config.status: creating ctp2_code/os/nowin32/Makefile
config.status: creating ctp2_code/sound/Makefile
config.status: creating ctp2_code/ui/Makefile
config.status: creating ctp2_code/ui/interface/Makefile
config.status: creating ctp2_code/os/include/config.h
config.status: ctp2_code/os/include/config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
=== configuring in ctp2_code/libs/anet (/home/justinf/Documents/CProjects/civctp2/ctp2_code/libs/anet)
configure: running /bin/bash ./configure --disable-option-checking '--prefix=/usr/local'  --cache-file=/dev/null --srcdir=.
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether make sets $(MAKE)... (cached) yes
checking for cl... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking whether gcc understands -c and -o together... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of gcc... gcc3It
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for unzip... /usr/bin/unzip
checking for location of libbsd.a... not found
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating GNUmakefile
config.status: creating demo/GNUmakefile
config.status: creating demo/gtest/GNUmakefile
config.status: creating src/GNUmakefile
config.status: creating src/3rdparty/GNUmakefile
config.status: creating src/linux/GNUmakefile
config.status: creating src/linux/dp/GNUmakefile
config.status: creating src/test/GNUmakefile
config.status: creating h/anet_config.h
config.status: h/anet_config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands

make also exits with code 1, which I assume is the root cause, but I really have no idea why it does this (I simply git cloned the main branch). The relevant portion of the make output is below:

/home/justinf/Documents/CProjects/civctp2/ctp2_code/gfx/gfx_utils/tiffutils.cpp:41: undefined reference to `TIFFOpen'
/usr/bin/ld: /home/justinf/Documents/CProjects/civctp2/ctp2_code/gfx/gfx_utils/tiffutils.cpp:45: undefined reference to `TIFFGetField'
/usr/bin/ld: /home/justinf/Documents/CProjects/civctp2/ctp2_code/gfx/gfx_utils/tiffutils.cpp:46: undefined reference to `TIFFGetField'
/usr/bin/ld: /home/justinf/Documents/CProjects/civctp2/ctp2_code/gfx/gfx_utils/tiffutils.cpp:49: undefined reference to `_TIFFmalloc'
/usr/bin/ld: /home/justinf/Documents/CProjects/civctp2/ctp2_code/gfx/gfx_utils/tiffutils.cpp:52: undefined reference to `TIFFReadRGBAImage'
/usr/bin/ld: /home/justinf/Documents/CProjects/civctp2/ctp2_code/gfx/gfx_utils/tiffutils.cpp:56: undefined reference to `_TIFFfree'
/usr/bin/ld: /home/justinf/Documents/CProjects/civctp2/ctp2_code/gfx/gfx_utils/tiffutils.cpp:57: undefined reference to `TIFFClose'
/usr/bin/ld: /home/justinf/Documents/CProjects/civctp2/ctp2_code/gfx/gfx_utils/tiffutils.cpp:64: undefined reference to `_TIFFfree'
/usr/bin/ld: /home/justinf/Documents/CProjects/civctp2/ctp2_code/gfx/gfx_utils/tiffutils.cpp:65: undefined reference to `TIFFClose'
/usr/bin/ld: /home/justinf/Documents/CProjects/civctp2/ctp2_code/gfx/gfx_utils/tiffutils.cpp:73: undefined reference to `TIFFClose'
/usr/bin/ld: gfx/gfx_utils/.libs/libgfxgfx_utils.a(tiffutils.o): in function `TIF2mem':
/home/justinf/Documents/CProjects/civctp2/ctp2_code/gfx/gfx_utils/tiffutils.cpp:87: undefined reference to `TIFFOpen'
/usr/bin/ld: /home/justinf/Documents/CProjects/civctp2/ctp2_code/gfx/gfx_utils/tiffutils.cpp:90: undefined reference to `TIFFGetField'
/usr/bin/ld: /home/justinf/Documents/CProjects/civctp2/ctp2_code/gfx/gfx_utils/tiffutils.cpp:91: undefined reference to `TIFFGetField'
/usr/bin/ld: /home/justinf/Documents/CProjects/civctp2/ctp2_code/gfx/gfx_utils/tiffutils.cpp:97: undefined reference to `TIFFClose'
/usr/bin/ld: /home/justinf/Documents/CProjects/civctp2/ctp2_code/gfx/gfx_utils/tiffutils.cpp:104: undefined reference to `_TIFFmalloc'
/usr/bin/ld: /home/justinf/Documents/CProjects/civctp2/ctp2_code/gfx/gfx_utils/tiffutils.cpp:107: undefined reference to `TIFFReadRGBAImage'
/usr/bin/ld: /home/justinf/Documents/CProjects/civctp2/ctp2_code/gfx/gfx_utils/tiffutils.cpp:117: undefined reference to `_TIFFfree'
/usr/bin/ld: /home/justinf/Documents/CProjects/civctp2/ctp2_code/gfx/gfx_utils/tiffutils.cpp:120: undefined reference to `TIFFClose'
/usr/bin/ld: gfx/gfx_utils/.libs/libgfxgfx_utils.a(tiffutils.o): in function `TIFGetMetrics':
/home/justinf/Documents/CProjects/civctp2/ctp2_code/gfx/gfx_utils/tiffutils.cpp:135: undefined reference to `TIFFOpen'
/usr/bin/ld: /home/justinf/Documents/CProjects/civctp2/ctp2_code/gfx/gfx_utils/tiffutils.cpp:142: undefined reference to `TIFFGetField'
/usr/bin/ld: /home/justinf/Documents/CProjects/civctp2/ctp2_code/gfx/gfx_utils/tiffutils.cpp:143: undefined reference to `TIFFGetField'
/usr/bin/ld: /home/justinf/Documents/CProjects/civctp2/ctp2_code/gfx/gfx_utils/tiffutils.cpp:145: undefined reference to `TIFFClose'
/usr/bin/ld: gfx/gfx_utils/.libs/libgfxgfx_utils.a(tiffutils.o): in function `TIFLoadIntoBuffer16':
/home/justinf/Documents/CProjects/civctp2/ctp2_code/gfx/gfx_utils/tiffutils.cpp:159: undefined reference to `TIFFOpen'
/usr/bin/ld: /home/justinf/Documents/CProjects/civctp2/ctp2_code/gfx/gfx_utils/tiffutils.cpp:163: undefined reference to `TIFFGetField'
/usr/bin/ld: /home/justinf/Documents/CProjects/civctp2/ctp2_code/gfx/gfx_utils/tiffutils.cpp:164: undefined reference to `TIFFGetField'
/usr/bin/ld: /home/justinf/Documents/CProjects/civctp2/ctp2_code/gfx/gfx_utils/tiffutils.cpp:168: undefined reference to `_TIFFmalloc'
/usr/bin/ld: /home/justinf/Documents/CProjects/civctp2/ctp2_code/gfx/gfx_utils/tiffutils.cpp:172: undefined reference to `TIFFReadRGBAImage'
/usr/bin/ld: /home/justinf/Documents/CProjects/civctp2/ctp2_code/gfx/gfx_utils/tiffutils.cpp:216: undefined reference to `_TIFFfree'
/usr/bin/ld: /home/justinf/Documents/CProjects/civctp2/ctp2_code/gfx/gfx_utils/tiffutils.cpp:219: undefined reference to `TIFFClose'
/usr/bin/ld: gfx/gfx_utils/.libs/libgfxgfx_utils.a(tiffutils.o): in function `StripTIF2Mem':
/home/justinf/Documents/CProjects/civctp2/ctp2_code/gfx/gfx_utils/tiffutils.cpp:235: undefined reference to `TIFFOpen'
/usr/bin/ld: /home/justinf/Documents/CProjects/civctp2/ctp2_code/gfx/gfx_utils/tiffutils.cpp:249: undefined reference to `TIFFGetField'
/usr/bin/ld: /home/justinf/Documents/CProjects/civctp2/ctp2_code/gfx/gfx_utils/tiffutils.cpp:250: undefined reference to `TIFFGetField'
/usr/bin/ld: /home/justinf/Documents/CProjects/civctp2/ctp2_code/gfx/gfx_utils/tiffutils.cpp:251: undefined reference to `TIFFGetField'
/usr/bin/ld: /home/justinf/Documents/CProjects/civctp2/ctp2_code/gfx/gfx_utils/tiffutils.cpp:252: undefined reference to `TIFFGetField'
/usr/bin/ld: /home/justinf/Documents/CProjects/civctp2/ctp2_code/gfx/gfx_utils/tiffutils.cpp:253: undefined reference to `TIFFGetField'
/usr/bin/ld: /home/justinf/Documents/CProjects/civctp2/ctp2_code/gfx/gfx_utils/tiffutils.cpp:255: undefined reference to `TIFFScanlineSize'
/usr/bin/ld: /home/justinf/Documents/CProjects/civctp2/ctp2_code/gfx/gfx_utils/tiffutils.cpp:256: undefined reference to `TIFFStripSize'
/usr/bin/ld: /home/justinf/Documents/CProjects/civctp2/ctp2_code/gfx/gfx_utils/tiffutils.cpp:266: undefined reference to `TIFFComputeStrip'
/usr/bin/ld: /home/justinf/Documents/CProjects/civctp2/ctp2_code/gfx/gfx_utils/tiffutils.cpp:266: undefined reference to `TIFFReadEncodedStrip'
/usr/bin/ld: /home/justinf/Documents/CProjects/civctp2/ctp2_code/gfx/gfx_utils/tiffutils.cpp:282: undefined reference to `TIFFClose'
/usr/bin/ld: sound/.libs/libsound.a(soundmanager.o): in function `SoundManager::InitSoundDriver()':
/home/justinf/Documents/CProjects/civctp2/ctp2_code/sound/soundmanager.cpp:161: undefined reference to `Mix_OpenAudio'
/usr/bin/ld: sound/.libs/libsound.a(soundmanager.o): in function `SoundManager::CleanupSoundDriver()':
/home/justinf/Documents/CProjects/civctp2/ctp2_code/sound/soundmanager.cpp:194: undefined reference to `Mix_CloseAudio'
/usr/bin/ld: sound/.libs/libsound.a(soundmanager.o): in function `SoundManager::CleanupRedbook()':
/home/justinf/Documents/CProjects/civctp2/ctp2_code/sound/soundmanager.cpp:226: undefined reference to `Mix_FreeMusic'
/usr/bin/ld: sound/.libs/libsound.a(soundmanager.o): in function `SoundManager::ProcessRedbook()':
/home/justinf/Documents/CProjects/civctp2/ctp2_code/sound/soundmanager.cpp:248: undefined reference to `Mix_PlayingMusic'
/usr/bin/ld: sound/.libs/libsound.a(soundmanager.o): in function `SoundManager::Process(unsigned int const&, unsigned int&)':
/home/justinf/Documents/CProjects/civctp2/ctp2_code/sound/soundmanager.cpp:300: undefined reference to `Mix_Playing'
/usr/bin/ld: /home/justinf/Documents/CProjects/civctp2/ctp2_code/sound/soundmanager.cpp:325: undefined reference to `Mix_Playing'
/usr/bin/ld: sound/.libs/libsound.a(soundmanager.o): in function `SoundManager::AddSound(SOUNDTYPE const&, unsigned int const&, int const&, int, int)':
/home/justinf/Documents/CProjects/civctp2/ctp2_code/sound/soundmanager.cpp:417: undefined reference to `Mix_PlayChannelTimed'
/usr/bin/ld: sound/.libs/libsound.a(soundmanager.o): in function `SoundManager::AddLoopingSound(SOUNDTYPE const&, unsigned int const&, int const&, int, int)':
/home/justinf/Documents/CProjects/civctp2/ctp2_code/sound/soundmanager.cpp:473: undefined reference to `Mix_PlayChannelTimed'
/usr/bin/ld: sound/.libs/libsound.a(soundmanager.o): in function `SoundManager::TerminateLoopingSound(SOUNDTYPE const&, unsigned int const&)':
/home/justinf/Documents/CProjects/civctp2/ctp2_code/sound/soundmanager.cpp:494: undefined reference to `Mix_HaltChannel'
/usr/bin/ld: sound/.libs/libsound.a(soundmanager.o): in function `SoundManager::TerminateAllLoopingSounds(SOUNDTYPE const&)':
/home/justinf/Documents/CProjects/civctp2/ctp2_code/sound/soundmanager.cpp:524: undefined reference to `Mix_HaltChannel'
/usr/bin/ld: sound/.libs/libsound.a(soundmanager.o): in function `SoundManager::TerminateSounds(SOUNDTYPE const&)':
/home/justinf/Documents/CProjects/civctp2/ctp2_code/sound/soundmanager.cpp:557: undefined reference to `Mix_HaltChannel'
/usr/bin/ld: sound/.libs/libsound.a(soundmanager.o): in function `SoundManager::SetVolume(SOUNDTYPE const&, unsigned int const&)':
/home/justinf/Documents/CProjects/civctp2/ctp2_code/sound/soundmanager.cpp:612: undefined reference to `Mix_VolumeMusic'
/usr/bin/ld: /home/justinf/Documents/CProjects/civctp2/ctp2_code/sound/soundmanager.cpp:614: undefined reference to `Mix_VolumeMusic'
/usr/bin/ld: sound/.libs/libsound.a(soundmanager.o): in function `SoundManager::StartMusic(int const&)':
/home/justinf/Documents/CProjects/civctp2/ctp2_code/sound/soundmanager.cpp:871: undefined reference to `Mix_FreeMusic'
/usr/bin/ld: /home/justinf/Documents/CProjects/civctp2/ctp2_code/sound/soundmanager.cpp:874: undefined reference to `Mix_LoadMUS'
/usr/bin/ld: /home/justinf/Documents/CProjects/civctp2/ctp2_code/sound/soundmanager.cpp:876: undefined reference to `Mix_PlayMusic'
/usr/bin/ld: sound/.libs/libsound.a(soundmanager.o): in function `SoundManager::TerminateMusic()':
/home/justinf/Documents/CProjects/civctp2/ctp2_code/sound/soundmanager.cpp:932: undefined reference to `Mix_FreeMusic'
/usr/bin/ld: sound/.libs/libsound.a(civsound.o): in function `CivSound::CivSound(unsigned int const&, int const&)':
/home/justinf/Documents/CProjects/civctp2/ctp2_code/sound/civsound.cpp:90: undefined reference to `Mix_LoadWAV_RW'
/usr/bin/ld: sound/.libs/libsound.a(civsound.o): in function `CivSound::~CivSound()':
/home/justinf/Documents/CProjects/civctp2/ctp2_code/sound/civsound.cpp:103: undefined reference to `Mix_FreeChunk'
/usr/bin/ld: sound/.libs/libsound.a(civsound.o): in function `CivSound::SetVolume(int const&)':
/home/justinf/Documents/CProjects/civctp2/ctp2_code/sound/civsound.cpp:205: undefined reference to `Mix_VolumeChunk'
/usr/bin/ld: /home/justinf/Documents/CProjects/civctp2/ctp2_code/sound/civsound.cpp:207: undefined reference to `Mix_VolumeChunk'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:3166: ctp/ctp2] Error 1
make[2]: Leaving directory '/home/justinf/Documents/CProjects/civctp2/ctp2_code'
make[1]: *** [Makefile:3748: all-recursive] Error 1
make[1]: Leaving directory '/home/justinf/Documents/CProjects/civctp2/ctp2_code'
make: *** [GNUmakefile:465: all-recursive] Error 1

Any help would be greatly appreciated. I really would love to fork this repo and improve upon the game's code, but I really need to have the building part working first obviously haha.

Thank you!

@LynxAbraxas
Copy link
Contributor

LynxAbraxas commented Aug 18, 2022

Welcome to the civctp2 source code project!

I also installed various other deps that were needed which I am listing here (I simply sudo apt-get installed these):

You seem to be missing tiff and sound libs. Did you follow https://github.com/civctp2/civctp2#building-on-linux, in particular:
sudo apt install libsdl2-dev libsdl2-mixer-dev libsdl2-image-dev libtiff-dev libavcodec-dev libavformat-dev libswscale-dev byacc flex

The install instructions from the DF work for Ubuntu, see e.g.

civctp2/Dockerfile

Lines 18 to 20 in 5c67aa3

RUN apt-get update && apt-get install -y --no-install-recommends \
libsdl2-dev libsdl2-mixer-dev libsdl2-image-dev libtiff-dev libavcodec-dev libavformat-dev libswscale-dev \
byacc gcc g++ automake libtool unzip flex git ca-certificates

@justinfarrelldev
Copy link
Author

I also installed various other deps that were needed which I am listing here (I simply sudo apt-get installed these):

You seem to be missing tiff and sound libs. Did you follow https://github.com/civctp2/civctp2#building-on-linux, in particular: sudo apt install libsdl2-dev libsdl2-mixer-dev libsdl2-image-dev libtiff-dev libavcodec-dev libavformat-dev libswscale-dev byacc flex

The install instructions from the DF work for Ubuntu, see e.g.

civctp2/Dockerfile

Lines 18 to 20 in 5c67aa3

RUN apt-get update && apt-get install -y --no-install-recommends \
libsdl2-dev libsdl2-mixer-dev libsdl2-image-dev libtiff-dev libavcodec-dev libavformat-dev libswscale-dev \
byacc gcc g++ automake libtool unzip flex git ca-certificates

I followed that part of the guide and have those libraries installed already:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
automake is already the newest version (1:1.16.5-1.3).
ca-certificates is already the newest version (20211016).
flex is already the newest version (2.6.4-8build2).
g++ is already the newest version (4:11.2.0-1ubuntu1).
gcc is already the newest version (4:11.2.0-1ubuntu1).
libtiff-dev is already the newest version (4.3.0-6).
libtool is already the newest version (2.4.6-15build2).
unzip is already the newest version (6.0-26ubuntu3).
byacc is already the newest version (1:2.0.20220114-1).
libsdl2-image-dev is already the newest version (2.0.5+dfsg1-3build1).
libsdl2-mixer-dev is already the newest version (2.0.4+dfsg1-4build1).
git is already the newest version (1:2.34.1-1ubuntu1.4).
libavcodec-dev is already the newest version (7:4.4.2-0ubuntu0.22.04.1).
libavformat-dev is already the newest version (7:4.4.2-0ubuntu0.22.04.1).
libsdl2-dev is already the newest version (2.0.20+dfsg-2ubuntu1.22.04.1).
libswscale-dev is already the newest version (7:4.4.2-0ubuntu0.22.04.1).
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.

Welcome to the civctp2 source code project!

Thank you so much! I'm just glad the game's modding scene is alive, it was one of my favorite childhood games and it's nice seeing people keeping it alive

@LynxAbraxas
Copy link
Contributor

Hm, either the compiler does not look where the libs are installed, or they have changed in some of the later upgrades. I just noticed the DF still uses ubuntu:18.04 not the newest ubuntu available

FROM ubuntu:18.04 as system

I always played and debugged the game run from a docker-image. I might find some time in the next days (no guaranty though) to test the situation with a docker-image based on the current ubuntu.

@LynxAbraxas
Copy link
Contributor

If you are not bound to building the game locally you could try to just develop using GL-CI, see e.g. the latest DEB-package (see #351):
https://gitlab.com/civctp2/civctp2/-/jobs/2687671624/artifacts/browse/deb/

@justinfarrelldev
Copy link
Author

If you are not bound to building the game locally you could try to just develop using GL-CI, see e.g. the latest DEB-package (see #351):
https://gitlab.com/civctp2/civctp2/-/jobs/2687671624/artifacts/browse/deb/

Thank you so much for the info! I'll definitely see about trying the CI later. I'll also let you know if I can get it to work locally

@justinfarrelldev
Copy link
Author

So I've been trying for a few days to get it running with Docker, but after running this:

docker build -t ctp2 .

it fails on the 15th step with:

Step 15/20 : COPY ctp2CD/ /opt/ctp2/
COPY failed: file not found in build context or excluded by .dockerignore: stat ctp2CD/: file does not exist

I'm not using the CD version which is probably the issue.

I commented out the line for the COPY in the Dockerfile, and then had this also crop up (makes sense, I'm on Lubuntu):

Step 15/19 : COPY deb/ /deb/
COPY failed: file not found in build context or excluded by .dockerignore: stat deb/: file does not exist

After commenting that out, I finally got fairly close to the end when I had this issue:

 ---> Running in c97200b0617f
Get:1 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:2 http://archive.ubuntu.com/ubuntu bionic InRelease [242 kB]
Get:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Get:5 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [1533 kB]
Get:6 http://archive.ubuntu.com/ubuntu bionic/multiverse amd64 Packages [186 kB]
Get:7 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages [11.3 MB]
Get:8 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [2937 kB]
Get:9 http://security.ubuntu.com/ubuntu bionic-security/restricted amd64 Packages [1100 kB]
Get:10 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages [22.8 kB]
Get:11 http://archive.ubuntu.com/ubuntu bionic/restricted amd64 Packages [13.5 kB]
Get:12 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages [1344 kB]
Get:13 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [2311 kB]
Get:14 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [3369 kB]
Get:15 http://archive.ubuntu.com/ubuntu bionic-updates/restricted amd64 Packages [1141 kB]
Get:16 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 Packages [29.9 kB]
Get:17 http://archive.ubuntu.com/ubuntu bionic-backports/universe amd64 Packages [12.9 kB]
Get:18 http://archive.ubuntu.com/ubuntu bionic-backports/main amd64 Packages [12.2 kB]
Fetched 25.8 MB in 14s (1792 kB/s)
Reading package lists...

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
E: Unsupported file /deb/ctp2-.deb given on commandline
The command '/bin/sh -c apt-get update && apt install -y --no-install-recommends     /deb/ctp2-${BTYP}.deb &&     apt-get clean &&     rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100

If I remove those lines, it builds successfully but running the Docker container it made fails (it can't find "./ctp2", which makes sense because I commented the last bit out).

I'm honestly not sure how to approach this or what would be considered best practices for this repo but I would love to talk out how to add support for Lubuntu somewhere. Is there some sort of Discord or group chat for contributors?

Thank you again!

@LynxAbraxas
Copy link
Contributor

LynxAbraxas commented Aug 23, 2022

ctp2CD/needs to be populated with the files of the game that are not included in the open source repo (due to the specific release license of activision at that time). Thoes do not have to come from CD, e.g. also those from the GoG versions do work but would need to exist in that folder. Also the DEP- package needs these, because so far we are not allowed to pack those files (due to the license).

see e.g. here for what the GL-CI does:

civctp2/.gitlab-ci.yml

Lines 43 to 62 in 5c67aa3

- docker run --rm
--volume $(pwd)/debian/:/debian/
--volume $(pwd)/deb/:/deb/
--volume $(pwd)/tools/build-deb.sh:/tools/build-deb.sh:ro
$IMAGE_TAG:builder-latest-${CI_JOB_NAME}
tools/build-deb.sh ${CI_JOB_NAME} # create deb-package from pre-compiled files
## 3rd stage build using system-latest and builder-latest for caching
- apk add --update --no-cache curl
- 'curl -sS -f -L --header "Private-Token: ${ARTIFACTKEY}" -o ctp2CD.zip "${CI_API_V4_URL}/projects/${CI_PROJECT_NAMESPACE}%2Fctp2CD/jobs/artifacts/master/download?job=ctp2CDpack"'
- mkdir -p ctp2CD/
- unzip ctp2CD.zip -d ctp2CD/
- docker pull $IMAGE_TAG:test-${CI_JOB_NAME} || true
- docker build --pull
--cache-from $IMAGE_TAG:system-latest
--cache-from $IMAGE_TAG:builder-latest-${CI_JOB_NAME}
--cache-from $IMAGE_TAG:test-${CI_JOB_NAME}
--tag $IMAGE_TAG:test-${CI_JOB_NAME}
--build-arg BTYP=${CI_JOB_NAME}
--target install
.

@justinfarrelldev
Copy link
Author

ctp2CD/needs to be populated with the files of the game that are not included in the open source repo (due to the specific release license of activision at that time). Thoes do not have to come from CD, e.g. also those from the GoG versions do work but would need to exist in that folder. Also the DEP- package needs these, because so far we are not allowed to pack those files (due to the license).

see e.g. here for what the GL-CI does:

civctp2/.gitlab-ci.yml

Lines 43 to 62 in 5c67aa3

- docker run --rm
--volume $(pwd)/debian/:/debian/
--volume $(pwd)/deb/:/deb/
--volume $(pwd)/tools/build-deb.sh:/tools/build-deb.sh:ro
$IMAGE_TAG:builder-latest-${CI_JOB_NAME}
tools/build-deb.sh ${CI_JOB_NAME} # create deb-package from pre-compiled files
## 3rd stage build using system-latest and builder-latest for caching
- apk add --update --no-cache curl
- 'curl -sS -f -L --header "Private-Token: ${ARTIFACTKEY}" -o ctp2CD.zip "${CI_API_V4_URL}/projects/${CI_PROJECT_NAMESPACE}%2Fctp2CD/jobs/artifacts/master/download?job=ctp2CDpack"'
- mkdir -p ctp2CD/
- unzip ctp2CD.zip -d ctp2CD/
- docker pull $IMAGE_TAG:test-${CI_JOB_NAME} || true
- docker build --pull
--cache-from $IMAGE_TAG:system-latest
--cache-from $IMAGE_TAG:builder-latest-${CI_JOB_NAME}
--cache-from $IMAGE_TAG:test-${CI_JOB_NAME}
--tag $IMAGE_TAG:test-${CI_JOB_NAME}
--build-arg BTYP=${CI_JOB_NAME}
--target install
.

Once again, thank you so much. I will try zipping my edition up into a ctp2CD.zip later and try again. I really appreciate all of your help!

@justinfarrelldev
Copy link
Author

justinfarrelldev commented Aug 27, 2022

Okay, I managed to get the build to be successful (I built with docker build -t ctp2 --build-arg BTYP=plain .), however when I used docker run ctp2 it crashed immediately (and silently) with the exit code 139 (Seg fault).

Here was the output of the Docker build (at the bottom, as I said it was completely successful):

Successfully built 95f32251b10a
Successfully tagged ctp2:latest

Any ideas on what could segfault it? I'm also trying to build locally (hopefully should work now with the same steps as Docker) and trying a debug build.
Thank you!

@justinfarrelldev
Copy link
Author

justinfarrelldev commented Aug 27, 2022

Built debug version, error for the segfault:

Assertion (dir) Failed in File:ctp/ctp2_utils/c3debug.cpp, Line:113
Messagebox(Assert): Assertion (dir) Failed in File:ctp/ctp2_utils/c3debug.cpp, Line:113

Edit: tried saving the image's filesystem but the find command couldn't find any files with the name "c3debug.cpp" when I extracted the tars for the layers

@LynxAbraxas
Copy link
Contributor

LynxAbraxas commented Aug 27, 2022

Your error probably comes from a missing volume/mount into the docker container, like

civctp2/tools/run-DI.sh

Lines 60 to 63 in 5c67aa3

-v $HOME/.civctp2/save/:/opt/ctp2/ctp2_program/ctp/save \
-v $HOME/.civctp2/logs/:/opt/ctp2/ctp2_program/ctp/logs \
-v $HOME/.civctp2/maps/:/opt/ctp2/ctp2_program/ctp/maps \
-v $HOME/.civctp2/Scenarios/:/opt/ctp2/Scenarios \

The docker run command needs some extra work due to the graphics. I use
https://github.com/civctp2/civctp2/blob/5c67aa3eabfb0829335a942a32d20d576ea641d7/tools/run-DI.sh
for playing the game from the DI with e.g.
tools/run-DI.sh -v ~/civctp1-music/:/opt/ctp2/ctp2_program/ctp/music/:ro -v ~/videos/:/opt/ctp2/ctp2_data/default/videos/:ro --env="ALSA_CARD=1" ctp2 ./ctp2

@LynxAbraxas
Copy link
Contributor

I might find some time in the next days (no guaranty though) to test the situation with a docker-image based on the current ubuntu.

see #385

@justinfarrelldev
Copy link
Author

Your error probably comes from a missing volume/mount into the docker container, like

civctp2/tools/run-DI.sh

Lines 60 to 63 in 5c67aa3

-v $HOME/.civctp2/save/:/opt/ctp2/ctp2_program/ctp/save \
-v $HOME/.civctp2/logs/:/opt/ctp2/ctp2_program/ctp/logs \
-v $HOME/.civctp2/maps/:/opt/ctp2/ctp2_program/ctp/maps \
-v $HOME/.civctp2/Scenarios/:/opt/ctp2/Scenarios \

The docker run command needs some extra work due to the graphics. I use
https://github.com/civctp2/civctp2/blob/5c67aa3eabfb0829335a942a32d20d576ea641d7/tools/run-DI.sh
for playing the game from the DI with e.g.
tools/run-DI.sh -v ~/civctp1-music/:/opt/ctp2/ctp2_program/ctp/music/:ro -v ~/videos/:/opt/ctp2/ctp2_data/default/videos/:ro --env="ALSA_CARD=1" ctp2 ./ctp2

Okay awesome, I'll try that out!

I might find some time in the next days (no guaranty though) to test the situation with a docker-image based on the current ubuntu.

see #385

That's literally awesome news, thank you! 😁

@LynxAbraxas
Copy link
Contributor

Built debug version, error for the segfault:

Assertion (dir) Failed in File:ctp/ctp2_utils/c3debug.cpp, Line:113
Messagebox(Assert): Assertion (dir) Failed in File:ctp/ctp2_utils/c3debug.cpp, Line:113

Edit: tried saving the image's filesystem but the find command couldn't find any files with the name "c3debug.cpp" when I extracted the tars for the layers

BTW: The source files are not part of the final DEP nor in the final DI. The message comes from the info the compiler left in the built files for debugging, i.e. the source files are to be found in the source repo (or in case of the records, those are generated during compile time from the record files).

@justinfarrelldev
Copy link
Author

justinfarrelldev commented Aug 29, 2022

Built debug version, error for the segfault:

Assertion (dir) Failed in File:ctp/ctp2_utils/c3debug.cpp, Line:113
Messagebox(Assert): Assertion (dir) Failed in File:ctp/ctp2_utils/c3debug.cpp, Line:113

Edit: tried saving the image's filesystem but the find command couldn't find any files with the name "c3debug.cpp" when I extracted the tars for the layers

BTW: The source files are not part of the final DEP nor in the final DI. The message comes from the info the compiler left in the built files for debugging, i.e. the source files are to be found in the source repo (or in case of the records, those are generated during compile time from the record files).

Thank you for this, I see the files now (under ctp2_code). That honestly gives a ton of insight.

Also, I have amazing news!
ctp_running

It boots into the menu and the game as a whole! :D I used tools/run-DI.sh -v ./ctp2CD/ctp2_program/ctp/music ctp2 ./ctp2 as my command to run it

It feels so good to have gotten this far. I do have some issues actually loading into a map though:

ALSA lib pcm.c:8306:(snd_pcm_recover) underrun occurred
[swscaler @ 0x564dfdfda820] Warning: data is not aligned! This can lead to a speed loss
ALSA lib pcm.c:8306:(snd_pcm_recover) underrun occurred
Messagebox(Map Generator Error): Plugin  is not a valid map generator

Continue?
Assertion (firstPass) Failed in File:wldgen.cpp, Line:371
Messagebox(Assert): Assertion (firstPass) Failed in File:wldgen.cpp, Line:371

Assertion (index >= 0) Failed in File:../ctp2_code/gs/newdb/CTPDatabase.h, Line:122
Messagebox(Assert): Assertion (index >= 0) Failed in File:../ctp2_code/gs/newdb/CTPDatabase.h, Line:122

This occurs when I simply click singleplayer->launch and when things start to load (after clicking ignore twice, it simply crashes). I've tracked that error message down to wldgen.cpp line 2591, and I'ma see what the value of name is and how that all loads to see if I can't debug the solution out (and if it's a simple fix or something I forgot haha).

I'm also noticing that there are no scenarios which makes me think maybe there is code that isn't being added somehow.

@LynxAbraxas
Copy link
Contributor

underrun occurredisn't critical (have that too, could probably improved)
The other errors I never had (as far as I can remember). Perhaps try building a non-debug DI and check if that works. Concerning the scenarios there are some threads here, which might have extra info I can't remember right now, but even scenarios should work under linux with current master, perhaps @MartinGuehmann has some ideas on what might be going wrong here.

@LynxAbraxas
Copy link
Contributor

Hm, just noticed in your screen shot that the compilation date shown is 2022-07-06. Either your system date is off or you have a compilation that is not from your recent attempts.

@justinfarrelldev
Copy link
Author

Hm, just noticed in your screen shot that the compilation date shown is 2022-07-06. Either your system date is off or you have a compilation that is not from your recent attempts.

Oh wow I didn't even notice that. My system date is correct (just checked) so that is really interesting, I took that screenshot the same night as I made the comment

I think I'ma try cloning into another folder and doing the steps again, just to make sure my fiddling around didn't mess anything up, I'll let you know when I do that how it works out

@justinfarrelldev
Copy link
Author

justinfarrelldev commented Aug 30, 2022

Okay, I just re-cloned and got the same results. Here are the exact commands I ran to get this to happen (copy pasted from my terminal history):
git clone https://github.com/civctp2/civctp2
cd civctp2

From there, I moved the ctp2CD and deb folders into the top level of the project. The deb files were found from GitLab runs.

From there, I built and ran:

docker build -t ctp2-test --build-arg BTYP=debug .
tools/run-DI.sh -v ./ctp2CD/ctp2_program/ctp/music ctp2-test ./ctp2

Here is the output:

ALSA lib pcm.c:8306:(snd_pcm_recover) underrun occurred
[swscaler @ 0x56216fa01820] Warning: data is not aligned! This can lead to a speed loss
Messagebox(Map Generator Error): Plugin  is not a valid map generator

Continue?
Assertion (firstPass) Failed in File:wldgen.cpp, Line:371
Messagebox(Assert): Assertion (firstPass) Failed in File:wldgen.cpp, Line:371

Assertion (index >= 0) Failed in File:../ctp2_code/gs/newdb/CTPDatabase.h, Line:122
Messagebox(Assert): Assertion (index >= 0) Failed in File:../ctp2_code/gs/newdb/CTPDatabase.h, Line:122

It also, notably, still says 2022-07-06 on the title screen (I definitely did not have this copy of CTP2 at that time, I purchased it 2 weeks ago, so I'm really not sure where it could come from - maybe the .deb files I got?).

Lastly, I added the video folder into the run command (forgot it last time):
tools/run-DI.sh -v ./ctp2CD/ctp2_program/ctp/music -v ./ctp2CD/ctp2_data/default/videos ctp2-test ./ctp2

Still the same result sadly :(

Thank you guys so much for helping though, I know this is a long one

@MartinGuehmann
Copy link
Collaborator

I guess you did not build CTP2 yourself but are using the version from the deb file, @justinfarrelldev. 2022-07-06 is the day when I merged the last time something into master. Anyway, when I build it myself as debug version and start a new game than I get this:

Could not load library dll\\map\\geometric.dll, using builtin map generator: dll//map//geometric.so: cannot open shared object file: No such file or directoryAssertion (firstPass) Failed in File:wldgen.cpp, Line:391
Messagebox(Assert): Assertion (firstPass) Failed in File:wldgen.cpp, Line:391

Assertion (index >= 0) Failed in File:../ctp2_code/gs/newdb/CTPDatabase.h, Line:122
Messagebox(Assert): Assertion (index >= 0) Failed in File:../ctp2_code/gs/newdb/CTPDatabase.h, Line:122

Speicherzugriffsfehler (Speicherabzug geschrieben)

It is a bit wired why it is looking for the Windows map plugins first. But then it looks for the Linux map plugins. However, there is no geometric.so generated even not in the wrong folder.

@LynxAbraxas
Copy link
Contributor

I guess you did not build CTP2 yourself but are using the version from the deb file, @justinfarrelldev. 2022-07-06 is the day when I merged the last time something into master.

True, didn't think of that. So you got the DEB from the GL-CI built? That's fine, it wouldn't contain any of your changes though (if you already made any).

It is a bit wired why it is looking for the Windows map plugins first. But then it looks for the Linux map plugins. However, there is no geometric.so generated even not in the wrong folder.

Odd, it gets built and copied here:
https://gitlab.com/civctp2/civctp2/-/jobs/2687671624#L7179

@MartinGuehmann
Copy link
Collaborator

It is a bit wired why it is looking for the Windows map plugins first. But then it looks for the Linux map plugins. However, there is no geometric.so generated even not in the wrong folder.

Odd, it gets built and copied here: https://gitlab.com/civctp2/civctp2/-/jobs/2687671624#L7179

That line says:
[7179](https://gitlab.com/civctp2/civctp2/-/jobs/2687671624#L7179) inflating: ctp2_program/ctp/dll/map/geometric.dll

I guess inflating means copying. Where does i copying it from and why is it a dll, that is a Windows library. So it should not build it.

That is during installation, which is also fine:
'/ctp2/ctp2_code/mapgen/.libs/geometric.so' -> '/opt/ctp2/ctp2_program/ctp/dll/map/geometric.so'

However, the map plugins are not generated at the position or copied to the position where the development version expects them. That would be: ctp2/ctp2_code/ctp/dll/map/geometric.so

@LynxAbraxas
Copy link
Contributor

That line says: [7179](https://gitlab.com/civctp2/civctp2/-/jobs/2687671624#L7179) inflating: ctp2_program/ctp/dll/map/geometric.dll

I guess inflating means copying. Where does i copying it from and why is it a dll, that is a Windows library. So it should not build it.

Sorry, got the wrong line in the long logs. It's where the content of the CD is deflated from the ZIP, so that's the old original windows DLL.

That is during installation, which is also fine: '/ctp2/ctp2_code/mapgen/.libs/geometric.so' -> '/opt/ctp2/ctp2_program/ctp/dll/map/geometric.so'

That's the right one.

However, the map plugins are not generated at the position or copied to the position where the development version expects them. That would be: ctp2/ctp2_code/ctp/dll/map/geometric.so

Odd, could it be that it does not matter? The GL-CI tests for the development version pass all fine.

@LynxAbraxas
Copy link
Contributor

docker build -t ctp2-test --build-arg BTYP=debug . tools/run-DI.sh -v ./ctp2CD/ctp2_program/ctp/music ctp2-test ./ctp2

@justinfarrelldev have a try wit --build-arg BTYP=plain, that might be better for a start. It's odd you face so much problems on Lubuntu.

@MartinGuehmann
Copy link
Collaborator

Odd, could it be that it does not matter? The GL-CI tests for the development version pass all fine.

What is the directory the GL-CI is running from? I guess it is not ctp2/ctp2_code/ctp/.

@justinfarrelldev
Copy link
Author

justinfarrelldev commented Sep 3, 2022

docker build -t ctp2-test --build-arg BTYP=debug . tools/run-DI.sh -v ./ctp2CD/ctp2_program/ctp/music ctp2-test ./ctp2

@justinfarrelldev have a try wit --build-arg BTYP=plain, that might be better for a start. It's odd you face so much problems on Lubuntu.

Will do as soon as I can! Sorry I haven't replied much, I have been very busy and haven't gotten to try out anything since my last reply

Edit 9/4/22: I'm still gonna try it out, I'm just absolutely busy at the moment.

@LynxAbraxas
Copy link
Contributor

Edit 9/4/22: I'm still gonna try it out, I'm just absolutely busy at the moment.

Did it work for you? I'll be off again soon (till at least Christmas).

@justinfarrelldev
Copy link
Author

justinfarrelldev commented Sep 15, 2022

Edit 9/4/22: I'm still gonna try it out, I'm just absolutely busy at the moment.

Did it work for you? I'll be off again soon (till at least Christmas).

I'll try it again tonight (I've been quite busy, sorry!).

Edit: still have not gotten around to it. Honestly been a wild month, I haven't forgotten

@LynxAbraxas
Copy link
Contributor

Sorry, I'll be off for the time being now. Hope you can get it to work, in any case please let us know, either how you got it to work (and what was the problem) or if it is still not working for you (I'll probably be back some time around Christmas to continue helping). Running the game either directly or from the DI only needs an Xserver instance (like during the smoke tests, SDL even supports to avoid that by unsing fbdev), so it should not matter weather Ubuntu/Lubuntu/Kubuntu or the like is used.

@LynxAbraxas
Copy link
Contributor

@justinfarrelldev So what's the status?

@justinfarrelldev
Copy link
Author

@justinfarrelldev So what's the status?

Just got access to a Windows computer so I'm just giving it a shot on there. Was never able to get it working on Lubuntu or Mint when I tried that

@justinfarrelldev
Copy link
Author

justinfarrelldev commented Jan 15, 2023

I'm still completely unable to build on Windows or on Lubuntu (even after following #379 and checking out #348 thoroughly). I'd love to contribute to the repo, I just can't figure out how to build for the life of me. Is there any chance that we could have the documentation updated?

I'm not the only person struggling with the build process at the moment (as shown by #348 never being resolved) and I really think that the game would be in a much better place overall if the build instructions and readme were up-to-date and clear for Windows as well as Linux.

At the moment, they're full of loads of technical details and not very easily digestible (and, importantly, lack a clear process for building for Linux and especially Windows). It should probably be mentioned in the readme as well that the only verified build is g++ on Ubuntu (and mention which Ubuntu version - is it latest, 18.04, 14.04? New devs won't want to dig into the CI or issues to find out. Also, which version of g++?).

Maybe someone who can build and has in-depth knowledge of the repo can step through the process with a clean slate in a VM? That way, they could note every step of the process, their thought process behind stuff, GitLab downloads and everything necessary to get the edition working properly.

I'm not meaning to come off snarky or pushy in any way, I just really care about the game and would love to play an up-to-date version of the Apolyton Edition. Apolyton Edition has always been the pinnacle of CTP2 gameplay (and, in the last few years, has been the only way to play multiplayer at all). Having it more easily accessible, buildable and editable is crucial for CTP2's playerbase to stick around. We're practically an endangered species haha. What are your thoughts @LynxAbraxas @MartinGuehmann?

@justinfarrelldev
Copy link
Author

I should also follow that up with that I really, genuinely appreciate the work you guys have put in over the years. Don't get me wrong, I think you are all doing brilliant work!

@LynxAbraxas
Copy link
Contributor

LynxAbraxas commented Mar 19, 2023

I'm still completely unable to build on Windows or on Lubuntu (even after following #379 and checking out #348 thoroughly). I'd love to contribute to the repo, I just can't figure out how to build for the life of me. Is there any chance that we could have the documentation updated?

Sure, but for me so far it is not clear what is missing for you in the documentation and where your problems currently lie.

I'm not the only person struggling with the build process at the moment (as shown by #348 never being resolved) and I really think that the game would be in a much better place overall if the build instructions and readme were up-to-date and clear for Windows as well as Linux.

Sorry, so far I've ever only built and played CTP2 on Linux.

At the moment, they're full of loads of technical details

Hm, how about contributing a modified Readme in a new PR by You? Then we can discuss Your suggested changes there;-)

which Ubuntu version - is it latest, 18.04, 14.04?

Since #385 is merged (7eb2091) it is

FROM ubuntu as system

which means ubuntu:latest (ubuntu:latest tag points to the "latest LTS" (https://hub.docker.com/_/ubuntu) so currently latest is 22.04 (jammy))

which version of g++?

The default that comes with ubuntu:latest:

byacc gcc g++ automake make libtool unzip flex git ca-certificates

Maybe someone who can build and has in-depth knowledge of the repo can step through the process with a clean slate in a VM?

Well, that is basically what is done in the Dockerfile:

  1. civctp2/Dockerfile

    Lines 18 to 21 in 9cd7c30

    RUN apt-get update && \
    DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install -y --no-install-recommends \
    libsdl2-dev libsdl2-mixer-dev libsdl2-image-dev libtiff-dev libavcodec-dev libavformat-dev libswscale-dev \
    byacc gcc g++ automake make libtool unzip flex git ca-certificates
    install all necessary tools and libraries as dev-packages for building the game from source.
  2. if you compile in the base dir of the git-repo, you just need

    civctp2/Dockerfile

    Lines 40 to 44 in 9cd7c30

    && ./autogen.sh && \
    CFLAGS="$CFLAGS -Wno-misleading-indentation $( [ "${BTYP##*debug*}" ] && echo -O3 || echo -g -rdynamic ) -fuse-ld=gold" \
    CXXFLAGS="$CXXFLAGS -Wno-misleading-indentation -fpermissive $( [ "${BTYP##*debug*}" ] && echo -O3 || echo -g -rdynamic ) -fuse-ld=gold" \
    ./configure --prefix=/opt/ctp2 --bindir=/opt/ctp2/ctp2_program/ctp --enable-silent-rules $( [ "${BTYP##*debug*}" ] || echo --enable-debug ) \
    && make -j"$(nproc)" \
    which generates the configure script runs it with params for installing to /opt/ctp2 either for the debug version or the plain version and then compiles the code with make.
  3. if you do not want to create a DEP-File (as done in

    civctp2/.gitlab-ci.yml

    Lines 44 to 50 in 67532c1

    - mkdir -p deb/ # create artifacts folder
    - docker run --rm
    --volume $(pwd)/debian/:/debian/
    --volume $(pwd)/deb/:/deb/
    --volume $(pwd)/tools/build-deb.sh:/tools/build-deb.sh:ro
    $IMAGE_TAG:builder-latest-${CI_JOB_NAME}
    tools/build-deb.sh ${CI_JOB_NAME} # create deb-package from pre-compiled files
    and used in

    civctp2/Dockerfile

    Lines 65 to 69 in 9cd7c30

    ## apt install installs local deb-file with its dependencies: https://unix.stackexchange.com/questions/159094/how-to-install-a-deb-file-by-dpkg-i-or-by-apt#159114
    RUN apt-get update && apt install -y --no-install-recommends \
    /deb/ctp2-${BTYP}.deb && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*
    ) you have to copy the game-files from the original CD or the files obtained from GoG
    COPY ctp2CD/ /opt/ctp2/
    to the install destination before
  4. running

    civctp2/Dockerfile

    Lines 45 to 48 in 9cd7c30

    && make -j"$(nproc)" install \
    && cp -r /ctp2/ctp2_data/ /opt/ctp2/ \
    && mkdir -p /opt/ctp2/ctp2_program/ctp/dll/map/ \
    && cp -v /ctp2/ctp2_code/mapgen/.libs/*.so /opt/ctp2/ctp2_program/ctp/dll/map/
    which copies the newly built game and new/replacement game-files from the repo over the corresponding old files in /opt/ctp2
  5. then changing into
    WORKDIR /opt/ctp2/ctp2_program/ctp/
    and running
    ./ctp2 $CTP_PARAMS &
    (can be without any params) should start the game (if done from a running X-session).

That way, they could note every step of the process, their thought process behind stuff, GitLab downloads and everything necessary to get the edition working properly.

A download of a DEP-file from GitLab is only needed if you do not want to compile the game yourself. It works like other DEP-Packages with binaries except that again you need to provide the original game files prior to installing the DEP-file, which is what is done in

civctp2/Dockerfile

Lines 58 to 67 in 9cd7c30

## ctp2CD/ copy done in install stage such that stages before are compatible with travis docker build, results in one additional layer in the final DI (incr. DI download size)
COPY ctp2CD/ /opt/ctp2/
## ctp2 install has to be after ctp2CD/ to overwrite with newer versions from civctp2
## deb-file has to be copied first, sadly this adds a layer (which is not necessary with COPY --from=builder): https://stackoverflow.com/questions/52211895/docker-build-avoid-adding-files-only-needed-at-build-time
COPY deb/ /deb/
## apt install installs local deb-file with its dependencies: https://unix.stackexchange.com/questions/159094/how-to-install-a-deb-file-by-dpkg-i-or-by-apt#159114
RUN apt-get update && apt install -y --no-install-recommends \
/deb/ctp2-${BTYP}.deb && \

I'm not meaning to come off snarky or pushy in any way, I just really care about the game and would love to play an up-to-date version of the Apolyton Edition. Apolyton Edition has always been the pinnacle of CTP2 gameplay (and, in the last few years, has been the only way to play multiplayer at all). Having it more easily accessible, buildable and editable is crucial for CTP2's playerbase to stick around.

Sady, building the game was never tuned to be user-friendly (since it originally was closed source) and still is not like FOSS due to the given EULA. That's why I introduced the DEP-files from GL-CI Artifacts, so that user that only want to play the newest version of the game on linux do not need to cope with the built-process at all.

We're practically an endangered species haha.

That's why we are very happy about everyone trying out the current CTP2 and in particular contributing issues or PRs here;-)

@MartinGuehmann
Copy link
Collaborator

Since, the readme file has been updated with better build instructions, I consider this as completed. If not please open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants