ptitSeb / Serious-Engine

A port to the OpenPandora (and working fine on plain Linux) of the open source version of a game engine developed by Croteam for the classic Serious Sam games. Status: Working (for both FE and SE).

Home Page:https://pyra-handheld.com/boards/threads/serious-sam-first-encounter.77225/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problems with building

mad-student opened this issue · comments

I started command Sources/build-linux64.sh and got this:
Will build with 'make -j4' ... please edit this script if incorrect.

  • rm -rf cmake-build

  • mkdir cmake-build

  • cd cmake-build

  • cmake -DCMAKE_BUILD_TYPE=Debug ..
    CMake Error: The source directory /Serious-Engine" does not appear to contain CMakeLists.txt.
    Specify --help for usage, or press the help button on the CMake GUI.
    Found CMakeLists.txt in "/Serious-Engine/Sources" and copy it to "~/Serious-Engine". After that restart command and got this:
    Will build with 'make -j4' ... please edit this script if incorrect.

  • rm -rf cmake-build

  • mkdir cmake-build

  • cd cmake-build

  • cmake -DCMAKE_BUILD_TYPE=Debug ..
    -- The C compiler identification is GNU 7.3.0
    -- The CXX compiler identification is unknown
    -- Check for working C compiler: /usr/bin/cc
    -- Check for working C compiler: /usr/bin/cc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    CMake Error at CMakeLists.txt:2 (project):
    No CMAKE_CXX_COMPILER could be found.

    Tell CMake where to find the compiler by setting either the environment
    variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
    to the compiler, or to the compiler name if it is in the PATH.

-- Configuring incomplete, errors occurred!
See also "/Serious-Engine/cmake-build/CMakeFiles/CMakeOutput.log".
See also "/Serious-Engine/cmake-build/CMakeFiles/CMakeError.log".
There is this files that noted in "See also...".
CMakeError.log
CMakeOutput.log
Is there any possibility to fix that error?
P.S. Sorry for my English. This language isn't native for me.
I use Lubuntu 18.04 if this matter.

It seems you are missing the g++ compiler. You have gcc, but not g++.
Maybe try some sudo apt install g++?

Thanks, it helped me a little. It go further, but I got another issue:

Will build with 'make -j4' ... please edit this script if incorrect.

  • rm -rf cmake-build
  • mkdir cmake-build
  • cd cmake-build
  • cmake -DCMAKE_BUILD_TYPE=Debug ..
    -- The C compiler identification is GNU 7.3.0
    -- The CXX compiler identification is GNU 7.3.0
    -- Check for working C compiler: /usr/bin/cc
    -- Check for working C compiler: /usr/bin/cc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Check for working CXX compiler: /usr/bin/c++
    -- Check for working CXX compiler: /usr/bin/c++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Looking for pthread.h
    -- Looking for pthread.h - found
    -- Looking for pthread_create
    -- Looking for pthread_create - not found
    -- Looking for pthread_create in pthreads
    -- Looking for pthread_create in pthreads - not found
    -- Looking for pthread_create in pthread
    -- Looking for pthread_create in pthread - found
    -- Found Threads: TRUE
    CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
    Could NOT find SDL2 (missing: SDL2_LIBRARY SDL2_INCLUDE_DIR)
    Call Stack (most recent call first):
    /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
    cmake/FindSDL2.cmake:163 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
    CMakeLists.txt:35 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/psycho/Serious-Engine/cmake-build/CMakeFiles/CMakeOutput.log".
See also "/home/psycho/Serious-Engine/cmake-build/CMakeFiles/CMakeError.log".

New log files, if it will help to understand how to fix new problem.
CMakeError.log
CMakeOutput.log

And thanks again, for the help to newbie like me.

You also need SDL2. Use sudo apt install libsdl2-dev

