Compile on OpenBSD 7.3
lea2501 opened this issue · 1 comments
lea2501 commented
Hi! i wanted to compile in OpenBSD 7.3 (latest stable) and i get the following error:
lea@latitude5480 umoria $ cd build/
lea@latitude5480 build $ cmake ..
-- Build type set to 'Release'
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:27 (project):
The CMAKE_CXX_COMPILER:
g++
is not a full path and was not found in the PATH.
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 "/home/lea/src/umoria/build/CMakeFiles/CMakeOutput.log".
See also "/home/lea/src/umoria/build/CMakeFiles/CMakeError.log".
i added this packages already:
doas pkg_add autoconf-2.71 gcc-11.2.0p6 gmake
i also tried with this commands with same error:
cmake .. -DCMAKE_MAKE_PROGRAM=gmake -DCMAKE_CXX_COMPILER=/usr/local/bin/eg++
Thanks for mantaining this amazing game!
lea2501 commented
I compiled it successfully with this changes
First i modified 'CMakeLists.txt' with this:
-set(CMAKE_CXX_COMPILER g++)
+set(CMAKE_CXX_COMPILER eg++)
And also file 'src/headers.h'
-#elif __APPLE__ || __linux__ || __NetBSD__ || __MORPHOS__
+#elif __APPLE__ || __linux__ || __NetBSD__ || __MORPHOS__ || __OpenBSD__
Then, it compiles fine:
...
[ 94%] Building CXX object CMakeFiles/umoria.dir/src/ui_inventory.cpp.o
[ 96%] Building CXX object CMakeFiles/umoria.dir/src/ui_io.cpp.o
[ 98%] Building CXX object CMakeFiles/umoria.dir/src/wizard.cpp.o
[100%] Linking CXX executable umoria/umoria
helpers.cpp(CMakeFiles/umoria.dir/src/helpers.cpp.o:(insertNumberIntoString(char*, char const*, int, bool))): warning: strcpy() is almost always misused, please use strlcpy()
helpers.cpp(CMakeFiles/umoria.dir/src/helpers.cpp.o:(insertNumberIntoString(char*, char const*, int, bool))): warning: sprintf() is often misused, please use snprintf()
helpers.cpp(CMakeFiles/umoria.dir/src/helpers.cpp.o:(insertStringIntoString(char*, char const*, char const*))): warning: strcat() is almost always misused, please use strlcat()
helpers.cpp(CMakeFiles/umoria.dir/src/helpers.cpp.o:(insertStringIntoString(char*, char const*, char const*))): warning: stpcpy() is dangerous; do not use it
And managed to start the game and play. Thank you!