KozGit / DOOM-3-BFG-VR

Doom 3 BFG VR: Fully Possessed. Doom 3 BFG with native Oculus Rift/Touch or OpenVR support
GNU General Public License v3.0
372 stars 52 forks source link

Compiling error on linux - idPredictedValue is private within this context in neo/d3xp/Player.cpp #287

Closed johnr14 closed 6 years ago

johnr14 commented 6 years ago

I get the following error on compile :

/home/rek/github/DOOM-3-BFG-VR/neo/d3xp/Player.cpp: In member function ‘void idPlayerHand::debugPrint()’:
/home/rek/github/DOOM-3-BFG-VR/neo/d3xp/Player.cpp:2737:125: error: ‘idPredictedValue<type_>::idPredictedValue(const idPredictedValue<type_>&) [with type_ = int]’ is private within this context
   common->Printf( "  idealWeapon = %d, weaponSwitchTime (unused?) = %dms\n", idealWeapon, weaponSwitchTime - gameLocal.time );
                                                                                                                             ^
In file included from /home/rek/github/DOOM-3-BFG-VR/neo/d3xp/Weapon.h:32,
                 from /home/rek/github/DOOM-3-BFG-VR/neo/d3xp/Game_local.h:904,
                 from /home/rek/github/DOOM-3-BFG-VR/neo/d3xp/Player.cpp:32:
/home/rek/github/DOOM-3-BFG-VR/neo/d3xp/PredictedValue.h:70:2: note: declared private here
  idPredictedValue( const idPredictedValue< type_ >& other );

make[2]: *** [CMakeFiles/Doom3BFGVR.dir/build.make:4964: CMakeFiles/Doom3BFGVR.dir/d3xp/Player.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:74: CMakeFiles/Doom3BFGVR.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

cmake version 3.12.0 gcc version 8.2.1 20180831 [gcc-8-branch revision 264010] (SUSE Linux)

My skills are limited as I've forgotten all about C++. Sorry I can't figure it myself.

Also on opensuse, I did the following to be able to build :

zypper -ar -f http://download.opensuse.org/repositories/multimedia:/libs/openSUSE_Tumbleweed/ multimedia:libs
zypper install --type pattern devel_basis
zypper in libavformat-devel libavutil-devel libswscale-devel libavcodec-devel libSDL2-devel cmake 

and downloaded OpenVR from Valve, but had to move the files in openvr to OpenVR to make it work (case sensitive in linux).

CarlKenner commented 6 years ago

Sorry, that should be idealWeapon.get() instead of idealWeapon. My bug. Good on Linux for catching it. common->Printf( " idealWeapon = %d, weaponSwitchTime (unused?) = %dms\n", idealWeapon.get(), weaponSwitchTime - gameLocal.time );

I keep forgetting that idealWeapon is a "predicted value" and not a normal integer like currentWeapon is. I don't remember whether it is .get() or .Get(), but it should be one of those two.

johnr14 commented 6 years ago

It compiled with .Get() ! But it is not linking ... Missing openvr lib.. and Sys_SetRumble error. I will open an other issue #288 for that.

Thanks