Skip to content

File access errors when OSP-Magnum not started from the build directory. #272

@IronPepper3964

Description

@IronPepper3964

osp-magnum can only be started from the local build folder. If it is started from any other directory, multiple errors occur due to relative file locations changing.

Example:

When running ./osp-magnum from the Release folder created during the build, the program runs as expected - no errors

~/build-osp-magnum/Release$ ./osp-magnum

However, when running ./build-osp-magnum/Release/osp-magnum from the root folder where both the osp-magnum and build-osp-magnum folders are stored, multiple files cannot be found

~/$ ./build-osp-magnum/Release/osp-magnum

Errors:

Trade::AbstractImporter::openFile(): cannot open file OSPData/adera/spamcan.sturdy.gltf
[15:12:11.529] [testapp] [error] [load_tinygltf.cpp:342] Could not open file OSPData/adera/spamcan.sturdy.gltf
Utility::Path::read(): can't open OSPData/adera/stomper.sturdy.gltf: error 2 (No such file or directory)
Trade::AbstractImporter::openFile(): cannot open file OSPData/adera/stomper.sturdy.gltf
[15:12:11.529] [testapp] [error] [load_tinygltf.cpp:342] Could not open file OSPData/adera/stomper.sturdy.gltf
Utility::Path::read(): can't open OSPData/adera/ph_capsule.sturdy.gltf: error 2 (No such file or directory)
Trade::AbstractImporter::openFile(): cannot open file OSPData/adera/ph_capsule.sturdy.gltf
[15:12:11.529] [testapp] [error] [load_tinygltf.cpp:342] Could not open file OSPData/adera/ph_capsule.sturdy.gltf
Utility::Path::read(): can't open OSPData/adera/ph_fuselage.sturdy.gltf: error 2 (No such file or directory)
Trade::AbstractImporter::openFile(): cannot open file OSPData/adera/ph_fuselage.sturdy.gltf
[15:12:11.529] [testapp] [error] [load_tinygltf.cpp:342] Could not open file OSPData/adera/ph_fuselage.sturdy.gltf
Utility::Path::read(): can't open OSPData/adera/ph_engine.sturdy.gltf: error 2 (No such file or directory)
Trade::AbstractImporter::openFile(): cannot open file OSPData/adera/ph_engine.sturdy.gltf
[15:12:11.529] [testapp] [error] [load_tinygltf.cpp:342] Could not open file OSPData/adera/ph_engine.sturdy.gltf
Utility::Path::read(): can't open OSPData/adera/ph_rcs.sturdy.gltf: error 2 (No such file or directory)
Trade::AbstractImporter::openFile(): cannot open file OSPData/adera/ph_rcs.sturdy.gltf
[15:12:11.529] [testapp] [error] [load_tinygltf.cpp:342] Could not open file OSPData/adera/ph_rcs.sturdy.gltf
[15:12:11.529] [testapp] [info] [main.cpp:409] Resource loading complete

The OSP-Magnum Temporary Debug CLI loads, but selecting any scenario causes an error and the program closes

terminate called after throwing an instance of 'std::ios_base::failure[abi:cxx11]'
  what():  toml::parse: Error opening file "settings.toml": iostream error
Aborted (core dumped)```

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions