📅 2011-May-20 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ cgal, errors, gmp, mpfr, visual cpp ⬩ 📚 Archive
Compiling any Visual C++ solution that uses CGAL produces either or both of these errors:
1>LINK : fatal error LNK1104: cannot open file 'gmp-vc90-mt.lib' 1>LINK : fatal error LNK1104: cannot open file 'mpfr-vc90-mt.lib'
CGAL seems to look for GMP and MPFR libraries, whose names are suffixed with the Visual C++ version (
vc90) and the build type (
mt). However, CGAL stopped shipping pre-built GMP and MPFR libraries in such a format a while ago. Instead it ships a single library file for each. For example, in CGAL 3.8, these files are
With this knowledge, this error can be fixed and the solution can be compiled like this:
Ignore the library dependencies that are indicated by CGAL. This can be done by going to Properties → Linker → Input → Ignore Specific Library and adding
Link with the available libraries instead. This can be done by going to Properties → Linker → Input → Additional Dependencies and adding
The Visual C++ solution using CGAL should be able to build and execute without errors now.
Tried with: Visual C++ 2008 and CGAL 3.8