TheAssemblyArmada / Vanilla-Conquer

Vanilla Conquer provides clean, cross-platform builds of the C&C Remastered Collection and the standalone legacy games.
Other
351 stars 53 forks source link

Fail to build on Pi4 #644

Closed Exarkuniv closed 3 years ago

Exarkuniv commented 3 years ago

been trying to build this on my Pi4 4gb im running Buster OS

i have g++ cmake libsdl2-dev libopenal-dev installed

i use this to set up the building mkdir build cd build cmake .. make

and i get this

[ 60%] Linking CXX executable ../vanillatd [ 60%] Built target VanillaTD [ 60%] Building CXX object redalert/CMakeFiles/VanillaRA.dir/_wsproto.cpp.o [ 60%] Building CXX object redalert/CMakeFiles/VanillaRA.dir/aadata.cpp.o In file included from /home/pi/Vanilla-Conquer/redalert/function.h:85, from /home/pi/Vanilla-Conquer/redalert/aadata.cpp:50: /home/pi/Vanilla-Conquer/redalert/heap.h: In instantiation of ‘T TFixedIHeapClass::Ptr(int) const [with T = AircraftTypeClass]’: /home/pi/Vanilla-Conquer/redalert/aadata.cpp:639:40: required from here /home/pi/Vanilla-Conquer/redalert/heap.h:246:16: error: passing ‘const DynamicVectorClass<void>’ as ‘this’ argument discards qualifiers [-fpermissive] return (T)FixedIHeapClass::ActivePointers[index]; In file included from /home/pi/Vanilla-Conquer/redalert/heap.h:38, from /home/pi/Vanilla-Conquer/redalert/function.h:85, from /home/pi/Vanilla-Conquer/redalert/aadata.cpp:50: /home/pi/Vanilla-Conquer/common/./vector.h:79:8: note: in call to ‘T& VectorClass::operator[](unsigned int) [with T = void]’ T& operator[](unsigned index) ^~~~ make[2]: [redalert/CMakeFiles/VanillaRA.dir/build.make:76: redalert/CMakeFiles/VanillaRA.dir/aadata.cpp.o] Error 1 make[1]: [CMakeFiles/Makefile2:250: redalert/CMakeFiles/VanillaRA.dir/all] Error 2 make: *** [Makefile:84: all] Error 2

not sure whats going on,

hifi commented 3 years ago

This looks like a compiler version issue. You could try adding -fpermissive to CXXFLAGS to work around the problem.

Exarkuniv commented 3 years ago

@hifi what version should i have. i know on a Pi4 we are limited but sometimes people have found ways to get the newer versions on it

also where do i add -fpermissive sorry im not any good with progamming, i can just manage how to compile things. the rest are above me

hifi commented 3 years ago

If I recall correctly you can do it something like this:

CXXFLAGS=-fpermissive cmake ..

when you run cmake.

And we don't really require recent gcc but the permissive stuff has changed over the years. It may be the other way around that your gcc is newer than what our CI is using.

Exarkuniv commented 3 years ago

thank you for that. ill let you know how it goes

Update that did it. i was able to build it perfectly. thank you

Srandista commented 2 years ago

Thanks for help @hifi, with CXXFLAGS=-fpermissive cmake .. command, I was able to compile it even on RPi 3B+.

OmegaPhil commented 2 years ago

+1ing here, on Devuan 3 (Beowulf) with gcc 8.3 and the same error. Presumably this is bad code that needs to be made standards-conformant? But the -fpermissive workaround works here, although it does not work if you also specify CMAKE build type 'Release'.