2

I am trying to install rs_bad2image(a convert tool from bag file to images). Here is the link about this tool: https://github.com/UnaNancyOwen/rs_bag2image/blob/master/README.md

However, after the configuration and generating done successfully, I faced this error about not able to find the library -lstdc++fs. Here is the error code:

binfeng@Bins-iMac build % cmake ..
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/binfeng/Desktop/summer_project/rs_bag2image/rs_bag2image/build
binfeng@Bins-iMac build % cmake --build . --config Release
[ 33%] Linking CXX executable rs_bag2image
ld: library not found for -lstdc++fs
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [rs_bag2image] Error 1
make[1]: *** [CMakeFiles/rs_bag2image.dir/all] Error 2
make: *** [all] Error 2

If you have any idea or suggestions, please let me know. Thank in advance for any help here!

Feng Bin
  • 21
  • 3
  • The filesystem part of the STL is a separate library that may or may not need to be explicitly linked in depending on your compiler and version. – Taekahn Jun 23 '20 at 19:12
  • Hi Taekahn, thank you for the help! I am new to c language and mac os system. Do you mind explain a little more? Do you mean that I need to install the separate library? I tried to use homebrew to install 'lstdc++fs' and did some research about this particular library, but i cannot find anything helpful. – Feng Bin Jun 23 '20 at 20:07
  • Its a little hard to get more specific without pulling down the source and trying to build it myself. Since i see you're using clang, this link might be helpful. https://libcxx.llvm.org/docs/UsingLibcxx.html It says that 9+ you don't need to have that linker option. The link command being used _might_ be gcc specific which could cause clang to reject it. You could also be using too _old_ of a version of clang to use filesystem at all. – Taekahn Jun 23 '20 at 20:22
  • `Do you mean that I need to install the separate library? ` No. Its a little confusing, but filesystem is part of the standard library, but its also a separate library that you have to provide a special linker option to include on some versions of compilers. – Taekahn Jun 23 '20 at 20:26
  • 1
    Hi Taekahn, thank you for the explanation! I fixed the error by change the linked library from lstdcfs to filesystem. After that fix, the rs_bag2image was able to install sucessfully! – Feng Bin Jun 24 '20 at 02:09

0 Answers0