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

Error building on Raspberry Pi 2 #254

Closed
vanfanel opened this issue May 19, 2016 · 29 comments
Closed

Error building on Raspberry Pi 2 #254

vanfanel opened this issue May 19, 2016 · 29 comments

Comments

@vanfanel
Copy link

vanfanel commented May 19, 2016

I am trying to build on Pi2, but I get this:

In file included from /home/pi/src/Commander-Genius/src/engine/keen/galaxy/common/ai/platform/CVarPlatform.cpp:8:0:
/home/pi/src/Commander-Genius/src/engine/keen/galaxy/common/ai/platform/CVarPlatform.h: In member function 'virtual void galaxy::CVarPlatform::_ZTv0_n112_N6galaxy12CVarPlatform9serializeER19CSaveGameController(CSaveGameController&)':
/home/pi/src/Commander-Genius/src/engine/keen/galaxy/common/ai/platform/CVarPlatform.h:37:10: internal compiler error: Segmentation fault
     void serialize(CSaveGameController &savedGame)
          ^
Please submit a full bug report,
with preprocessed source if appropriate.

I configured CG with these:

cmake -DUSE_SDL2=yes -DBUILD_TARGET=LINUX -DCMAKE_BUILD_TYPE=Release -DDBFUSION=no -DTREMOR=NO -DOPENGL=no -DREFKEEN=no ..

Any idea on what is going on here?

@ildar
Copy link

ildar commented May 19, 2016 via email

@vanfanel
Copy link
Author

vanfanel commented May 19, 2016

@Lidar

pi@raspberrypi:~/src/Commander-Genius/b3 $ cmake -DUSE_SDL2=yes -DBUILD_TARGET=LINUX -DCMAKE_BUILD_TYPE=Release -DDBFUSION=no -DTREMOR=NO -DOPENGL=no -DREFKEEN=no -DDOWNLOADER=no ..
-- The C compiler identification is GNU 4.9.2
-- The CXX compiler identification is GNU 4.9.2
-- Check for working C compiler: /usr/lib/distcc/cc
-- Check for working C compiler: /usr/lib/distcc/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/lib/distcc/c++
-- Check for working CXX compiler: /usr/lib/distcc/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- cotire 1.7.6 loaded.
-- Preparing the Build-System for Commander Genius
-- Setting SYSTEM_DATA_DIR to /usr/local/
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.28")
-- checking for one of the modules 'sdl2'
-- Using shared SDL Version 2 for Commander Genius
-- Boost version: 1.55.0
-- checking for one of the modules 'SDL2_image>=2.0.0'
-- Using shared SDL Version 2 for Commander Genius
-- DOSBox-Fusion: no
-- Internal Downloader: no
-- Refkeen for Keen Dreams: no
-- CXX target CGeniusExe cotired.
-- CPACK_PACKAGE_VERSION = 1.9.3-Beta
-- Build system is prepared. To Build the project just type "make"
-- If you want to create the installation package just type "make package" after you build the project
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/src/Commander-Genius/b3

So it's 4.9.2. Also, this is what's on default Raspbian (Raspberry Pi GNU/Linux official distro) right now, nothing unstable/experimental...

More info about the compiler:

pi@raspberrypi:~/src/Commander-Genius/b3 $ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.9/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Raspbian 4.9.2-10' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libitm --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-armhf/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-armhf --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-armhf --with-arch-directory=arm --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-sjlj-exceptions --with-arch=armv6 --with-fpu=vfp --with-float=hard --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
Thread model: posix
gcc version 4.9.2 (Raspbian 4.9.2-10)

@ildar
Copy link

ildar commented May 19, 2016 via email

@vanfanel
Copy link
Author

@ildar : This is what we have on Raspbian. I could of course build my own gcc 5.x but even if that works, it won't be using Raspbian's compiler...

@gerstrong
Copy link
Owner

I remember we had that problem before. Is it possible that the build system take too much memory on the compiling system. What if you try to build it again.
Does it continue with other files or are you stuck at the same file?

@vanfanel
Copy link
Author

