Insta360Develop / CameraSDK-Cpp

CameraSDK-Cpp is a C++ library to control Insta360 cameras.
https://www.insta360.com
115 stars 16 forks source link

Get started with linux #22

Open aframatilda opened 1 year ago

aframatilda commented 1 year ago

I dont understand how to run the main in linux terminal. I run the command: g++ main.cc -I ./include/camera but get the error: camera/camera.h: no such file or directory.

Does anybody know how to compile the project in Linux??

bouviervj commented 1 year ago

https://github.com/Insta360Develop/CameraSDK-Cpp/issues/19#issuecomment-1501837869

From the example folder: g++ -I ../include/ main.cc -L ../lib -lCameraSDK -ludev -o CameraSDKTest-compiled Should compile the app 'CameraSDKTest' from the SDK provided through their developer program. You have a pre-compiled version in that same folder also. To run the compiled or pre-compiled program do: sudo LD_LIBRARY_PATH=../lib/ ./CameraSDKTest The program needs to see the SDK pre-compiled shared library - i.e, the file - 'libCameraSDK.so'

aframatilda commented 1 year ago

Thank you! With the first command i get the error: /usr/bin/ld: cannot find -ludev: no such file or directory.

I have followed the steps that are presented in this documentation for Linux but still get this error. I also have pkg-config which I read could be a reason for the error.

Do you recognise this?

bouviervj commented 1 year ago

Hi, it should be most likely linked to lib udev - try to reinstall it - the doc states: sudo apt-get install libudev-dev But for the linker the lib should be seen from the system/user lib - usually it is added automatically by the install - you might have to reset your terminal - ultimate situation is to locate the path of library on the system and add it to the command line with -L option.

aframatilda commented 1 year ago

Thank you so much!

Tianweihaihaihai commented 1 year ago

Hi, it should be most likely linked to lib udev - try to reinstall it - the doc states: sudo apt-get install libudev-dev But for the linker the lib should be seen from the system/user lib - usually it is added automatically by the install - you might have to reset your terminal - ultimate situation is to locate the path of library on the system and add it to the command line with -L option.

yes this is correct method to solve, pls close if solved