Error in Acquistion.cpp
AnsweredHello, I'm trying to run the example files obtained with the installation of Spinnaker sdk for ubuntu 20.04. I would like to run Acquisition.cpp, but when I try to compile it this is the error:
ubuntu@ubuntu:/opt/spinnaker/src/Acquisition$ g++ Acquisition.cpp -o Acquisition
Acquisition.cpp:42:10: fatal error: Spinnaker.h: No such file or directory
42 | #include "Spinnaker.h"
| ^~~~~~~~~~~~~
---
I see the file Spinnaker.h has another directory (/opt/spinnaker/include). How can i fix this problem?
thank you
-
Official comment
Hello Silvia,
With "sudo make", executable is moved to /opt/spinnaker/bin after compilation. Have you tried running the application from this bin folder? Besides, running similar command as you pointed out should generate executable in the same .Acquisition.cpp directory. i.e:
g++ -std=c++11 -o Acquisition .obj/build/Acquisition.o -Wl,-Bdynamic -L../../lib -lSpinnaker -Wl,-rpath-link=../../lib
Please let me know if you find any of the above options helpful.
Thanks,
Ifeanyi
-
Hello Silvia,
Does it work using make file path of example directory to compile the project? i.e:
$ sudo make
Thanks,
Ifeanyi
0 -
Sorry, I didn't get how to use $ sudo make.
I try to execute $ sudo make Acquisition and this is the output:
ubuntu@ubuntu:/opt/spinnaker/src/Acquisition$ sudo make Acquisition
g++ -std=c++11 -o Acquisition .obj/build/Acquisition.o -Wl,-Bdynamic -L../../lib -lSpinnaker -Wl,-rpath-ink=../../lib
mv Acquisition ../../binbut then when I try to compile I get the same error:
ubuntu@ubuntu:/opt/spinnaker/src/Acquisition$ g++ Acquisition.cpp -o Acquisition
Acquisition.cpp:42:10: fatal error: Spinnaker.h: No such file or directory
42 | #include "Spinnaker.h"
| ^~~~~~~~~~~~~can you explain better how can I do? sorry but I'm a beginner with c++. thank you
0 -
Hello Silvia,
I mean to only enter "sudo make" from Acquisition directory:
"ubuntu@ubuntu:/opt/spinnaker/src/Acquisition$ sudo make "
I hope this helps to resolve the issue.
Thanks,
Ifeanyi
0 -
So this is the same I've done before since the output is :
ubuntu@ubuntu:/opt/spinnaker/src/Acquisition$ sudo make
g++ -std=c++11 -o Acquisition .obj/build/Acquisition.o -Wl,-Bdynamic -L../../lib -lSpinnaker -Wl,-rpath-link=../../lib
mv Acquisition ../../binBut compiling Acquisition.cpp, it still give me the same error of before.
I also try to move Spinnaker.h in the directory /opt/spinnaker/src/Acquisition/ but permission denied.
other ideas? thank you very much
0 -
Hello,
thank you very much now I got it!
but now I'm trying again to run Acquisition in the bin folder but this error occurs:
ubuntu@rpi-lumio:/opt/spinnaker/bin$ ./Acquisition
./Acquisition: error while loading shared libraries: libSpinnaker.so.3: cannot open shared object file: No such file or directoryI see the library is in this directory opt/spinnaker/lib , so why this error?
thank you
0 -
Hi Silvia,
This may be related to access permission. Does it work with below command line?
"$ sudo -E ./Acquisition"
Thanks,
Ifeanyi
0 -
No, it doesn't work. same error:
ubuntu@ubuntu:/opt/spinnaker/bin$ sudo -E ./Acquisition
./Acquisition: error while loading shared libraries: libSpinnaker.so.3: cannot open shared object file: No such file or directoryis there another solution?
thank you
0 -
Hello,
I solved the problem finally!
thank you very much for your support and your timely responses.
Silvia
0
Please sign in to leave a comment.
Comments
9 comments