@gerstrong
It's always failing at the same point. I have also tried with a BIG external swapdisk (8GB, free command confirms it's being used), but I get the same error. So it's not memory shortage.

@ildar
Copy link

ildar commented May 20, 2016 via email

@vanfanel
Copy link
Author

@Lidar: Do you mean other than GCC or a different GCC version?

@ildar
Copy link

ildar commented May 21, 2016 via email

@gerstrong
Copy link
Owner

I need to check that serializer. I find it strange that it does not happen here even with the same gcc as you use.

@vanfanel
Copy link
Author

vanfanel commented May 22, 2016

@gerstrong: Do you mean you're also building for ARM or do you mean the same gcc building for X86?

@ildar
Copy link

ildar commented May 23, 2016 via email

@gerstrong
Copy link
Owner

Actually we use the Android NDK for compiling Commander Genius. We had a lot of alignment problems and so on, but pelya really helped on that. Since then all the architectures are supported including ARM.

@gerstrong gerstrong reopened this May 23, 2016
@vanfanel
Copy link
Author

vanfanel commented Jun 5, 2016

@gerstrong : I still don't get it. Are you building for X86 or ARM? (with the same compiler I am using)

@gerstrong
Copy link
Owner

Both and and also MIPS, but the Android NDK provides these compiler and they are executed all together when the APK is built

@vanfanel
Copy link
Author

vanfanel commented Jun 8, 2016

@gerstrong What does that "serializer" do? Can it be modified somehow to avoid the error? Is it needed for the main games or is it dependant on some accesory functionality that could be disabled at configure time?

@gerstrong
Copy link
Owner

It collects all the game data required for a save state. If you disable that class you are going to loose the save game feature. That would not help at all, we need to find out, why it complains. Did you try another compiler. It seems to me an unstable version. Or is C++11 somehow disabled?

@vanfanel
Copy link
Author

vanfanel commented Jun 12, 2016

@gerstrong: C++ 11 is enabled specifically. This is a compilation line (used make VERBOSE=1 to get the complete compilation lines displayed):

cd /home/pi/src/Commander-Genius/b3/src/graphics && /usr/lib/distcc/c++ -DHAS_BOOST -DOGG -DRELEASE -DSYSTEM_DATA_DIR=\"/usr/local/\" --std=gnu++11 --std=gnu++11 -O3 -DNDEBUG -I/usr/include/SDL2 -I/home/pi/src/Commander-Genius/src -I/home/pi/src/Commander-Genius/lib/GsKit -I/usr/include/vorbis -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -Werror=cast-align -O3 -o CMakeFiles/graphics.dir/effects/CColorMerge.cpp.o -c /home/pi/src/Commander-Genius/src/graphics/effects/CColorMerge.cpp

The compiler is "stable": it's the one in the official Raspberry Pi tools. Nothing custom, it's Raspbian's current version.
I have asked the foundation to update it, but it seems we're stuck with 4.9.3 for now, due to glibc version on Debian Jessie (on which Raspbian is based).
More info here:

raspberrypi/tools#61

@vanfanel
Copy link
Author

@gerstrong : got it to build by lowering the optimization level in src/CMakelists.txt from O3 to O2.
However, when I try to enter the video options it segfaults.
Also, speed seems broken: it's not always smooth, but goes from 60FPS to 30FPS (I have vsync ON).
CPU usage is ~20% on a Pi3, so that's not the problem.

@gerstrong
Copy link
Owner

Hey cool. Why it crashes with Video I cannot tell. Hmm. How could I reproduce that?

@ildar
Copy link

ildar commented Jun 24, 2016 via email

@gerstrong
Copy link
Owner

Hi I have found major issues with the sound threads and fixed those. Could you retry building CG and let me if it works better now?

@vanfanel
Copy link
Author

I am getting some undefined references on linking:

engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/id_ca.cpp.o: In functionCA_CacheMap':
id_ca.cpp:(.text+0xde8): undefined reference to mapFile' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/id_ca.cpp.o: In functionCAL_SetupGrFile()':
id_ca.cpp:(.text+0x1fcc): undefined reference to gDataMapVector' ../lib/GsKit/libGsKit.a(CInput.cpp.o): In functionCInput::resetControls(int)':
CInput.cpp:(.text+0x7310): undefined reference to gDreamsForceClose' ../lib/GsKit/libGsKit.a(CInput.cpp.o): In functionCInput::pollEvents()':
CInput.cpp:(.text+0x9f34): undefined reference to gDreamsForceClose' engine/CMakeFiles/engine.dir/CGameLauncher.cpp.o: In functionStartDreamsEngine::StartDreamsEngine(bool, std::string const&)':
CGameLauncher.cpp:(.text._ZN17StartDreamsEngineC2EbRKSs[_ZN17StartDreamsEngineC5EbRKSs]+0xb4): undefined reference to vtable for dreams::DreamsEngine' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/id_rf_a.cpp.o: In functionRFL_MaskForegroundTiles':
id_rf_a.cpp:(.text+0x694): undefined reference to mapFile' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/id_rf.cpp.o: In functionRF_MarkTileGraphics':
id_rf.cpp:(.text+0x60c): undefined reference to mapFile' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/id_rf.cpp.o: In functionRFL_CheckForAnimTile':
id_rf.cpp:(.text+0x980): undefined reference to mapFile' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/id_rf.cpp.o: In functionRFL_AnimateTiles':
id_rf.cpp:(.text+0xdec): undefined reference to mapFile' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/id_rf.cpp.o: In functionRF_Refresh':
id_rf.cpp:(.text+0x2484): undefined reference to gpRenderLock' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_act1.cpp.o: In functionGrapeThink':
kd_act1.cpp:(.text+0x3e0): undefined reference to mapFile' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_act1.cpp.o: In functionFlowerThink':
kd_act1.cpp:(.text+0x580): undefined reference to refkeen_compat_kd_play_objoffset' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_act1.cpp.o: In functionChangeFromFlower':
kd_act1.cpp:(.text+0x978): undefined reference to refkeen_compat_kd_play_objoffset' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_act2.cpp.o: In functionApelClimbThink':
kd_act2.cpp:(.text+0x74): undefined reference to mapFile' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_act2.cpp.o: In functionApelSlideThink':
kd_act2.cpp:(.text+0xe0): undefined reference to mapFile' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_act2.cpp.o: In functionCartReact':
kd_act2.cpp:(.text+0x3cc): undefined reference to mapFile' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_act2.cpp.o: In functionApelThink':
kd_act2.cpp:(.text+0x74c): undefined reference to mapFile' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_demo.cpp.o: In functionDemoLoop':
kd_demo.cpp:(.text+0x1024): undefined reference to gDreamsForceClose' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_keen.cpp.o: In functionKeenGoSleepThink':
kd_keen.cpp:(.text+0x158): undefined reference to refkeen_compat_kd_play_objoffset' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_keen.cpp.o: In functionKeenSleepThink':
kd_keen.cpp:(.text+0x230): undefined reference to refkeen_compat_kd_play_objoffset' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_keen.cpp.o: In functionKeenAirReact':
kd_keen.cpp:(.text+0x8fc): undefined reference to mapFile' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_keen.cpp.o: In functionCheckGrabPole':
kd_keen.cpp:(.text+0x1db4): undefined reference to mapFile' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_keen.cpp.o: In functionKeenDuckThink':
kd_keen.cpp:(.text+0x2340): undefined reference to mapFile' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_keen.cpp.o: In functionKeenDropThink':
kd_keen.cpp:(.text+0x2730): undefined reference to mapFile' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_keen.cpp.o: In functionKeenPoleThink':
kd_keen.cpp:(.text+0x2824): undefined reference to mapFile' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_keen.cpp.o:kd_keen.cpp:(.text+0x28f0): more undefined references tomapFile' follow
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_main.cpp.o: In function Quit': kd_main.cpp:(.text+0x320): undefined reference togDreamsForceClose'
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_play.cpp.o: In function ClipToEnds': kd_play.cpp:(.text+0xf00): undefined reference tomapFile'
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_play.cpp.o: In function ClipToEastWalls': kd_play.cpp:(.text+0x1008): undefined reference tomapFile'
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_play.cpp.o: In function ClipToWestWalls': kd_play.cpp:(.text+0x110c): undefined reference tomapFile'
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_play.cpp.o: In function CheckKeys.part.6': kd_play.cpp:(.text+0x2134): undefined reference togDreamsForceClose'
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_play.cpp.o: In function PlayLoopRun()': kd_play.cpp:(.text+0x24b4): undefined reference togDreamsForceClose'
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_play.cpp.o: In function GameLoop': kd_play.cpp:(.text+0x26e4): undefined reference togDreamsForceClose'
engine/refkeen/CMakeFiles/refkeen.dir/be_cross_fs.cpp.o: In function BE_Cross_open_for_reading': be_cross_fs.cpp:(.text+0x16c): undefined reference todreamsengine_datapath'
engine/refkeen/CMakeFiles/refkeen.dir/be_cross_fs.cpp.o: In function BE_Cross_open_for_overwriting': be_cross_fs.cpp:(.text+0x180): undefined reference todreamsengine_datapath'
engine/refkeen/CMakeFiles/refkeen.dir/be_cross_fs.cpp.o: In function BE_Cross_load_embedded_rsrc_to_mem': be_cross_fs.cpp:(.text+0x32c): undefined reference todreamsengine_datapath'
engine/refkeen/CMakeFiles/refkeen.dir/be_st_sdl_graphics.cpp.o: In function BE_ST_SetScreenMode': be_st_sdl_graphics.cpp:(.text+0xf8c): undefined reference togpRenderLock'
be_st_sdl_graphics.cpp:(.text+0xfb0): undefined reference to gDreamsEngine' collect2: error: ld returned 1 exit status distcc[13147] ERROR: compile (null) on localhost failed src/CMakeFiles/CGeniusExe.dir/build.make:787: recipe for target 'src/CGeniusExe' failed make[2]: *** [src/CGeniusExe] Error 1 CMakeFiles/Makefile2:161: recipe for target 'src/CMakeFiles/CGeniusExe.dir/all' failed make[1]: *** [src/CMakeFiles/CGeniusExe.dir/all] Error 2 Makefile:137: recipe for target 'all' failed make: *** [all] Error 2

