Vcpkg: How to fix libCGAL-vc140-mt-4.14-l-900.lib Link error ( VCPKG CGAL update 4.14 )

Created on 9 Apr 2019  路  5Comments  路  Source: microsoft/vcpkg

I'm getting the error message "Linker Tools Error LNK1104" can't find libCGAL-vc140-mt-4.14-I-900.lib"

I'm using VCPKG with Visual Studio and linker flag /MD or /MDd. The same setup worked with CGAL 4.13. The error came after the update to 4.14 with VCPKG.

Even a small new CGAL program will not be translated. I tried debug/release mode with x64.

more-information

Most helpful comment

Vcpkg will install CGAL as "header only".

I found that I have to add the CGAL_HEADER_ONLY preprocessor definition in Visual Studio: "Properties - C/C++ - Preprocessor", then it should be built correctly.

All 5 comments

Question one:
Do you use CMake or the Visual Studio integration?

Question two:
Which triplet are you using? x64-windows? Is cgal:x64-windows installed (and not maybe the x86-windows triplet)?

cgal_vcpkg
I use the Visual Studio integration.

I installed cgal:x64-windows 4.14-1 and cgal:x86-windows 4.14-1 and boost:x64 /booxt:x86
The error message is: cannot open source file "CGAL/compiler_config.h" config.h

Do I have to do anything after the installation (vcpkg install cgal:x64-windows)?

Vcpkg will install CGAL as "header only".

I found that I have to add the CGAL_HEADER_ONLY preprocessor definition in Visual Studio: "Properties - C/C++ - Preprocessor", then it should be built correctly.

Hi @JoelMontana, thanks for posting this issue.

Here is vcpkg integrate function usage:

  1. If you use it in a solution project, you need to use command vcpkg integrate project, and then restart Visual Studio.
  2. If you use it in a cmake project, you need to use command vcpkg integrate install, and then set CMAKE_TOOLCHAIN_FILE=vcpkg_pathvcpkgscriptsbuildsystemsvcpkg.cmake by CMake command.
  3. Due to vcpkg install cgal as header-only library, we need to define macro CGAL_HEADER_ONLY to use it. You can add CGAL_HEADER_ONLY to Preprocessor Definitions or define this macro before include cgal headers.

Thanks for posting this issue. Please open a new issue if this is still a problem for you.

Was this page helpful?
0 / 5 - 0 ratings