I installed it and after restarting command got this:
Will build with 'make -j4' ... please edit this script if incorrect.

  • rm -rf cmake-build
  • mkdir cmake-build
  • cd cmake-build
  • cmake -DCMAKE_BUILD_TYPE=Debug ..
    -- The C compiler identification is GNU 7.3.0
    -- The CXX compiler identification is GNU 7.3.0
    -- Check for working C compiler: /usr/bin/cc
    -- Check for working C compiler: /usr/bin/cc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Check for working CXX compiler: /usr/bin/c++
    -- Check for working CXX compiler: /usr/bin/c++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Looking for pthread.h
    -- Looking for pthread.h - found
    -- Looking for pthread_create
    -- Looking for pthread_create - not found
    -- Looking for pthread_create in pthreads
    -- Looking for pthread_create in pthreads - not found
    -- Looking for pthread_create in pthread
    -- Looking for pthread_create in pthread - found
    -- Found Threads: TRUE
    -- Found SDL2: /usr/lib/x86_64-linux-gnu/libSDL2main.a;/usr/lib/x86_64-linux-gnu/libSDL2.so;-lpthread
    -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11")
    WARNING,re-enable some of the warnings some day!
    -- Using assembler code (when available)
    -- Not using i386 nasm ASM
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/psycho/Serious-Engine/Sources/cmake-build
  • make -j4
    [ 0%] Generating ../Ecc/Scanner.cpp
    [ 0%] Generating ../Ecc/Parser.cpp, ../Ecc/Parser.hpp
    Ecc/Parser.y:1435 parser name defined to default :"parse"
    Ecc/Parser.y contains 86 shift/reduce conflicts and 1 reduce/reduce conflict.
    [ 0%] Generating ../Ecc/Parser.h
    Error copying file "Ecc/Parser.hpp" to "Ecc/Parser.h".
    CMakeFiles/ecc.dir/build.make:68: recipe for target '../Ecc/Parser.h' failed
    make[2]: *** [../Ecc/Parser.h] Error 1
    make[2]: *** Удаляется файл «../Ecc/Parser.h»
    CMakeFiles/Makefile2:137: recipe for target 'CMakeFiles/ecc.dir/all' failed
    make[1]: *** [CMakeFiles/ecc.dir/all] Error 2
    Makefile:129: recipe for target 'all' failed
    make: *** [all] Error 2

I have update the build-linux64.sh script.

Again, that script should not be used, I consider it deprecated and I will remove it in the future.

You'll need to update your clone (with git pull).

I got this:

Will build with 'make -j4' ... please edit this script if incorrect.

  • rm -rf cmake-build
  • mkdir cmake-build
  • cd cmake-build
  • cmake -DCMAKE_BUILD_TYPE=Debug ..
    -- The C compiler identification is GNU 7.3.0
    -- The CXX compiler identification is GNU 7.3.0
    -- Check for working C compiler: /usr/bin/cc
    -- Check for working C compiler: /usr/bin/cc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Check for working CXX compiler: /usr/bin/c++
    -- Check for working CXX compiler: /usr/bin/c++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Looking for pthread.h
    -- Looking for pthread.h - found
    -- Looking for pthread_create
    -- Looking for pthread_create - not found
    -- Looking for pthread_create in pthreads
    -- Looking for pthread_create in pthreads - not found
    -- Looking for pthread_create in pthread
    -- Looking for pthread_create in pthread - found
    -- Found Threads: TRUE
    -- Found SDL2: /usr/lib/x86_64-linux-gnu/libSDL2main.a;/usr/lib/x86_64-linux-gnu/libSDL2.so;-lpthread
    -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11")
    -- Using assembler code (when available)
    -- Not using i386 nasm ASM
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/psycho/games/Serious-Engine/Sources/cmake-build
  • echo 'ECC first'
    ECC first
  • make ecc -j4
    [ 0%] Generating ../Ecc/Parser.cpp, ../Ecc/Parser.hpp
    [ 0%] Generating ../Ecc/Scanner.cpp
    Ecc/Parser.y:1435 parser name defined to default :"parse"
    Ecc/Parser.y contains 86 shift/reduce conflicts and 1 reduce/reduce conflict.
    [ 0%] Generating ../Ecc/Parser.h
    Error copying file "Ecc/Parser.hpp" to "Ecc/Parser.h".
    CMakeFiles/ecc.dir/build.make:68: recipe for target '../Ecc/Parser.h' failed
    make[3]: *** [../Ecc/Parser.h] Error 1
    make[3]: *** Удаляется файл «../Ecc/Parser.h»
    CMakeFiles/Makefile2:213: recipe for target 'CMakeFiles/ecc.dir/all' failed
    make[2]: *** [CMakeFiles/ecc.dir/all] Error 2
    CMakeFiles/Makefile2:225: recipe for target 'CMakeFiles/ecc.dir/rule' failed
    make[1]: *** [CMakeFiles/ecc.dir/rule] Error 2
    Makefile:216: recipe for target 'ecc' failed
    make: *** [ecc] Error 2

I have updated again, hopefully it will work now.