I am configuring like this:

cmake -DUSE_SDL2=yes -DBUILD_TARGET=LINUX -DCMAKE_BUILD_TYPE=Release -DDBFUSION=no -DTREMOR=NO -DOPENGL=no -DDOWNLOADER=no ..

@gerstrong
Copy link
Owner

Try to compile one of the tag version. I'm still fixing dreams code for
better performance

Am 25.07.2016 um 13:41 schrieb The Last Cabra:

I am getting some undefined references on linking:

|engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/id_ca.cpp.o: In
function|CA_CacheMap':
id_ca.cpp:(.text+0xde8): undefined reference to |mapFile'
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/id_ca.cpp.o: In
function|CAL_SetupGrFile()':
id_ca.cpp:(.text+0x1fcc): undefined reference to |gDataMapVector'
../lib/GsKit/libGsKit.a(CInput.cpp.o): In
function|CInput::resetControls(int)':
CInput.cpp:(.text+0x7310): undefined reference to |gDreamsForceClose'
../lib/GsKit/libGsKit.a(CInput.cpp.o): In function|CInput::pollEvents()':
CInput.cpp:(.text+0x9f34): undefined reference to |gDreamsForceClose'
engine/CMakeFiles/engine.dir/CGameLauncher.cpp.o: In
function|StartDreamsEngine::StartDreamsEngine(bool, std::string const&)':
CGameLauncher.cpp:(.text._ZN17StartDreamsEngineC2EbRKSs[_ZN17StartDreamsEngineC5EbRKSs]+0xb4):
undefined reference to |vtable for dreams::DreamsEngine'
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/id_rf_a.cpp.o:
In function|RFL_MaskForegroundTiles':
id_rf_a.cpp:(.text+0x694): undefined reference to |mapFile'
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/id_rf.cpp.o: In
function|RF_MarkTileGraphics':
id_rf.cpp:(.text+0x60c): undefined reference to |mapFile'
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/id_rf.cpp.o: In
function|RFL_CheckForAnimTile':
id_rf.cpp:(.text+0x980): undefined reference to |mapFile'
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/id_rf.cpp.o: In
function|RFL_AnimateTiles':
id_rf.cpp:(.text+0xdec): undefined reference to |mapFile'
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/id_rf.cpp.o: In
function|RF_Refresh':
id_rf.cpp:(.text+0x2484): undefined reference to |gpRenderLock'
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_act1.cpp.o:
In function|GrapeThink':
kd_act1.cpp:(.text+0x3e0): undefined reference to |mapFile'
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_act1.cpp.o:
In function|FlowerThink':
kd_act1.cpp:(.text+0x580): undefined reference to
|refkeen_compat_kd_play_objoffset'
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_act1.cpp.o:
In function|ChangeFromFlower':
kd_act1.cpp:(.text+0x978): undefined reference to
|refkeen_compat_kd_play_objoffset'
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_act2.cpp.o:
In function|ApelClimbThink':
kd_act2.cpp:(.text+0x74): undefined reference to |mapFile'
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_act2.cpp.o:
In function|ApelSlideThink':
kd_act2.cpp:(.text+0xe0): undefined reference to |mapFile'
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_act2.cpp.o:
In function|CartReact':
kd_act2.cpp:(.text+0x3cc): undefined reference to |mapFile'
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_act2.cpp.o:
In function|ApelThink':
kd_act2.cpp:(.text+0x74c): undefined reference to |mapFile'
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_demo.cpp.o:
In function|DemoLoop':
kd_demo.cpp:(.text+0x1024): undefined reference to |gDreamsForceClose'
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_keen.cpp.o:
In function|KeenGoSleepThink':
kd_keen.cpp:(.text+0x158): undefined reference to
|refkeen_compat_kd_play_objoffset'
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_keen.cpp.o:
In function|KeenSleepThink':
kd_keen.cpp:(.text+0x230): undefined reference to
|refkeen_compat_kd_play_objoffset'
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_keen.cpp.o:
In function|KeenAirReact':
kd_keen.cpp:(.text+0x8fc): undefined reference to |mapFile'
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_keen.cpp.o:
In function|CheckGrabPole':
kd_keen.cpp:(.text+0x1db4): undefined reference to |mapFile'
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_keen.cpp.o:
In function|KeenDuckThink':
kd_keen.cpp:(.text+0x2340): undefined reference to |mapFile'
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_keen.cpp.o:
In function|KeenDropThink':
kd_keen.cpp:(.text+0x2730): undefined reference to |mapFile'
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_keen.cpp.o:
In function|KeenPoleThink':
kd_keen.cpp:(.text+0x2824): undefined reference to |mapFile'
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_keen.cpp.o:kd_keen.cpp:(.text+0x28f0):
more undefined references to|mapFile' follow
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_main.cpp.o:
In function |Quit':
kd_main.cpp:(.text+0x320): undefined reference to|gDreamsForceClose'
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_play.cpp.o:
In function |ClipToEnds':
kd_play.cpp:(.text+0xf00): undefined reference to|mapFile'
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_play.cpp.o:
In function |ClipToEastWalls':
kd_play.cpp:(.text+0x1008): undefined reference to|mapFile'
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_play.cpp.o:
In function |ClipToWestWalls':
kd_play.cpp:(.text+0x110c): undefined reference to|mapFile'
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_play.cpp.o:
In function |CheckKeys.part.6':
kd_play.cpp:(.text+0x2134): undefined reference to|gDreamsForceClose'
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_play.cpp.o:
In function |PlayLoopRun()':
kd_play.cpp:(.text+0x24b4): undefined reference to|gDreamsForceClose'
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_play.cpp.o:
In function |GameLoop':
kd_play.cpp:(.text+0x26e4): undefined reference to|gDreamsForceClose'
engine/refkeen/CMakeFiles/refkeen.dir/be_cross_fs.cpp.o: In function
|BE_Cross_open_for_reading':
be_cross_fs.cpp:(.text+0x16c): undefined reference
to|dreamsengine_datapath'
engine/refkeen/CMakeFiles/refkeen.dir/be_cross_fs.cpp.o: In function
|BE_Cross_open_for_overwriting':
be_cross_fs.cpp:(.text+0x180): undefined reference
to|dreamsengine_datapath'
engine/refkeen/CMakeFiles/refkeen.dir/be_cross_fs.cpp.o: In function
|BE_Cross_load_embedded_rsrc_to_mem':
be_cross_fs.cpp:(.text+0x32c): undefined reference
to|dreamsengine_datapath'
engine/refkeen/CMakeFiles/refkeen.dir/be_st_sdl_graphics.cpp.o: In
function |BE_ST_SetScreenMode':
be_st_sdl_graphics.cpp:(.text+0xf8c): undefined reference to|gpRenderLock'
be_st_sdl_graphics.cpp:(.text+0xfb0): undefined reference to
|gDreamsEngine'
collect2: error: ld returned 1 exit status
distcc[13147] ERROR: compile (null) on localhost failed
src/CMakeFiles/CGeniusExe.dir/build.make:787: recipe for target
'src/CGeniusExe' failed
make[2]: *** [src/CGeniusExe] Error 1
CMakeFiles/Makefile2:161: recipe for target
'src/CMakeFiles/CGeniusExe.dir/all' failed
make[1]: *** [src/CMakeFiles/CGeniusExe.dir/all] Error 2
Makefile:137: recipe for target 'all' failed
make: *** [all] Error 2
|

