Azure-Kinect-Sensor-SDK icon indicating copy to clipboard operation
Azure-Kinect-Sensor-SDK copied to clipboard

/usr/bin/ld: cannot find -lk4a::k4a

Open liaoyinyu opened this issue 7 years ago • 6 comments

Describe the bug

I have installed k4atools k4a1.1 and k4a1.1-dev in my ubuntu os. when i cmake my the example project ,eg fastpointcloud , mkdir build cmake .. make

Then it showed the error /usr/bin/ld: cannot find -lk4a::k4a collect2: error: ld returned 1 exit status CMakeFiles/fastpointcloud.dir/build.make:94: recipe for target 'fastpointcloud' failed make[2]: *** [fastpointcloud] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/fastpointcloud.dir/all' failed make[1]: *** [CMakeFiles/fastpointcloud.dir/all] Error 2 Makefile:83: recipe for target 'all' failed

Expected behavior

Logs

Screenshots

Desktop (please complete the following information):

  • OS with Version: ubuntu 18.04
  • SDK Version: sdk Version 1.1.0

Additional context

liaoyinyu avatar Aug 15 '19 03:08 liaoyinyu

Hi liaoinyu, thanks for the bug report. Are you getting this error when you try to build this repository or your own repository?

If its your own repository, can you share your code with us? At least the CMakeLists.txt file?

schultetwin1 avatar Aug 15 '19 22:08 schultetwin1

Hi, schultetwin1, I try to build my own repository when getting this error. My code was modified from the example of fastpointcloud. And the CMakeList.txt file is almost unchanged. cmake command is correctly work. But when I run make command, the error occured /usr/bin/ld: cannot find -lk4a::k4a

liaoyinyu avatar Aug 16 '19 02:08 liaoyinyu

Gotcha, so you’re in your own repository it have copy and pasted the fastcloudpoint example.

Does your CMakeLists.txt file have a call to find_package(k4a)?

Otherwise k4a::k4a will not be defined.

schultetwin1 avatar Aug 16 '19 02:08 schultetwin1

ok, it works , thanks very much

liaoyinyu avatar Aug 16 '19 02:08 liaoyinyu

Sweet! Not a problem, we are working on getting example CMake projects up.

schultetwin1 avatar Aug 16 '19 03:08 schultetwin1

ok, it works , thanks very much

can you show your cmakelists ?

ZYJxxx avatar Sep 24 '19 06:09 ZYJxxx