why can't c++ Open3D Application “find resource directory”? #7000
-
This is a repost of a question I asked a few days ago on stackoverflow (see here and below). Any hints or suggestions would be greatly appreciated. My main question below is “What is the resource directory, what needs to be in it, and how do I set that up?” I came across Open3DViewer.cpp which calls
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
Looking closer, I notice that Open3DViewer.cpp calls So it looks like that cannot serve as a model for the work I am doing on macOS. I continue to seek information on running a program like |
Beta Was this translation helpful? Give feedback.
-
The "resources not found" error is since we use some heuristics to locate the resource directory. See the function Ideally this would be relative to the executable location. [Looking for cross-platform PRs here :-) ] |
Beta Was this translation helpful? Give feedback.
-
We do distribute resources, along with the Open3D binaries (see the release page on Github). I think the right way to do this is always have the resources directory in a few fixed locations wrt to the executable or Open3D DLL. Here's a SO question showing that this can be somewhat complex. BUt I think one of the solutions from there should work for us (C++17, no dependence on Boost, Qt, etc.). https://stackoverflow.com/questions/1528298/get-path-of-executable Also, we have to account for cases of system install, where executables (/usr/local/bin), DSOs (/usr/local/lib) and resources (/usr/local/share) are in different system folders. |
Beta Was this translation helpful? Give feedback.
examples/cpp/Draw.cpp
uses a simplified interface over O3DVIsualizer and may be sufficient for your purpose.Open3DViewer_mac.mm is the right example for Apple. Thanks for catching that its commented out in the C++ code. The build system directly builds that now, instead of going through Open3DVIewer.cpp for macOS. (
cpp/apps/CMakeLists.txt
)The "resources not found" error is since we use some heuristics to locate the resource directory. See the function
FindResourcePath()
incpp/open3d/visualization/gui/Application.cpp
.Ideally this would be relative to the executable location. [Looking for cross-platform PRs here :-) ]