I don't understand what is wrong but got this:
Will build with 'make -j4' ... please edit this script if incorrect.

  • rm -rf cmake-build
  • mkdir cmake-build
  • cd cmake-build
  • cmake -DCMAKE_BUILD_TYPE=Debug ..
    -- The C compiler identification is GNU 7.3.0
    -- The CXX compiler identification is GNU 7.3.0
    -- Check for working C compiler: /usr/bin/cc
    -- Check for working C compiler: /usr/bin/cc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Check for working CXX compiler: /usr/bin/c++
    -- Check for working CXX compiler: /usr/bin/c++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Looking for pthread.h
    -- Looking for pthread.h - found
    -- Looking for pthread_create
    -- Looking for pthread_create - not found
    -- Looking for pthread_create in pthreads
    -- Looking for pthread_create in pthreads - not found
    -- Looking for pthread_create in pthread
    -- Looking for pthread_create in pthread - found
    -- Found Threads: TRUE
    -- Found SDL2: /usr/lib/x86_64-linux-gnu/libSDL2main.a;/usr/lib/x86_64-linux-gnu/libSDL2.so;-lpthread
    -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11")
    -- Using assembler code (when available)
    -- Not using i386 nasm ASM
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/psycho/games/Serious-Engine/Sources/cmake-build
  • echo 'ECC first'
    ECC first
  • make ecc
    [ 0%] Generating ../Ecc/Parser.h
    Error copying file "Ecc/Parser.hpp" to "Ecc/Parser.h".
    CMakeFiles/ecc.dir/build.make:68: recipe for target '../Ecc/Parser.h' failed
    make[3]: *** [../Ecc/Parser.h] Error 1
    CMakeFiles/Makefile2:213: recipe for target 'CMakeFiles/ecc.dir/all' failed
    make[2]: *** [CMakeFiles/ecc.dir/all] Error 2
    CMakeFiles/Makefile2:225: recipe for target 'CMakeFiles/ecc.dir/rule' failed
    make[1]: *** [CMakeFiles/ecc.dir/rule] Error 2
    Makefile:216: recipe for target 'ecc' failed
    make: *** [ecc] Error 2

I don't reproduce your error on my side.
Lets start again from scratch.

Remove the clone (to be sure to start from a clean state).
Clone the repo with

git clone https://github.com/ptitSeb/Serious-Engine
cd Serious-Engine
cd Sources

then, will build in a separate folder:

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..

Then start with ecc

make ecc

And then everything

make -j2

How does that works?

After "make ecc":

[ 0%] Generating ../Ecc/Scanner.cpp
[ 0%] Generating ../Ecc/Parser.cpp, ../Ecc/Parser.hpp
Ecc/Parser.y:1435 parser name defined to default :"parse"
Ecc/Parser.y contains 86 shift/reduce conflicts and 1 reduce/reduce conflict.
[ 0%] Generating ../Ecc/Parser.h
Error copying file "Ecc/Parser.hpp" to "Ecc/Parser.h".
CMakeFiles/ecc.dir/build.make:68: recipe for target '../Ecc/Parser.h' failed
make[3]: *** [../Ecc/Parser.h] Error 1
CMakeFiles/Makefile2:143: recipe for target 'CMakeFiles/ecc.dir/all' failed
make[2]: *** [CMakeFiles/ecc.dir/all] Error 2
CMakeFiles/Makefile2:155: recipe for target 'CMakeFiles/ecc.dir/rule' failed
make[1]: *** [CMakeFiles/ecc.dir/rule] Error 2
Makefile:190: recipe for target 'ecc' failed
make: *** [ecc] Error 2

And after "make -j2":

