OpenJK icon indicating copy to clipboard operation
OpenJK copied to clipboard

jospgame fails to compile, Ubuntu 21.10 arm64

Open RuggedPineapple opened this issue 3 years ago • 6 comments

Jedi Academy builds and installs no problem, all parts. Jedi Outcast, however, builds all but the jospgameaarch64 project. Failure condition from the command below:

make[2]: *** [codeJK2/game/CMakeFiles/jospgameaarch64.dir/build.make:550: codeJK2/game/CMakeFiles/jospgameaarch64.dir/bg_pmove.cpp.o] Error 1

make[1]: *** [CMakeFiles/Makefile2:221: codeJK2/game/CMakeFiles/jospgameaarch64.dir/all] Error 2 make: *** [Makefile:171: all] Error 2

RuggedPineapple avatar Dec 28 '21 23:12 RuggedPineapple

For the record, the line of the makefile its complaining about is this:

cd /home/pi/openjk/build/codeJK2/game && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/jospgameaarch64.dir/bg_pmove.cpp.o -c /home/pi/openjk/codeJK2/game/bg_pmove.cpp

RuggedPineapple avatar Dec 28 '21 23:12 RuggedPineapple

Can you post the error output by the compiler please? The two lines you've pasted are just saying CMake noticed the compile failed. If you can't find it then paste the full build log.

xycaleth avatar Dec 28 '21 23:12 xycaleth

Think this is what you need:

In file included from /home/pi/openjk/codeJK2/game/../../code/qcommon/q_shared.h:106, from /home/pi/openjk/codeJK2/game/bg_pmove.cpp:31: /home/pi/openjk/codeJK2/game/bg_pmove.cpp: In function ‘qboolean PM_SaberLocked()’: /home/pi/openjk/codeJK2/game/bg_pmove.cpp:6503:48: error: ‘ret’ was not declared in this scope 6503 | assert(ret); // this would be pretty bad, the below code seems to assume the call succeeds. -gil | ^~~ /home/pi/openjk/codeJK2/game/bg_pmove.cpp: In function ‘void Pmove(pmove_t*)’: /home/pi/openjk/codeJK2/game/bg_pmove.cpp:8744:16: warning: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘struct pml_t’; use assignment or value-initialization instead [-Wclass-memaccess] 8744 | memset (&pml, 0, sizeof(pml)); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ In file included from /home/pi/openjk/codeJK2/game/bg_pmove.cpp:34: /home/pi/openjk/codeJK2/game/bg_local.h:34:16: note: ‘struct pml_t’ declared here 34 | typedef struct { | ^ make[2]: *** [codeJK2/game/CMakeFiles/jospgameaarch64.dir/build.make:550: codeJK2/game/CMakeFiles/jospgameaarch64.dir/bg_pmove.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:221: codeJK2/game/CMakeFiles/jospgameaarch64.dir/all] Error 2 make: *** [Makefile:171: all] Error 2

RuggedPineapple avatar Dec 28 '21 23:12 RuggedPineapple

looking through the issue tracker, seems to be the same cause as https://github.com/JACoders/OpenJK/issues/1097

Was there a fix? That issue notes the line is off by one and should be moved up, but im wary of messing with the code without that being confirmed.

RuggedPineapple avatar Dec 28 '21 23:12 RuggedPineapple

Took the plunge. moving the #end_if statement to encompass the assert(ret) allowed it to compile. Will test with game data.

RuggedPineapple avatar Dec 28 '21 23:12 RuggedPineapple

Works like a charm now. I don't have committing rights here, but if someone could push that change to the repo this issue can be closed.

RuggedPineapple avatar Dec 28 '21 23:12 RuggedPineapple

I've noticed this issue too, still seems to be the case. Perhaps someone can make a pull request?

JoshuaPettus avatar Mar 01 '23 18:03 JoshuaPettus