clipmove / NotBlood

Gameplay Mod For NBlood
https://github.com/clipmove/NotBlood/releases
64 stars 4 forks source link

Error Compiling on Linux #10

Closed d10sfan closed 2 years ago

d10sfan commented 2 years ago

I am attempting to compile on Linux (tried with both gcc 8 and 9) and got the following error:

Built object obj/blood/config.o 
source/blood/src/controls.cpp: In function 'void ctrlGetInput()':
source/blood/src/controls.cpp:578:50: error: '(1.156e+3 / 6.0e+1)' is not a constant expression
         CONSTEXPR double lookStepUp = 4.0*upAngle/60.0;
                                       ~~~~~~~~~~~^~~~~
source/blood/src/controls.cpp:579:55: error: '(1.388e+3 / 6.0e+1)' is not a constant expression
         CONSTEXPR double lookStepDown = -4.0*downAngle/60.0;
                                         ~~~~~~~~~~~~~~^~~~~
make: *** [GNUmakefile:845: obj/blood/controls.o] Error 1
Building object obj/blood/controls.o...
Failed building obj/blood/controls.o from source/blood/src/controls.cpp!

I'm attempting to do the following:

# CLONE PHASE
git clone https://github.com/clipmove/NotBlood.git source
pushd source
git checkout 09c193f
popd

# BUILD PHASE
pushd source
make blood
popd

I'm attempting to build this for the steam linux runtime soldier, as part of the luxtorpeda-dev project. Let me know if you need any other information. Thanks!

tmyqlfpir commented 2 years ago

Hi! Thanks for trying out the fork.

This is very strange because I'm able to compile just fine on Linux, and that includes the github actions. I isolated just those variable to a function in godbolt and they too compiled without a hitch with GCC 8.1. Just to clarify, have you attempted to compile NBlood?

d10sfan commented 2 years ago

@tmyqlfpir Thanks for the reply!

I was able to successfully compile nblood in the same environment without any issues. Going to see if gcc 10 works any better, but strange about that demo code you have.

tmyqlfpir commented 2 years ago

How strange, I compared the makefiles to NBlood and nothing jumps out to me in terms of problems. It could be the required std is higher, but if you were able to compile NBlood then NotBlood should be just as easy. If that doesn't work, try matching the same build instructions as provided here.

d10sfan commented 2 years ago

@tmyqlfpir I ended switching to using clang and that compiled just fine, and seems to work. Thanks for the help!

tmyqlfpir commented 2 years ago

Glad to hear, thanks for the report!