Closed petabyt closed 4 years ago
I believe this has to do with the compiler being a relatively old version (older than GCC 9.1). Maybe try to add stdc++fs
to the linker flags on CMake, like this:
target_link_libraries(OSPGL fmt liblua-static assimp BulletSoftBody BulletDynamics BulletCollision LinearMath ${CMAKE_DL_LIBS} stdc++fs)
(CMakeLists.txt)
You may have to do that too on the ospm
target.
This should get it to compile with older versions of gcc, if it works I will add it to the CMake file as I believe it doesn't really hurt newer compilers: https://en.cppreference.com/w/cpp/filesystem (Bottom of the page)
Yep, that seems to fix it up. I'm now getting this, I guess because of a dependency problem.
[INF] Starting OSP with settings = "settings.toml" and resource path = "./res/"
[renderer]
type = "windowed"
scale = 0.75000000000000000
width = 1366
height = 768
[INF] Package 'OSP Core 0.0.1' ('core' loaded as 'core')
[INF] Package 'Debug Solar System 0.0.1' ('debug_system' loaded as 'debug_system')
[WRN] Lacks dependency ''
[INF] Package 'Test Parts 0.0.1' ('test_parts' loaded as 'test_parts')
[INF] Package 'OSP Default Navball 0.0.1' ('default_navball' loaded as 'navball')
[FTL] Could not initialize glad
Raising exception
terminate called after throwing an instance of 'char const*'
Aborted
(By the way, the code for this project was written well, looks good.)
I pushed a new commit to investigate that GLAD issue, it probably has to do with the OpenGL context creation. I also added the filesystem link on non-windows platforms: https://github.com/TheOpenSpaceProgram/new-ospgl/commit/a0b7cf0d5af4ad2c663e33af2b3af1618ac61bb3
If you run it now it will report a proper error if the problem has to do with OpenGL
I should fix that dependency error, it's not actually any problem, it's just that the debug_system
defines one of its dependencies to be " "
, which of course is not a valid package!
What is said:
[ERR] Error initializing GLFW window: GLX: Failed to create context: GLXBadFBConfig
[FTL] Failed to initialize GLFW
I changed
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
to
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
And am now getting this:
[INF] Loading package navball
[ERR] Condition 'Invalid package (debug_system) given' failed
terminate called after throwing an instance of 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >'
Aborted
That must mean that the package debug_system
is not present while loading the save-game (Line 34 of VehicleInWorld.cpp
). Check that you have it (look into the res/
folder, or re-download it with ospm fetch
). Otherwise I have no idea why that's showing up, your previous log files show that the debug_system
package is present.
I tested the game with the same change as yours and everything works fine. The planet rendering may have texturing broken (only visible on water, terrain is not textured as of now) if your GPU doesn't support OpenGL 4. It would not be too hard to write a compatibility mode, the only OpenGL 4 feature that is used are vertex attribute bindings to speed up tile rendering a bit by sharing the UV buffer.
Looking in the res folder, I only see navball
and core
, and running ./ospm fetch
returns:
terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::substr: __pos (which is 18446744073709551615) > this->size() (which is 0)
Aborted
Also, my GPU should support OpenGL 4, but I uninstalled all Nvidia drivers (they make my system unstable and are hard to diagnose). I have a Windows 10 installation, but I don't want to install Visual Studio to build it.
Oh that error shows up because of running ./ospm fetch
without an argument. (It's still just a "place-holder" command, so no error handling), these are the commands:
./ospm fetch https://github.com/TheOpenSpaceProgram/new-ospgl/releases/download/ospm-test/debug_system.zip
./ospm fetch https://github.com/TheOpenSpaceProgram/new-ospgl/releases/download/ospm-test/test_parts.zip
Don't worry much about OpenGL 4 as it will probably work fine. Maybe planet rendering doesn't work but it's easy to add some kind of compatibility mode for older graphics cards (and for Macs, I believe they only suport OpenGL 3.3), it's just moving a few vertex buffers around.
If you want to build it on windows on a more "lightweight" tool-set I recommend KDevelop, although you need to install MSVC (just the compiler, the whole Visual Studio download is not needed), you can use MinGW but I have not tested that. I recommend building it on Linux, as the Windows build is a bit more tricky and less "automatic" most of the time.
Yeah, thanks. It is working fine now. It is showing me a very cool rocket building interface.
If you want you can check the flight scene by changing line 42 in src/VehicleInWorld.cpp
from:
osp.game_state.load_scene(new EditorScene());
to
osp.game_state.load_scene(new FlightScene());
But it may be broken due to the OpenGL version. I will close the issue now but will create a new one to work on OpenGL 3 compatibility.
I can't get past this issue on Debian 10 x64 MATE:
Fetch.cpp:(.text+0x1313): undefined reference to
std::filesystem::remove_all(std::filesystem::__cxx11::path const&)'` Here is the full error:Also, I pulled like
git clone --recurse-submodules https://github.com/TheOpenSpaceProgram/new-ospgl
, and followed the exact instructions in the readme.