Sysprogs forums › Forums › VisualGDB › Error while loading shared libraries: libraspicam.so.0.1
- This topic has 1 reply, 2 voices, and was last updated 7 years, 7 months ago by support.
-
AuthorPosts
-
March 31, 2017 at 01:01 #10841kennethoneParticipant
Hello, I am trying to build the using Raspberry Pi Camera example https://visualgdb.com/tutorials/raspberry/camera/
I get to Step #26 where I select Debug Specified program instead of the default target.
Then, when I select the library for Debugged Program (Under the RaspiCam library project properties, not my application’s), and run it,
I still get this error:
<h5>error while loading shared libraries:</h5>
<h5>libraspicam.so.0.1:</h5>
<h5>cannot open shared object file: No such file or directory</h5>
<h5></h5>
<h5>Child exited with status 127</h5>
<h5>GDBserver exiting</h5>
What am I missing? The debugged program field is set to:D:\myproject\raspicam-0.1.6\Debug\src\libraspicam.so.0.1
The path is correct, but in the example, it automatically switched to
$(SourceDir)/Debug/src/libraspicam.so.0.1 and on my system it didn’t,
when I tried to manually enter the above, or
${PROJECT_SOURCE_DIR}/Debug/src/libraspicam.so.0.1
It just says: Deployment Failed: Invalid Deployed Binary Path ${PROJECT_SOURCE_DIR}/Debug/src/libraspicam.so.0.1
I don’t get that with the full path, it gives me a warning that debugger ran without breakpoints and the missing libraspicam.so.0.1
Also what’s the difference between ${PROJECT_SOURCE_DIR} and $(SourceDir) ? It seems the tutorial used parentheses and elsewhere in my project settings it uses curly brackets
Thanks,
D
EDIT:
I checked the folder where the executable was deployed, and the library file was right there next to it. When I moved it to usr/lib it worked and I was able to debug
How can I make it automatically deploy to usr/lib (may want to add this to the tutorial) and how can I change the paths to relative?
- This topic was modified 7 years, 7 months ago by kennethone.
March 31, 2017 at 03:53 #10843supportKeymasterHi,
Sorry for the confusion here. The variables like ${PROJECT_SOURCE_DIR} are expanded by CMake, but only during build. To optimize debugging performance, VisualGDB only expands VisualGDB-controlled variables (like $(SourceDir)) in various VisualGDB-related settings. The “$(SourceDir)/Debug/src/libraspicam.so.0.1” path actually needs to be specified manually (please see the step 26 in the tutorial).
You can deploy the library to /usr/lib by changing the “deployment path” setting on the Debug Settings page of the library project. Please note that this won’t work unless you explicitly grant write permissions to /usr/lib to the current Linux user.
A simpler alternative could be to add the deployment folder to the LD_LIBRARY_PATH variable (see the Debug Settings page of VisualGDB Project Properties of the debugged executable).
-
AuthorPosts
- You must be logged in to reply to this topic.