microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
23.41k stars 6.47k forks source link

Error in linkage after installation of pangolin using vcpkg. #10374

Closed PranavDhulipala closed 4 years ago

PranavDhulipala commented 4 years ago

I am trying to compile orbslam2 (https://github.com/raulmur/ORB_SLAM2) on windows which has a dependency on pangolin which i installed using vcpkg install pangolin:x64-windows and for some reason i get the following errors.

error.txt

any help with the same is appreciated. Edit: i think for some reason pangolin is being compiled in debug build rather than a release build. ( i might be wrong though)

linquize commented 4 years ago

What cmake version did you use? It seems you were not using the cmake downloaded by vcpkg.

PranavDhulipala commented 4 years ago

@linquize i have two installations of cmake at C:\opt\python27amd64\Scripts\cmake.exe which uses cmake version 3.16.3 and C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe which uses cmake version 3.15.19101501-MSVC_2

NancyLi1013 commented 4 years ago

Hi @PranavDhulipala Thanks for posting this issue. Could you please help confim if you used pangolinin this way?

    find_package(Pangolin CONFIG REQUIRED)
    target_link_libraries(main PRIVATE pangolin)
    target_include_directories(main PRIVATE ${Pangolin_INCLUDE_DIRS})
PranavDhulipala commented 4 years ago

@NancyLi1013 yup i did everything you mentioned. I figured out the reason for my problem it has something to do with this https://github.com/microsoft/vcpkg/pull/6393 . So i did a catkin_make -DCMAKE_BUILD_TYPE=Release which fixed my problem. Thanks for your help. :)