I am configuring like this:

cmake -DUSE_SDL2=yes -DBUILD_TARGET=LINUX
-DCMAKE_BUILD_TYPE=Release -DDBFUSION=no -DTREMOR=NO -DOPENGL=no
-DDOWNLOADER=no ..


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#254 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AATN5endsA0BDbl77OHoFaHikIKtKVWVks5qZKDzgaJpZM4IiK7N.

@vanfanel
Copy link
Author

vanfanel commented Jul 25, 2016

With the last tag version (v1953beta) I get the same problems on linking:

Linking CXX executable CGeniusExe engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/id_ca.cpp.o: In functionCA_CacheMap':
id_ca.cpp:(.text+0xde8): undefined reference to mapFile' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/id_ca.cpp.o: In functionCAL_SetupGrFile()':
id_ca.cpp:(.text+0x1fcc): undefined reference to gDataMapVector' ../lib/GsKit/libGsKit.a(CInput.cpp.o): In functionCInput::resetControls(int)':
CInput.cpp:(.text+0x7310): undefined reference to gDreamsForceClose' ../lib/GsKit/libGsKit.a(CInput.cpp.o): In functionCInput::pollEvents()':
CInput.cpp:(.text+0x9f34): undefined reference to gDreamsForceClose' engine/CMakeFiles/engine.dir/CGameLauncher.cpp.o: In functionStartDreamsEngine::StartDreamsEngine(bool, std::string const&)':
CGameLauncher.cpp:(.text._ZN17StartDreamsEngineC2EbRKSs[_ZN17StartDreamsEngineC5EbRKSs]+0xb4): undefined reference to vtable for dreams::DreamsEngine' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/id_rf_a.cpp.o: In functionRFL_MaskForegroundTiles':
id_rf_a.cpp:(.text+0x694): undefined reference to mapFile' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/id_rf.cpp.o: In functionRF_MarkTileGraphics':
id_rf.cpp:(.text+0x60c): undefined reference to mapFile' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/id_rf.cpp.o: In functionRFL_CheckForAnimTile':
id_rf.cpp:(.text+0x980): undefined reference to mapFile' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/id_rf.cpp.o: In functionRFL_AnimateTiles':
id_rf.cpp:(.text+0xdec): undefined reference to mapFile' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/id_rf.cpp.o: In functionRF_Refresh':
id_rf.cpp:(.text+0x2484): undefined reference to gpRenderLock' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_act1.cpp.o: In functionGrapeThink':
kd_act1.cpp:(.text+0x3e0): undefined reference to mapFile' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_act1.cpp.o: In functionFlowerThink':
kd_act1.cpp:(.text+0x580): undefined reference to refkeen_compat_kd_play_objoffset' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_act1.cpp.o: In functionChangeFromFlower':
kd_act1.cpp:(.text+0x978): undefined reference to refkeen_compat_kd_play_objoffset' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_act2.cpp.o: In functionApelClimbThink':
kd_act2.cpp:(.text+0x74): undefined reference to mapFile' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_act2.cpp.o: In functionApelSlideThink':
kd_act2.cpp:(.text+0xe0): undefined reference to mapFile' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_act2.cpp.o: In functionCartReact':
kd_act2.cpp:(.text+0x3cc): undefined reference to mapFile' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_act2.cpp.o: In functionApelThink':
kd_act2.cpp:(.text+0x74c): undefined reference to mapFile' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_demo.cpp.o: In functionDemoLoop':
kd_demo.cpp:(.text+0x11a0): undefined reference to gDreamsForceClose' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_keen.cpp.o: In functionKeenGoSleepThink':
kd_keen.cpp:(.text+0x158): undefined reference to refkeen_compat_kd_play_objoffset' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_keen.cpp.o: In functionKeenSleepThink':
kd_keen.cpp:(.text+0x230): undefined reference to refkeen_compat_kd_play_objoffset' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_keen.cpp.o: In functionKeenAirReact':
kd_keen.cpp:(.text+0x8fc): undefined reference to mapFile' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_keen.cpp.o: In functionCheckGrabPole':
kd_keen.cpp:(.text+0x1db4): undefined reference to mapFile' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_keen.cpp.o: In functionKeenDuckThink':
kd_keen.cpp:(.text+0x2340): undefined reference to mapFile' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_keen.cpp.o: In functionKeenDropThink':
kd_keen.cpp:(.text+0x2730): undefined reference to mapFile' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_keen.cpp.o: In functionKeenPoleThink':
kd_keen.cpp:(.text+0x2824): undefined reference to mapFile' engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_keen.cpp.o:kd_keen.cpp:(.text+0x28f0): more undefined references tomapFile' follow
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_main.cpp.o: In function Quit': kd_main.cpp:(.text+0x320): undefined reference togDreamsForceClose'
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_play.cpp.o: In function ClipToEnds': kd_play.cpp:(.text+0xf00): undefined reference tomapFile'
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_play.cpp.o: In function ClipToEastWalls': kd_play.cpp:(.text+0x1008): undefined reference tomapFile'
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_play.cpp.o: In function ClipToWestWalls': kd_play.cpp:(.text+0x110c): undefined reference tomapFile'
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_play.cpp.o: In function CheckKeys.part.6': kd_play.cpp:(.text+0x2134): undefined reference togDreamsForceClose'
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_play.cpp.o: In function PlayLoopRun()': kd_play.cpp:(.text+0x24b4): undefined reference togDreamsForceClose'
engine/refkeen/kdreams/CMakeFiles/refkeen_kdreams.dir/kd_play.cpp.o: In function GameLoop': kd_play.cpp:(.text+0x26e4): undefined reference togDreamsForceClose'
engine/refkeen/CMakeFiles/refkeen.dir/be_cross_fs.cpp.o: In function BE_Cross_open_for_reading': be_cross_fs.cpp:(.text+0x16c): undefined reference todreamsengine_datapath'
engine/refkeen/CMakeFiles/refkeen.dir/be_cross_fs.cpp.o: In function BE_Cross_open_for_overwriting': be_cross_fs.cpp:(.text+0x180): undefined reference todreamsengine_datapath'
engine/refkeen/CMakeFiles/refkeen.dir/be_cross_fs.cpp.o: In function BE_Cross_load_embedded_rsrc_to_mem': be_cross_fs.cpp:(.text+0x32c): undefined reference todreamsengine_datapath'
engine/refkeen/CMakeFiles/refkeen.dir/be_st_sdl_graphics.cpp.o: In function BE_ST_SetScreenMode': be_st_sdl_graphics.cpp:(.text+0xf8c): undefined reference togpRenderLock'
be_st_sdl_graphics.cpp:(.text+0xfb0): undefined reference to `gDreamsEngine'
collect2: error: ld returned 1 exit status
distcc[18403] ERROR: compile (null) on localhost failed
src/CMakeFiles/CGeniusExe.dir/build.make:787: recipe for target 'src/CGeniusExe' failed
make[2]: *** [src/CGeniusExe] Error 1
CMakeFiles/Makefile2:161: recipe for target 'src/CMakeFiles/CGeniusExe.dir/all' failed
make[1]: *** [src/CMakeFiles/CGeniusExe.dir/all] Error 2
Makefile:137: recipe for target 'all' failed
make: *** [all] Error 2

`

