This has been a common problem on forums but solutions elude me. Windows 10 64 bit, CGAL 4.11, Cmake 3.9.2, Boost 1.65.1, Qt5 for MSVS 2017, libQGLViewer 2.7.0, Visual Studio 2017, CGAL built both as Debug and Release, myriad C++ include paths and Windows user path variables tried. Same thing that it can't open, not necessarily can't find, a main CGAL library file. The .lib file certainly exists. When I try to run a simple CGAL test program, I can't get past this error.
-
Potential answer here, that CGAL has been built with a wrong linker flag, but I don't see in CMake after Configure any line specifying /MTd whereas I see plenty for /MD and /MDd, so this is not really the problem. http://stackoverflow.com/a/28044353/4806365 – NikNYC Sep 26 '17 at 06:50
-
Adding /VERBOSE to the project's Linker properties additional entries gives no additional info, it's just lists all the includes up to the error. – NikNYC Sep 26 '17 at 07:01
-
If instead of just add the library location to C++ headers in right-click Properties, I add it to Linker additional library directories, it compiles (Debug mode) and an ouput window appears finally, but then won't run since it says "CGAL-vc140-mt-dg-4.11.dll is missing" which does exist actually and my C++ header entries do point to its directory. I got lots of other PDB file errors before this final error, but they are gone after I turn on Tools>Options>Debugging>Symbols>Microsoft Symbol Servers. – NikNYC Sep 26 '17 at 07:14
-
Indeed, the non-graphic geometry test programs for CGAL are working fine, from here, now that I have added the .dll to my program directory: http://doc.cgal.org/latest/Manual/tutorial_hello_world.html. I can also use CMake and then compile and run the installed CGAL examples, if I copy the .dll into the root directory I build it into, so CGAL itself is not broken. – NikNYC Sep 26 '17 at 07:58
-
Have a look [here](https://www.cgal.org/download/windows.html) to see if you missed any step. In particular the setting of environment variables. – sloriot Sep 26 '17 at 11:26
-
Section 14 of this CGAL page suggests all these settings I'm trying to manually figure out are meant to be handled by a shell script included with CGAL, though Windows 10 doesn't seem to let me execute text files from the command prompt. You copy the script into a directory along with your .cpp program file then "run it" and then run CMake and only then open it in Visual to compile it. Windows 10 has an optional Bash shell, I note, or do I just rename the script with .cmd? http://doc.cgal.org/latest/Manual/installation.html#title38 – NikNYC Sep 26 '17 at 12:33
1 Answers
Indeed, I had to activate Windows 10 built-in Bash shell, in two easy-to-Google steps, then simply copy cgal_create_CMakeLists from the CGAL scripts directory to my Visual Studio project directory and get into Windows disks through the Bash "mnt" directory. When I just typed "cgal_create_CMakeLists" it spit out info on how to install the script via a command and then, after much churning, when I just typed "cgal_create_CMakeLists" it added a CMakeLists file and I merely had to point CMake-gui to the unfound Boost_DIR install directory to let Configure not list red errors. Then Visual Studio could open the .sln file that was created by CMake-gui, and it compiled. Right click assigning my program listing in the Solution Explorer pane to Set as StartUp Project let me hit the green debugger arrow and after a blank console window disappeared, CGAL wrote a nice ASCII tetrahedral out.Mesh file. Initially, the example file I used was copied from the CGEN reference site and pasted into a fresh Visual Studio Windows Console project, of a spherical boundary tetrahedral mesh:
http://cgal-discuss.949826.n4.nabble.com/CGAL-demos-on-Windows-won-t-configure-td4656618.html
I'm not sure what software will now visualize the simply formatted .Mesh file, since MeshLab won't.
Three Demo packages are said to create their own graphics if you have QT5 and libQGLViewer: Polygon, Polyhedron and AABB_tree. I can at least have some chance in building them with Visual Studio, now that CMake is partnered with CGEN's little shell script Windows 10 is happy to run.
CGAL is vastly complicated to use at all until you read the fine print about it being fundamentally reliant on a CMake preparation script for compiling even the simplest of examples.

- 81
- 5
-
In hindsight, I don't think Qt5 and libQGLViewer were worth the hassle, since they are only graphic window output accessories for a handful of demos. There's plenty of standalone viewing software out there. The vast majority of demos, and all examples, don't even use them. Qt5 in particular caused hours of headache in building CGAL since CMake had to have Qt5_DIR manually set to the obscure deep directory C:\Qt\5.9.1\msvc2017_64\lib\cmake\Qt5 to stop QMake from clearing out Qt5_DIR again when you tried Configure again. It also required a Qt5 menu addon to be installed into Visual Studio 2017. – NikNYC Sep 26 '17 at 21:28
-
CGAL tetrahedral meshes are in obscure MEDIT viewer format (http://ljll.math.upmc.fr/frey/software.html). That page had a binary and also has the needed DLL file separately. You command line open your file from its console then there's a right-click menu for interactive clipping. Result: http://imgur.com/gallery/THvGy – NikNYC Sep 26 '17 at 22:32