TurningWheel / Barony

Barony Open Source Release
http://www.baronygame.com/
Other
488 stars 127 forks source link

[Linux] Cannot compile source code #771

Open NicetEMi opened 1 year ago

NicetEMi commented 1 year ago

I've been trying to compile the game and after hour of installing dependency and making things works compiling with

$ make -j

will crash my computer nearing the 80-90% of compiling and make me entierly quit my session wich is kinda weird lmao. Only running with

$ make

allow me to see the errors and it returns something like this everytime:

Consolidate compiler generated dependencies of target barony [ 1%] Building CXX object CMakeFiles/barony.dir/src/init.cpp.o /home/temi/Documents/BaronyBAD/src/init.cpp: In function ‘int initApp(const char*, int)’: /home/temi/Documents/BaronyBAD/src/init.cpp:346:9: error: ‘initSoundEngine’ was not declared in this scope 346 | initSoundEngine(); //Yes, this silently ignores the return value...(which is not good, but not important either) | ^~~~~~~~~~~~~~~ /home/temi/Documents/BaronyBAD/src/init.cpp: In lambda function: /home/temi/Documents/BaronyBAD/src/init.cpp:631:35: error: ‘loadSoundResources’ was not declared in this scope 631 | int soundStatus = loadSoundResources(60, 20); // start at 60% loading, progress to 80% | ^~~~~~~~~~~~~~~~~~ /home/temi/Documents/BaronyBAD/src/init.cpp: In function ‘int deinitApp()’: /home/temi/Documents/BaronyBAD/src/init.cpp:1137:9: error: ‘freeSoundResources’ was not declared in this scope 1137 | freeSoundResources(); | ^~~~~~~~~~~~~~~~~~ /home/temi/Documents/BaronyBAD/src/init.cpp:1161:9: error: ‘exitSoundEngine’ was not declared in this scope 1161 | exitSoundEngine(); | ^~~~~~~~~~~~~~~ /home/temi/Documents/BaronyBAD/src/init.cpp:1291:15: warning: ignoring return value of ‘int system(const char*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 1291 | system(ss.str().c_str()); | ~~~~~~^~~~~~~~~~~~~~~~~~ At global scope: cc1plus: note: unrecognized command-line option ‘-Wno-inconsistent-missing-override’ may have been intended to silence earlier diagnostics cc1plus: note: unrecognized command-line option ‘-Wno-string-plus-int’ may have been intended to silence earlier diagnostics make[2]: *** [CMakeFiles/barony.dir/build.make:90 : CMakeFiles/barony.dir/src/init.cpp.o] Erreur 1 make[1]: *** [CMakeFiles/Makefile2:204 : CMakeFiles/barony.dir/all] Erreur 2 make: *** [Makefile:136 : all] Erreur 2 And even tho I understand what's the error and how i could fix it considering i'm trying to compile untouched source code from the latest official release fo the game the problem shouldn't come from the code but my compiling. My best guess it that's is something to do with PhysFS but i've litterally been unable to totally uninstall it or do anything with it so i'm resorting to posting it it.

My config:

I don't know if there's anything important I missed but I would be grateful if someone coud help I really wanted to mess around modding this game

WALLOFJUSTICE commented 1 year ago

Hi, from the looks of it you're building without sound, so no FMOD?

Does your sound.hpp file match this one? https://github.com/TurningWheel/Barony/blob/master/src/engine/audio/sound.hpp

Recently I had pushed a commit to fix build errors when not defining FMOD, in commit: https://github.com/TurningWheel/Barony/commit/2c7749a253d4a9ed1e167aeb58dd06f26739f265

Your error messages seem to indicate you don't have this commit, so recommend pulling from master and trying again?

NicetEMi commented 1 year ago

Hi, from the looks of it you're building without sound, so no FMOD?

Does your sound.hpp file match this one? https://github.com/TurningWheel/Barony/blob/master/src/engine/audio/sound.hpp

Recently I had pushed a commit to fix build errors when not defining FMOD, in commit: 2c7749a

Your error messages seem to indicate you don't have this commit, so recommend pulling from master and trying again?

It throws me back the same error just later into the build:

[ 72%] Building CXX object CMakeFiles/barony.dir/src/ui/MainMenu.cpp.o /home/temi/Documents/Barony/src/ui/MainMenu.cpp: In function ‘void MainMenu::mainEditor(Button&)’: /home/temi/Documents/Barony/src/ui/MainMenu.cpp:21302:13: error: ‘stopMusic’ was not declared in this scope 21302 | stopMusic(); | ^~~~~~~~~

and yes I'm building without sound i'm doing

$ cmake .. -DFMOD_ENABLED=OFF $ make

NicetEMi commented 1 year ago

after further testing cleaning up my build folder and trying with

$ cmake .. -DOPENAL_ENABLED=ON

I get the exact same error:

[ 93%] Building CXX object CMakeFiles/barony.dir/src/engine/audio/init_audio.cpp.o
/home/temi/Documents/Barony/src/ui/MainMenu.cpp: In function ‘void MainMenu::mainEditor(Button&)’:
/home/temi/Documents/Barony/src/ui/MainMenu.cpp:21302:13: error: ‘stopMusic’ was not declared in this scope
21302 |             stopMusic();
      |             ^~~~~~~~~

at this point i'm just tempted to remove the line myself

damiencarol commented 7 months ago

@NicetEMi take a look at my branch which allow to compile without FMOD => https://github.com/TurningWheel/Barony/pull/823

damiencarol commented 6 months ago

@NicetEMi #823 was merged, your error should be fixed now.