Settin up Libigl for VS

Download and Extract

  1. Go to libigl main page and get the source code. I preferred to download.
  2. Extract the file (Preferably into “Dependencies” folder of the project.

Setting up Dependencies

libigl depends on Matlab, Eigen Library, GLEW and GLFW to work. Also for user interface, it uses AntTweakBar or Nanogui. So far, I have not used the interfaces, so I will only talk about setting up Matlab, Eigen library, GLEW and GLFW.

The most important point in here, you should use either all 64-bit libraries or 32-bit libraries. Here, I am using x64 libraries.

Adding libigl

  1. Open Configuration Properties of your Visual Studio project.
  2. Go to C/C++ -> General -> Additional Include Directoires
  3. Add path of libigl. Mine looks like “SomeOtherStuff\dependencies\libigl-master\include”

Setting up Matlab

  1. Open Configuration Properties of your Visual Studio project.
  2. Go to VC++ Directories
  3. Executable Directories: “C:\Program Files\MATLAB\R2014a\bin\win64”
  4. Include Directories: “C:\Program Files\MATLAB\R2014a\extern\include”
  5. Library Directories: “C:\Program Files\MATLAB\R2014a\extern\lib\win64\microsoft”
  6. Setting Up .lib Files:
    1. Go to Linker -> Input -> Additional Dependencies
    2. Add libmx.lib, libeng.lib, libmex.lib and libmat.lib

Setting up Eigen Library

  1. Get Eigen library source code.
  2. Go to C/C++ -> General -> Additional Include Directoires
  3. Add path of Eigen. Mine looks like “SomeOtherStuff\dependencies\eigen-eigen-07105f7124f9”

Setting up GLEW and GLFW

Please check Setting Up GLEW for Visual Studio and Setting Up GLFW for Visual Studio pages.

Troubleshooting

Compile Time:

  • char* to LPCWSTR:
    1. Go to Configuration Properties -> General -> Character Set
    2. Set the value to Not Set
  • LNK1123 coff file invalid or corrupt:
    1. Go to Configuration Properties -> Linker -> General -> Enable Incremental Linking
    2. Set it No (/INCREMENTAL:NO)
    3. If this does not work also go to Configuration Properties -> Manifet Tool -> Input and Output -> Embed Manifest and set it No

Run Time:

If you did the things above right, you may get some additional “.dll missing” errors. Just copy and paste related .dlls into your .exe‘s directory.