[ 0%] Generating ../Ecc/Parser.h
Error copying file "Ecc/Parser.hpp" to "Ecc/Parser.h".
CMakeFiles/ecc.dir/build.make:68: recipe for target '../Ecc/Parser.h' failed
make[2]: *** [../Ecc/Parser.h] Error 1
CMakeFiles/Makefile2:143: recipe for target 'CMakeFiles/ecc.dir/all' failed
make[1]: *** [CMakeFiles/ecc.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

After "cmake ... " was this:
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found SDL2: /usr/lib/x86_64-linux-gnu/libSDL2main.a;/usr/lib/x86_64-linux-gnu/libSDL2.so;-lpthread
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11")
-- Using assembler code (when available)
-- Not using i386 nasm ASM
-- Configuring done
-- Generating done
-- Build files have been written to: /home/psycho/games/Serious-Engine/Sources/build

I run "cmake ..." after this "make ecc" and in the end "make -j2".

Well, something seems to go wrong with the parser/lexer...
What does
bison --version
and
flex --version
gives you?

bison++ Version 1.21.9-1, adapted from GNU bison by coetmeur@icdc.fr
Maintained by Magnus Ekdahl magnus@debian.org

flex 2.6.4

Flex is ok. But that bison version, less sure, because bison++ is not bison
Try some sudo apt install bison and then make ecc again.

I install bison and in another discussion I saw that deleting this files may help:
Scanner.cpp
Parser.cpp
Parser.hpp
Parser.h
I try this and on "make ecc" got this:
[ 0%] Generating ../Ecc/Scanner.cpp
[ 0%] Generating ../Ecc/Parser.cpp, ../Ecc/Parser.hpp
Ecc/Parser.y: предупреждение: 86 конфликтов сдвига/вывода [-Wconflicts-sr]
Ecc/Parser.y: предупреждение: 1 reduce/reduce conflict [-Wconflicts-rr]
Ecc/Parser.y:385.18: предупреждение: правило не применимо в парсере из-за конфликтов [-Wother]
class_declaration
^
[ 0%] Generating ../Ecc/Parser.h
Scanning dependencies of target ecc
[ 0%] Building CXX object CMakeFiles/ecc.dir/Ecc/Main.cpp.o
/home/psycho/games/Serious-Engine/Sources/Ecc/Main.cpp: In function ‘void ReplaceIfChanged(const char*, const char*)’:
/home/psycho/games/Serious-Engine/Sources/Ecc/Main.cpp:247:14: warning: ignoring return value of ‘char* fgets(char*, int, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
fgets(strNewLine, sizeof(strNewLine)-1, fNew);
~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/psycho/games/Serious-Engine/Sources/Ecc/Main.cpp:250:14: warning: ignoring return value of ‘char* fgets(char*, int, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
fgets(strOldLine, sizeof(strOldLine)-1, fOld);
~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/psycho/games/Serious-Engine/Sources/Ecc/Main.cpp:16:0:
/home/psycho/games/Serious-Engine/Sources/Ecc/Main.cpp: In function ‘int main(int, char**)’:
/home/psycho/games/Serious-Engine/Sources/Ecc/StdH.h:32:36: warning: ignoring return value of ‘char* realpath(const char*, char*)’, declared with attribute warn_unused_result [-Wunused-result]
#define _fullpath(x, y, z) realpath(y, x)
~~~~~~~~^~~~~~
/home/psycho/games/Serious-Engine/Sources/Ecc/Main.cpp:318:3: note: in expansion of macro ‘_fullpath’
_fullpath(strFullInputName, argv[1], MAXPATHLEN);
^~~~~~~~~
[ 0%] Building CXX object CMakeFiles/ecc.dir/Ecc/Parser.cpp.o
[100%] Building CXX object CMakeFiles/ecc.dir/Ecc/Scanner.cpp.o
Ecc/Scanner.cpp:1813:17: warning: ‘void yyunput(int, char*)’ defined but not used [-Wunused-function]
[100%] Linking CXX executable ecc
[100%] Built target ecc

Looks like it is fine. I try to run "make -j2".

yes, ecc is built, rest should build too now.

Well, let's hope.

If i understand right to create binaries for The first encounter, i must use this command with this difference: "cmake -DTFE=TRUE -DCMAKE_BUILD_TYPE=Release ..". Am I right?

I got this when execute make -j2:
[ 94%] Building CXX object CMakeFiles/ssam.dir/Engine/Sound/SoundObject.cpp.o
In file included from /home/psycho/games/Serious-Engine/Sources/External/libogg/include/ogg/ogg.h:25:0,
from /home/psycho/games/Serious-Engine/Sources/External/libvorbis/include/vorbis/codec.h:26,
from /home/psycho/games/Serious-Engine/Sources/External/libvorbis/include/vorbis/vorbisfile.h:27,
from /home/psycho/games/Serious-Engine/Sources/Engine/Sound/SoundDecoder.cpp:102:
/home/psycho/games/Serious-Engine/Sources/External/libogg/include/ogg/os_types.h:143:12: fatal error: ogg/config_types.h: Нет такого файла или каталога
include ogg/config_types.h
^~~~~~~~~~~~~~~~~~~~
compilation terminated.
CMakeFiles/ssam.dir/build.make:3507: recipe for target 'CMakeFiles/ssam.dir/Engine/Sound/SoundDecoder.cpp.o' failed
make[2]: *** [CMakeFiles/ssam.dir/Engine/Sound/SoundDecoder.cpp.o] Error 1
make[2]: *** Ожидание завершения заданий…
CMakeFiles/Makefile2:69: recipe for target 'CMakeFiles/ssam.dir/all' failed
make[1]: *** [CMakeFiles/ssam.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

Yes, you are right for the 1st encounter.

For the ogg/config_types error, you need more libs:
sudo apt install libogg-dev should help.
or maybe sudo apt install libvorbis-dev

Now all works fine. You are great man - thanks for the help!

One last question: this manual will work even if you back to the version of repository that was before i create this issue?

Remove the clone (to be sure to start from a clean state).
Clone the repo with

git clone https://github.com/ptitSeb/Serious-Engine
cd Serious-Engine
cd Sources

then, will build in a separate folder:

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..

Then start with ecc

make ecc

And then everything

make -j2

Yes, because I only tried to fix the build shell script. Building manually was working.