Building a previous version I wouldn't get your audio thread fixes.

@gerstrong
Copy link
Owner

Try the last upload. It should be better now...

@vanfanel
Copy link
Author

I have got to build this on the Pi3 finally, with some caveats...

I had to change every O3 to O2 in the build files. Then I have configured with:

cmake -DUSE_SDL2=ON -DBUILD_TARGET=LINUX -DCMAKE_BUILD_TYPE=Release -DDBFUSION=OFF -DTREMOR=OFF -DOPENGL=OFF -DDOWNLOADER=OFF ..

It builds, but the resulting executable graphics are ugly as sin, because the vsync and bilinear interpolation are ignored. Luckily, SDL2 on the Pi uses a GLES renderer ALWAYS, which is a very good thing as the interpolation is done on the renderer side if the correct SDL_SetHint() is added.
So, I had to add

SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear")

before SDL_CreateRenderer().
I also added SDL_RENDERER_PRESENTVSYNC() to SDL_CreateRenderer() flags, because the vsync setting is ignored when running on SDL2 without the game's OpenGL renderer.
NOTE: There is the GAME's OpenGL renderer (which has no sense anymore if you ask me since SDL2 uses GL to render anyway) and the SDL2 GLES renderer.

So, in my opinion:
-You should add SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear") before SDL_CreateRenderer(), this could honor the bilinear filter setting.
-You should add SDL_RENDERER_PRESENTVSYNC flag to SDL_CreateRenderer(). This could honor the VSYNC ON/OFF setting.
-Entering the GRAPHICS menu is broken and segfaults. I believe it only works well with the GAME's OpenGL renderer in use. SDL2 uses GLES/OpenGL/whatever available itself as I have said: no need for a custom GL renderer anymore.

Also, having vsync ON properly (by adding the SDL_RENDERER_PRESENTVSYNC flag to SDL_CreateRenderer()), the game's loop should NOT be waiting on anything: speed MUST rely on vsync. Framerate is limited by vsync and that's all that should happen. Right now, the timming with VSYNC on is broken, as the game sometimes goes down from 60FPS to 30FPS because it's unable to keep up with the physical screen refresh because of the added delays, which should go away when VSYNC is on.

@gerstrong
Copy link
Owner

hi @vanfanel

  • SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear") is added but you can switch to "nearest" as well. Line 35-42 in CSDLVideo.cpp

  • I have added the SDL_RENDERER_PRESENTVSYNC flag when vsync is enabled.

  • I'll take a look on the graphics menu and fix some segfaults

SDL 1.2 is still used for some older devices and Android for that one we use the additional OpenGL code.

Sorry for responding a bit late. I have a bit time now will try to fix some issues.

Anyways thanks for the hints. About the gameloop: I'm happy how it is implemented. I'll take another look. The logics per second is fixed so the game feels the same on every systems. About graphics I'll take a look.

@gerstrong
Copy link
Owner

Closing this because it seems I don't read any more complains

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