I am currently trying to install CGAL on Windows 10.
I have a problem when I try to open the file.exe of the example convex-hull2 generated using CMAKE-GUI and Visual C++ 2010 express: boot_system-vc100-mt-gd-1_59.dll is missing.
Here I specify all my installation steps followed from cgal.org/download/windows.html and http://acg.cs.tau.ac.il/cgal-at-tau/installing-cgal-and-related-programs-on-windows (because in a first try with only the documentation of cgal.org there were errors relative to the installation of Boost in Cmake-gui, errors solved with this method), it is quite long but I want to be exhaustive. Furthermore, some of the output of visual studio are in french but I put the traduction of the word in bracket.
I use Visual Studio 2010 (32-bits) and Visual C++ 2010 express.
Installation of Boost:
Download: boost_1_59_0-msvc-10.0-32.exe
Execution of file.exe as an administrator; install in folder C:\dev\boost_1_59_0
Installation ran well.
Here I added a step found on http://acg.cs.tau.ac.il/cgal-at-tau/installing-cgal-and-related-programs-on-windows since the CMAKE-GUI had Boost-related errors during the creation of the solution for CGAL.
I ran cd c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin then vcvars32.bat in the CMD to set the compiler to Visual studio 2010.
I ran: pushd C:\ Then: cd C:\dev\boost_1_59_0 to go to the boost directory.
Then I ran: .\bootstrap
Then I ran: .\b2 link=static,shared threading=single,multi variant=debug,release
No errors reported (time of about 2 hours):
“the Boost C++ libraries were successfully built!
The following directory should be added to complier include paths:
C:\dev\boost_1_59_0
The following directory should be added to linker library paths:
C:\dev\boost_1_59_0\stage\lib
”
I added :
BOOST_LIBRARYDIR=C:\dev\boost_1_59_0\lib32-msvc-10.0
BOOST_INCLUDEDIR=C:\dev\boost_1_59_0
C:\dev\boost_1_59_0 to the path
Installation of QT5
I downloaded qt-opensource-windows-x86-msvc2010-5.5.1.exe
I installed it in C:\Qt\Qt5.5.1
I added
I added QTDIR=C:\Qt\Gt5.5.1
C:\Qt\Qt5.5.1\5.5\msvc2010\bin to the path and I put it in the first place of the path as suggested in CGAL.org.
Installation of libQGLViewer:
I extracted the archive libQGLViewer-2.6.3 in C:\dev\libQGLViewer-2.6.3
I start the visual studio 2010 command prompt.
I put vcvars32.bat
I put pushd C:\dev\libQGLViewer-2.6.3\QGLViewer
I put qmake.exe and nmake.
No error message.
I added C:\dev\libQGLViewer-2.6.3\QGLViewer\release and C:\dev\libQGLViewer-2.6.3\QGLViewer\debug to my path.
I added QGLVIEWERROOT =C:\dev\libQGLViewer-2.6.3
Installation of CGAL:
I downloaded CGAL-4.7-Setup.exe from cgal.org.
I installed (as an administrator) it in 32-bits for all users and allowed it to install C:\dev\CGAL-4.7\auxilliary\gmp\lib to the path.
However, I had a pop-up that said that my path seems empty and I have do it manually.
So I added C:\dev\CGAL-4.7\auxiliary\gmp\lib to my path.
Then, I executed CMAKE-GUI as an administrator. I setted C:/dev/CGAL-4.7 for the location of source code; C:/dev/CGAL-4.7/build for the location of the build.
Then, I clicked on configure. CMAKE-GUI asked me if it has the permission to create the new folder build. I said yes. I specified the generator Visual studio 10 2010 and “use defaut native compilers”.
The CXX compiler identification is MSVC 16.0.40219.1
The C compiler identification is MSVC 16.0.40219.1
Check for working CXX compiler using: Visual Studio 10 2010
Check for working CXX compiler using: Visual Studio 10 2010 -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
Check for working C compiler using: Visual Studio 10 2010
Check for working C compiler using: Visual Studio 10 2010 -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
== Setting paths ==
Build CGAL from release in directory CGAL-4.7
Packagenames: CGAL-4.7
== Setting paths (DONE) ==
== Generate version files ==
CGAL_MAJOR_VERSION=4
CGAL_MINOR_VERSION=7
CGAL_BUGFIX_VERSION=0
CGAL_SONAME_VERSION=11
CGAL_SOVERSION =11.0.1
CGAL_REFERENCE_CACHE_DIR=
Building shared libraries
Targetting Visual Studio 10 2010
Target build enviroment supports auto-linking
Using VC10 compiler.
Generator uses intermediate configuration directory: $(Configuration)
USING CMake version: 3.3.2
System: Windows
== Generate version files (DONE) ==
== Set up flags ==
Build type: Release
USING CXXFLAGS = ' /DWIN32 /D_WINDOWS /W3 /GR /EHsc -D_CRT_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS /fp:strict /fp:except- /wd4503 /bigobj /MD /O2 /Ob2 /D NDEBUG'
USING LDFLAGS = ' /machine:X86 /INCREMENTAL:NO'
== Set up flags (DONE) ==
== Detect external libraries ==
External libraries supported: GMP;MPFR;ZLIB;OpenGL;LEDA;MPFI;RS;RS3;OpenNL;Eigen3;BLAS;LAPACK;QGLViewer;ESBTL;Coin3D;NTL;IPE
Preconfiguring library: GMP ...
Found GMP: C:/dev/CGAL-4.7/auxiliary/gmp/lib/libgmp-10.lib
GMP has been preconfigured:
UseGMP-file:
GMP include: C:/dev/CGAL-4.7/auxiliary/gmp/include
GMP libraries: C:/dev/CGAL-4.7/auxiliary/gmp/lib/libgmp-10.lib
GMP definitions:
USING GMP_VERSION = '5.0.1'
Preconfiguring library: MPFR ...
Found MPFR: C:/dev/CGAL-4.7/auxiliary/gmp/lib/libmpfr-4.lib
MPFR has been preconfigured:
UseMPFR-file:
MPFR include: C:/dev/CGAL-4.7/auxiliary/gmp/include
MPFR libraries: C:/dev/CGAL-4.7/auxiliary/gmp/lib/libmpfr-4.lib
MPFR definitions:
USING MPFR_VERSION = '3.0.0'
Boost version: 1.59.0
Found the following Boost libraries:
thread
system
Boost include: C:/dev/boost_1_59_0
Boost libraries: optimized;C:/dev/boost_1_59_0/lib32-msvc-10.0/boost_thread-vc100-mt-1_59.lib;debug;C:/dev/boost_1_59_0/lib32-msvc-10.0/boost_thread-vc100-mt-gd-1_59.lib;optimized;C:/dev/boost_1_59_0/lib32-msvc-10.0/boost_system-vc100-mt-1_59.lib;debug;C:/dev/boost_1_59_0/lib32-msvc-10.0/boost_system-vc100-mt-gd-1_59.lib
Boost definitions:
USING BOOST_VERSION = '1.59.0'
== Detect external libraries (DONE) ==
== Write compiler_config.h ==
Performing Test CGAL_CFG_BOOST_VARIANT_SWAP_BUG - Failed
Performing Test CGAL_CFG_DENORMALS_COMPILE_BUG - Success
Performing Test CGAL_CFG_FPU_ROUNDING_MODE_UNWINDING_VC_BUG - Success
Performing Test CGAL_CFG_IEEE_754_BUG - Success
Performing Test CGAL_CFG_ISTREAM_INT_BUG - Success
Performing Test CGAL_CFG_MATCHING_BUG_5 - Success
Performing Test CGAL_CFG_MATCHING_BUG_6 - Failed
Performing Test CGAL_CFG_MATCHING_BUG_7 - Failed
Performing Test CGAL_CFG_MATCHING_BUG_8 - Success
Performing Test CGAL_CFG_NESTED_CLASS_FRIEND_DECLARATION_BUG - Failed
Performing Test CGAL_CFG_NO_LIMITS - Success
Performing Test CGAL_CFG_NO_NEXTAFTER - Failed
Performing Test CGAL_CFG_NO_STL - Success
Performing Test CGAL_CFG_NO_WARNING_CPP_DIRECTIVE_BUG - Failed
Performing Test CGAL_CFG_NUMERIC_LIMITS_BUG - Success
Performing Test CGAL_CFG_OUTOFLINE_MEMBER_DEFINITION_BUG - Success
Performing Test CGAL_CFG_TEMPLATE_IN_DEFAULT_PARAMETER_BUG - Success
Performing Test CGAL_CFG_TYPENAME_BEFORE_DEFAULT_ARGUMENT_BUG - Success
Performing Test CGAL_CFG_USING_BASE_MEMBER_BUG_2 - Success
== Write compiler_config.h (DONE) ==
== Generating build files ==
Configuring libCGAL
Requested component: MPFR
Requested component: GMP
libCGAL is configured
Sources for CGAL component library 'CGAL_Core' detected
Configuring libCGAL_Core
Requested component: MPFR
Requested component: GMP
libCGAL_Core is configured
Sources for CGAL component library 'CGAL_ImageIO' detected
Configuring libCGAL_ImageIO
Found OpenGL: opengl32
Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
OpenGL include:
OpenGL libraries: glu32;opengl32
Requested component: MPFR
Requested component: GMP
libCGAL_ImageIO is configured
NOTICE: libCGAL_ImageIO needs ZLib to read compressed files. That feature will not be activated.
Sources for CGAL component library 'CGAL_Qt3' detected
Sources for CGAL component library 'CGAL_Qt5' detected
Configuring libCGAL_Qt5
USING Qt5_VERSION = '5.5.1'
OpenGL include:
OpenGL libraries: glu32;opengl32
OpenGL definitions:
Qt5Core include: C:/Qt/Qt5.5.1/5.5/msvc2010/include/;C:/Qt/Qt5.5.1/5.5/msvc2010/include/QtCore;C:/Qt/Qt5.5.1/5.5/msvc2010/.//mkspecs/win32-msvc2010
Qt5 libraries: Qt5::Core Qt5::Gui Qt5::Svg Qt5::OpenGL
Qt5Core definitions: -DQT_CORE_LIB
moc executable: C:/Qt/Qt5.5.1/5.5/msvc2010/bin/moc.exe
uic executable: C:/Qt/Qt5.5.1/5.5/msvc2010/bin/uic.exe
Requested component: MPFR
Requested component: GMP
libCGAL_Qt5 is configured
Sources for CGAL component libraries 'CGAL_Core;CGAL_ImageIO;CGAL_Qt3;CGAL_Qt5' detected
== Generating build files (DONE) ==
Configuring done
I clicked again on configure since I had red entries.
== Setting paths ==
Build CGAL from release in directory CGAL-4.7
Packagenames: CGAL-4.7
== Setting paths (DONE) ==
== Generate version files ==
CGAL_MAJOR_VERSION=4
CGAL_MINOR_VERSION=7
CGAL_BUGFIX_VERSION=0
CGAL_SONAME_VERSION=11
CGAL_SOVERSION =11.0.1
CGAL_REFERENCE_CACHE_DIR=
Building shared libraries
Targetting Visual Studio 10 2010
Target build enviroment supports auto-linking
Using VC10 compiler.
Generator uses intermediate configuration directory: $(Configuration)
USING CMake version: 3.3.2
System: Windows
== Generate version files (DONE) ==
== Set up flags ==
Build type: Release
USING CXXFLAGS = ' /DWIN32 /D_WINDOWS /W3 /GR /EHsc -D_CRT_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS /fp:strict /fp:except- /wd4503 /bigobj /MD /O2 /Ob2 /D NDEBUG'
USING LDFLAGS = ' /machine:X86 /INCREMENTAL:NO'
== Set up flags (DONE) ==
== Detect external libraries ==
External libraries supported: GMP;MPFR;ZLIB;OpenGL;LEDA;MPFI;RS;RS3;OpenNL;Eigen3;BLAS;LAPACK;QGLViewer;ESBTL;Coin3D;NTL;IPE
Preconfiguring library: GMP ...
GMP has been preconfigured:
UseGMP-file:
GMP include: C:/dev/CGAL-4.7/auxiliary/gmp/include
GMP libraries: C:/dev/CGAL-4.7/auxiliary/gmp/lib/libgmp-10.lib
GMP definitions:
USING GMP_VERSION = '5.0.1'
Preconfiguring library: MPFR ...
MPFR has been preconfigured:
UseMPFR-file:
MPFR include: C:/dev/CGAL-4.7/auxiliary/gmp/include
MPFR libraries: C:/dev/CGAL-4.7/auxiliary/gmp/lib/libmpfr-4.lib
MPFR definitions:
USING MPFR_VERSION = '3.0.0'
Boost version: 1.59.0
Found the following Boost libraries:
thread
system
Boost include: C:/dev/boost_1_59_0
Boost libraries: optimized;C:/dev/boost_1_59_0/lib32-msvc-10.0/boost_thread-vc100-mt-1_59.lib;debug;C:/dev/boost_1_59_0/lib32-msvc-10.0/boost_thread-vc100-mt-gd-1_59.lib;optimized;C:/dev/boost_1_59_0/lib32-msvc-10.0/boost_system-vc100-mt-1_59.lib;debug;C:/dev/boost_1_59_0/lib32-msvc-10.0/boost_system-vc100-mt-gd-1_59.lib
Boost definitions:
USING BOOST_VERSION = '1.59.0'
== Detect external libraries (DONE) ==
== Write compiler_config.h ==
== Write compiler_config.h (DONE) ==
== Generating build files ==
Configuring libCGAL
Requested component: MPFR
Requested component: GMP
libCGAL is configured
Sources for CGAL component library 'CGAL_Core' detected
Configuring libCGAL_Core
Requested component: MPFR
Requested component: GMP
libCGAL_Core is configured
Sources for CGAL component library 'CGAL_ImageIO' detected
Configuring libCGAL_ImageIO
Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
OpenGL include:
OpenGL libraries: glu32;opengl32
Requested component: MPFR
Requested component: GMP
libCGAL_ImageIO is configured
NOTICE: libCGAL_ImageIO needs ZLib to read compressed files. That feature will not be activated.
Sources for CGAL component library 'CGAL_Qt3' detected
Sources for CGAL component library 'CGAL_Qt5' detected
Configuring libCGAL_Qt5
USING Qt5_VERSION = '5.5.1'
OpenGL include:
OpenGL libraries: glu32;opengl32
OpenGL definitions:
Qt5Core include: C:/Qt/Qt5.5.1/5.5/msvc2010/include/;C:/Qt/Qt5.5.1/5.5/msvc2010/include/QtCore;C:/Qt/Qt5.5.1/5.5/msvc2010/.//mkspecs/win32-msvc2010
Qt5 libraries: Qt5::Core Qt5::Gui Qt5::Svg Qt5::OpenGL
Qt5Core definitions: -DQT_CORE_LIB
moc executable: C:/Qt/Qt5.5.1/5.5/msvc2010/bin/moc.exe
uic executable: C:/Qt/Qt5.5.1/5.5/msvc2010/bin/uic.exe
Requested component: MPFR
Requested component: GMP
libCGAL_Qt5 is configured
Sources for CGAL component libraries 'CGAL_Core;CGAL_ImageIO;CGAL_Qt3;CGAL_Qt5' detected
== Generating build files (DONE) ==
Configuring done
Then I clicked on generate: generating done.
I opened the solution in Visual c++ 2010 express.
I generate ALL_BUILD in debug.
1>------ Début de la génération (beginning of the generation) : Projet : ZERO_CHECK, Configuration : Debug Win32 ------
1> Checking Build System
1> CMake does not need to re-run because C:/dev/CGAL-4.7/build/CMakeFiles/generate.stamp is up-to-date.
1> CMake does not need to re-run because C:/dev/CGAL-4.7/build/src/CMakeFiles/generate.stamp is up-to-date.
1> CMake does not need to re-run because C:/dev/CGAL-4.7/build/src/CGAL/CMakeFiles/generate.stamp is up-to-date.
1> CMake does not need to re-run because C:/dev/CGAL-4.7/build/src/CGAL_Core/CMakeFiles/generate.stamp is up-to-date.
1> CMake does not need to re-run because C:/dev/CGAL-4.7/build/src/CGAL_ImageIO/CMakeFiles/generate.stamp is up-to-date.
1> CMake does not need to re-run because C:/dev/CGAL-4.7/build/src/CGAL_Qt5/CMakeFiles/generate.stamp is up-to-date.
2>------ Début de la génération : Projet : CGAL, Configuration : Debug Win32 ------
2> Building Custom Rule C:/dev/CGAL-4.7/src/CGAL/CMakeLists.txt
2> CMake does not need to re-run because C:\dev\CGAL-4.7\build\src\CGAL\CMakeFiles\generate.stamp is up-to-date.
2> all_files.cpp
2> Création de la bibliothèque C:/dev/CGAL-4.7/build/lib/Debug/CGAL-vc100-mt-gd-4.7.lib et de l'objet C:/dev/CGAL-4.7/build/lib/Debug/CGAL-vc100-mt-gd-4.7.exp
2> Création de la bibliothèque C:/dev/CGAL-4.7/build/lib/Debug/CGAL-vc100-mt-gd-4.7.lib et de l'objet C:/dev/CGAL-4.7/build/lib/Debug/CGAL-vc100-mt-gd-4.7.exp
2> CGAL.vcxproj -> C:\dev\CGAL-4.7\build\bin\Debug\CGAL-vc100-mt-gd-4.7.dll
2> 1 fichier(s) copié(s).
2> 1 fichier(s) copié(s).
2> 1 fichier(s) copié(s).
3>------ Début de la génération : Projet : CGAL_Core, Configuration : Debug Win32 ------
4>------ Début de la génération : Projet : CGAL_ImageIO, Configuration : Debug Win32 ------
5>------ Début de la génération : Projet : CGAL_Qt5, Configuration : Debug Win32 ------
3> Building Custom Rule C:/dev/CGAL-4.7/src/CGAL_Core/CMakeLists.txt
3> CMake does not need to re-run because C:\dev\CGAL-4.7\build\src\CGAL_Core\CMakeFiles\generate.stamp is up-to-date.
3> all_files.cpp
4> Building Custom Rule C:/dev/CGAL-4.7/src/CGAL_ImageIO/CMakeLists.txt
4> CMake does not need to re-run because C:\dev\CGAL-4.7\build\src\CGAL_ImageIO\CMakeFiles\generate.stamp is up-to-date.
4> all_files.cpp
5> Building Custom Rule C:/dev/CGAL-4.7/src/CGAL_Qt5/CMakeLists.txt
5> CMake does not need to re-run because C:\dev\CGAL-4.7\build\src\CGAL_Qt5\CMakeFiles\generate.stamp is up-to-date.
5> Generating __/__/include/CGAL/Qt/moc_GraphicsViewNavigation.cpp
5> Generating __/__/include/CGAL/Qt/moc_DemosMainWindow.cpp
5> Generating __/__/include/CGAL/Qt/moc_GraphicsItem.cpp
5> Generating __/__/include/CGAL/Qt/moc_GraphicsViewInput.cpp
5> Generating qrc_CGAL.cpp
5> Generating qrc_Input.cpp
5> Generating qrc_File.cpp
5> Generating qrc_Triangulation_2.cpp
5> all_files.cpp
3> Création de la bibliothèque C:/dev/CGAL-4.7/build/lib/Debug/CGAL_Core-vc100-mt-gd-4.7.lib et de l'objet C:/dev/CGAL-4.7/build/lib/Debug/CGAL_Core-vc100-mt-gd-4.7.exp
3> Création de la bibliothèque C:/dev/CGAL-4.7/build/lib/Debug/CGAL_Core-vc100-mt-gd-4.7.lib et de l'objet C:/dev/CGAL-4.7/build/lib/Debug/CGAL_Core-vc100-mt-gd-4.7.exp
3> CGAL_Core.vcxproj -> C:\dev\CGAL-4.7\build\bin\Debug\CGAL_Core-vc100-mt-gd-4.7.dll
3> 1 fichier(s) copié(s).
3> 1 fichier(s) copié(s).
3> 1 fichier(s) copié(s).
4> Création de la bibliothèque C:/dev/CGAL-4.7/build/lib/Debug/CGAL_ImageIO-vc100-mt-gd-4.7.lib et de l'objet C:/dev/CGAL-4.7/build/lib/Debug/CGAL_ImageIO-vc100-mt-gd-4.7.exp
4> Création de la bibliothèque C:/dev/CGAL-4.7/build/lib/Debug/CGAL_ImageIO-vc100-mt-gd-4.7.lib et de l'objet C:/dev/CGAL-4.7/build/lib/Debug/CGAL_ImageIO-vc100-mt-gd-4.7.exp
4> CGAL_ImageIO.vcxproj -> C:\dev\CGAL-4.7\build\bin\Debug\CGAL_ImageIO-vc100-mt-gd-4.7.dll
4> 1 fichier(s) copié(s).
4> 1 fichier(s) copié(s).
4> 1 fichier(s) copié(s).
5> moc_GraphicsViewNavigation.cpp
5> moc_DemosMainWindow.cpp
5> moc_GraphicsItem.cpp
5> moc_GraphicsViewInput.cpp
5> qrc_CGAL.cpp
5> qrc_Input.cpp
5> qrc_File.cpp
5> qrc_Triangulation_2.cpp
5> Génération de code en cours...
5> Création de la bibliothèque C:/dev/CGAL-4.7/build/lib/Debug/CGAL_Qt5-vc100-mt-gd-4.7.lib et de l'objet C:/dev/CGAL-4.7/build/lib/Debug/CGAL_Qt5-vc100-mt-gd-4.7.exp
5> Création de la bibliothèque C:/dev/CGAL-4.7/build/lib/Debug/CGAL_Qt5-vc100-mt-gd-4.7.lib et de l'objet C:/dev/CGAL-4.7/build/lib/Debug/CGAL_Qt5-vc100-mt-gd-4.7.exp
5> CGAL_Qt5.vcxproj -> C:\dev\CGAL-4.7\build\bin\Debug\CGAL_Qt5-vc100-mt-gd-4.7.dll
5> 1 fichier(s) copié(s).
5> 1 fichier(s) copié(s).
5> 1 fichier(s) copié(s).
6>------ Début de la génération : Projet : ALL_BUILD, Configuration : Debug Win32 ------
6> Building Custom Rule C:/dev/CGAL-4.7/CMakeLists.txt
6> CMake does not need to re-run because C:\dev\CGAL-4.7\build\CMakeFiles\generate.stamp is up-to-date.
========== Génération : 6 a réussi (succeed), 0 a échoué (failed), 0 mis à jour (updated), 0 a été ignoré (ignored)==========
I had the error message: impossible to open the file ALL_BUILD because it can be found.
I did the generation under release:
1>------ Début de la génération (beginning of the generation) : Projet : ZERO_CHECK, Configuration : Release Win32 ------
1> Checking Build System
1> CMake does not need to re-run because C:/dev/CGAL-4.7/build/CMakeFiles/generate.stamp is up-to-date.
1> CMake does not need to re-run because C:/dev/CGAL-4.7/build/src/CMakeFiles/generate.stamp is up-to-date.
1> CMake does not need to re-run because C:/dev/CGAL-4.7/build/src/CGAL/CMakeFiles/generate.stamp is up-to-date.
1> CMake does not need to re-run because C:/dev/CGAL-4.7/build/src/CGAL_Core/CMakeFiles/generate.stamp is up-to-date.
1> CMake does not need to re-run because C:/dev/CGAL-4.7/build/src/CGAL_ImageIO/CMakeFiles/generate.stamp is up-to-date.
1> CMake does not need to re-run because C:/dev/CGAL-4.7/build/src/CGAL_Qt5/CMakeFiles/generate.stamp is up-to-date.
2>------ Début de la génération : Projet : CGAL, Configuration : Release Win32 ------
2> Building Custom Rule C:/dev/CGAL-4.7/src/CGAL/CMakeLists.txt
2> CMake does not need to re-run because C:\dev\CGAL-4.7\build\src\CGAL\CMakeFiles\generate.stamp is up-to-date.
2> all_files.cpp
2> Création de la bibliothèque C:/dev/CGAL-4.7/build/lib/Release/CGAL-vc100-mt-4.7.lib et de l'objet C:/dev/CGAL-4.7/build/lib/Release/CGAL-vc100-mt-4.7.exp
2> CGAL.vcxproj -> C:\dev\CGAL-4.7\build\bin\Release\CGAL-vc100-mt-4.7.dll
2> 1 fichier(s) copié(s).
2> 1 fichier(s) copié(s).
3>------ Début de la génération : Projet : CGAL_Core, Configuration : Release Win32 ------
4>------ Début de la génération : Projet : CGAL_ImageIO, Configuration : Release Win32 ------
5>------ Début de la génération : Projet : CGAL_Qt5, Configuration : Release Win32 ------
3> Building Custom Rule C:/dev/CGAL-4.7/src/CGAL_Core/CMakeLists.txt
3> CMake does not need to re-run because C:\dev\CGAL-4.7\build\src\CGAL_Core\CMakeFiles\generate.stamp is up-to-date.
5> Building Custom Rule C:/dev/CGAL-4.7/src/CGAL_Qt5/CMakeLists.txt
4> Building Custom Rule C:/dev/CGAL-4.7/src/CGAL_ImageIO/CMakeLists.txt
4> CMake does not need to re-run because C:\dev\CGAL-4.7\build\src\CGAL_ImageIO\CMakeFiles\generate.stamp is up-to-date.
5> CMake does not need to re-run because C:\dev\CGAL-4.7\build\src\CGAL_Qt5\CMakeFiles\generate.stamp is up-to-date.
3> all_files.cpp
5> Generating __/__/include/CGAL/Qt/moc_GraphicsViewNavigation.cpp
4> all_files.cpp
5> Generating __/__/include/CGAL/Qt/moc_DemosMainWindow.cpp
5> Generating __/__/include/CGAL/Qt/moc_GraphicsItem.cpp
5> Generating __/__/include/CGAL/Qt/moc_GraphicsViewInput.cpp
5> Generating qrc_CGAL.cpp
5> Generating qrc_Input.cpp
5> Generating qrc_File.cpp
5> Generating qrc_Triangulation_2.cpp
5> all_files.cpp
3> Création de la bibliothèque C:/dev/CGAL-4.7/build/lib/Release/CGAL_Core-vc100-mt-4.7.lib et de l'objet C:/dev/CGAL-4.7/build/lib/Release/CGAL_Core-vc100-mt-4.7.exp
3> CGAL_Core.vcxproj -> C:\dev\CGAL-4.7\build\bin\Release\CGAL_Core-vc100-mt-4.7.dll
3> 1 fichier(s) copié(s).
3> 1 fichier(s) copié(s).
4> Création de la bibliothèque C:/dev/CGAL-4.7/build/lib/Release/CGAL_ImageIO-vc100-mt-4.7.lib et de l'objet C:/dev/CGAL-4.7/build/lib/Release/CGAL_ImageIO-vc100-mt-4.7.exp
4> CGAL_ImageIO.vcxproj -> C:\dev\CGAL-4.7\build\bin\Release\CGAL_ImageIO-vc100-mt-4.7.dll
4> 1 fichier(s) copié(s).
4> 1 fichier(s) copié(s).
5> moc_GraphicsViewNavigation.cpp
5> moc_DemosMainWindow.cpp
5> moc_GraphicsItem.cpp
5> moc_GraphicsViewInput.cpp
5> qrc_CGAL.cpp
5> qrc_Input.cpp
5> qrc_File.cpp
5> qrc_Triangulation_2.cpp
5> Génération de code en cours...
5> Création de la bibliothèque C:/dev/CGAL-4.7/build/lib/Release/CGAL_Qt5-vc100-mt-4.7.lib et de l'objet C:/dev/CGAL-4.7/build/lib/Release/CGAL_Qt5-vc100-mt-4.7.exp
5> CGAL_Qt5.vcxproj -> C:\dev\CGAL-4.7\build\bin\Release\CGAL_Qt5-vc100-mt-4.7.dll
5> 1 fichier(s) copié(s).
5> 1 fichier(s) copié(s).
6>------ Début de la génération : Projet : ALL_BUILD, Configuration : Release Win32 ------
6> Building Custom Rule C:/dev/CGAL-4.7/CMakeLists.txt
6> CMake does not need to re-run because C:\dev\CGAL-4.7\build\CMakeFiles\generate.stamp is up-to-date.
========== Génération : 6 a réussi (succeed), 0 a échoué (failed), 0 mis à jour (updated), 0 a été ignoré (ignored) ==========
Same error message as in debug.
I put C:\dev\CGAL-4.7\build\bin in my path.
Building an example:
I opened CMAKE-GUI and put C:/dev/CGAL-4.7/examples/Convex_hull_2 as a source and C:\dev\CGAL-4.7\build-example\Convex_hull_2 for where to build the binary.
First configuration:
The C compiler identification is MSVC 16.0.40219.1
The CXX compiler identification is MSVC 16.0.40219.1
Check for working C compiler using: Visual Studio 10 2010
Check for working C compiler using: Visual Studio 10 2010 -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler using: Visual Studio 10 2010
Check for working CXX compiler using: Visual Studio 10 2010 -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
Build type: Release
USING CXXFLAGS = ' /DWIN32 /D_WINDOWS /W3 /GR /EHsc -D_CRT_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS /fp:strict /fp:except- /wd4503 /bigobj /MD /O2 /Ob2 /D NDEBUG'
USING EXEFLAGS = ' /machine:X86 /INCREMENTAL:NO'
Targetting Visual Studio 10 2010
Target build enviroment supports auto-linking
Using VC10 compiler.
Generator uses intermediate configuration directory: $(Configuration)
Requested component: Core
Requested component: MPFR
Requested component: GMP
Configuring done
Second configuration
Build type: Release
USING CXXFLAGS = ' /DWIN32 /D_WINDOWS /W3 /GR /EHsc -D_CRT_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS /fp:strict /fp:except- /wd4503 /bigobj /MD /O2 /Ob2 /D NDEBUG'
USING EXEFLAGS = ' /machine:X86 /INCREMENTAL:NO'
Targetting Visual Studio 10 2010
Target build enviroment supports auto-linking
Using VC10 compiler.
Generator uses intermediate configuration directory: $(Configuration)
Requested component: Core
Requested component: MPFR
Requested component: GMP
Configuring done
Generating done.
WHen I run an example like convexhull 2 the exe file cannot be opened since boot_system-vc100-mt-gd-1_59.dll is missing.
Can you help me please?
Thank you for your time and help!
Best regards,
Jérémie
Related
I am trying to install Gazebo for Windows following this tutorial https://gazebosim.org/tutorials?tut=install_on_windows&cat=install
I have already faced several issues from point 8 in advance, as I had to manually add to "DCMAKE_PREFIX_PATH" in the configure bat files some dependecies as it wasn't able to locate them.
However, I am now in step 10 trying to configure and build Ignition Common, but I get an error when linking.
Here is my configure file:
:: Install dependencies
call %win_lib% :download_unzip_install dlfcn-win32-vc15-x64-dll-MD.zip
call %win_lib% :install_ign_project ign-math ign-math4
:: Set configuration variables
#set build_type=Release
#if not "%1"=="" set build_type=%1
#echo Configuring for build type %build_type%
:: Go to the directory that this configure.bat file exists in
cd /d %~dp0
:: Create a build directory and configure
md build
cd build
cmake .. -G "NMake Makefiles" -DCMAKE_PREFIX_PATH="C:\Users\yimmi\gz-ws\ign-cmake\build\install\Release\lib\cmake;C:\Users\yimmi\gz-ws\ign-math\build\install\Release\lib\cmake\ignition-math4;C:\Users\yimmi\gz-ws\dlfcn-win32-vc15-x64-dll-MD\share\dlfcn-win32" -DCMAKE_INSTALL_PREFIX="%WORKSPACE_INSTALL_DIR%" -DCMAKE_BUILD_TYPE="%build_type%" -DBUILD_TESTING:BOOL=False
:: Note: We disable testing by default. If the intention is for the CI to build and test
:: this project, then the CI script will turn it back on.
:: If the caller wants to build and/or install, they should do so after calling this script
When running it in Visual Studio 2019 Developer Command Prompt i get the following messages
-- The C compiler identification is MSVC 19.29.30141.0
-- The CXX compiler identification is MSVC 19.29.30141.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx86/x86/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx86/x86/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- ignition-common1 version 1.1.1
-- Operating system is Windows
--
-- ====== Finding Dependencies ======
-- Looking for ignition-math4 - found
-- Skipping search for tinyxml2 and using an internal version
-- Found DL: TRUE
-- Looking for libdl - found
CMake Warning (dev) at C:/Users/yimmi/gz-ws/ign-cmake/build/install/Release/lib/cmake/ignition-cmake0/cmake0/IgnUtils.cmake:265 (message):
-- THIS MESSAGE IS INTENDED FOR IGNITION-COMMON AUTHORS --
(IF YOU SEE THIS, PLEASE REPORT IT)
Could not find pkg-config information for DL. It was not provided by the
find-module for the package, nor was it explicitly passed into the call to
ign_find_package(~). This is most likely an error in this project's use of
ign-cmake.
Call Stack (most recent call first):
CMakeLists.txt:62 (ign_find_package)
This warning is for project developers. Use -Wno-dev to suppress it.
-- -------------------------------------------
-- Adding tinyxml2 source files
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Failed
-- Performing Test COMPILER_HAS_DEPRECATED
-- Performing Test COMPILER_HAS_DEPRECATED - Success
-- Testing is disabled -- skipping UNIT tests
-- Build configuration successful
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Build type: Release
-- Install prefix:
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/yimmi/gz-ws/ign-common/build
I think everything worked fine, but then, if I call nmake this is what I get at the end:
[ 97%] Building CXX object src/CMakeFiles/ignition-common1.dir/tinyxml2/tinyxml2.cpp.obj
cl : Línea de comandos warning D9025 : invalidando '/W3' con '/W2'
tinyxml2.cpp
[100%] Linking CXX shared library ignition-common1.dll
LINK: command "C:\PROGRA~2\MICROS~4\2019\COMMUN~1\VC\Tools\MSVC\1429~1.301\bin\Hostx86\x86\link.exe /nologo #CMakeFiles\ignition-common1.dir\objects1.rsp /out:ignition-common1.dll /implib:ignition-common1.lib /pdb:C:\Users\yimmi\gz-ws\ign-common\build\src\ignition-common1.pdb /dll /version:1.1 /machine:X86 /INCREMENTAL:NO C:\Users\yimmi\gz-ws\ign-math\build\install\Release\lib\ignition-math4.lib C:\Users\yimmi\gz-ws\dlfcn-win32-vc15-x64-dll-MD\lib\dl.lib psapi.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:ignition-common1.dll.manifest" failed (exit code 1120) with the following output:
Animation.cc.obj : se encontró .netmodule MSIL o un módulo compilado con /GL; reiniciando la vinculación con /LTCG; agregue /LTCG a la línea de comandos de vínculo para mejorar el rendimiento del vinculador
Creando biblioteca ignition-common1.lib y objeto ignition-common1.exp
PluginLoader.cc.obj : error LNK2001: símbolo externo _dlsym sin resolver
PluginLoader.cc.obj : error LNK2001: símbolo externo _dlerror sin resolver
PluginLoader.cc.obj : error LNK2001: símbolo externo _dlopen sin resolver
ignition-common1.dll : fatal error LNK1120: 3 externos sin resolver
NMAKE : fatal error U1077: '"C:\Program Files\CMake\bin\cmake.exe"' : código devuelto '0xffffffff'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x86\nmake.exe"' : código devuelto '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x86\nmake.exe"' : código devuelto '0x2'
Stop.
Can anybody help me?
Thank you in advance!
Let's say I have libTiff, libpng, zlib and libjpeg. How do I tell wxWidgets to use those instead of builtin or installed ones on the system?
I'm quite new to wxWidgets and trying to add it as a dependency to my CMake project, which in return already depends and builds (using ExternalProject) the above mentioned libraries. I do not want to mix versions (which is bound to happen if I use builtin or ones already installed on the system). I also want to keep all the dependencies separate from what is already present on the system for easier distribution.
I have checked setup.h.in where the preprocessor macros are defined (here: wxUSE_ZLIB, wxUSE_LIBJPEG, wxUSE_LIBTIFF and wxUSE_LIBPNG). I also see that inside <root of wxWidgets git repo>/build/cmake/lib/ I have various *.cmake include files that handle different 3rd party dependencies.
I am however confused what I need to pass to my cmake command in order to configure wxWidgets to use versions of the libraries mentioned above from a specific location. I have defined PNG_LIBRARIES, JPEG_LIBRARIES etc. (pointing at where the *.lib (on Windows) or *.so (on Linux) files are. In addition I have defined the ..._INCLUDE_DIRS accordingly.
Currently this is the state of my external project description (the ... are placeholders of valid paths)
ExternalProject_Add(wxWidgets
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/deps/wxwidgets
INSTALL_DIR ...
DOWNLOAD_DIR ""
TMP_DIR ...
STAMP_DIR ...
LOG_DIR ...
BINARY_DIR ...
SOURCE_DIR ...
INSTALL_COMMAND "${CMAKE_COMMAND}" -E echo "Skipping install step for dependency libzmq"
INSTALL_PREFIX ...
BUILD_ALWAYS OFF
# For build configurations see https://wiki.wxwidgets.org/WxWidgets_Build_Configurations
# Also setup.h.in and <wxWidgets_root>/build/cmake/libs
CMAKE_ARGS
"-DCMAKE_BUILD_TYPE=Release"
"-DBUILD=release"
"-DSHARED=1"
"-DMONOLITHIC=1"
"-DwxBUILD_TESTS=OFF"
"-DwxBUILD_DEMOS=OFF"
"-DwxBUILD_BENCHMARKS=OFF"
"-DwxUSE_GUI=1" # <---- forces dependency requirement for PNG, ZLIB, JPEG, TIFF
"-DwxUSE_OPENGL=1"
"-DwxUSE_ZLIB=sys"
"-DZLIB_LIBRARY=${ZLIB_LIBRARIES}" # <---- from another ExternalProject
"-DZLIB_INCLUDE_DIRS=${ZLIB_INCLUDE_DIRS}" # <---- from another ExternalProject
"-DwxUSE_LIBJPEG=sys"
"-DJPEG_LIBRARY=${JPEG_LIBRARIES}" # <---- from another ExternalProject
"-DJPEG_INCLUDE_DIR=${JPEG_INCLUDE_DIRS}" # <---- from another ExternalProject
"-DwxUSE_LIBPNG=sys"
"-DPNG_LIBRARY=${PNG_LIBRARIES}" # <---- from another ExternalProject
"-DPNG_PNG_INCLUDE_DIR=${PNG_INCLUDE_DIRS}" # <---- from another ExternalProject
"-DwxUSE_LIBTIFF=builtin" # TODO Add libTiff to external project dependencies and use here
)
What I basically did is initially put stuff on OFF. wxWidgets's configuration is smart enough to warn me that (since I included wxUSE_GUI, which requires those libs) the respective libraries are missing and it will use builtin instead. From there I found out which variables it is actually looking for and by setting wxUSE_... to sys for the respective library. For now I am getting closer to configuring the build:
1>------ Rebuild All started: Project: ZERO_CHECK, Configuration: Debug x64 ------
1>Checking Build System
2>------ Rebuild All started: Project: wxWidgets, Configuration: Debug x64 ------
2>Creating directories for 'wxWidgets'
2>Building Custom Rule C:/Users/.../Documents/.../CMakeLists.txt
2>No download step for 'wxWidgets'
2>No update step for 'wxWidgets'
2>No patch step for 'wxWidgets'
2>Performing configure step for 'wxWidgets'
2>-- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.19042.
2>-- cotire 1.8.0 loaded.
2>-- Found ZLIB: C:/Users/.../CMakeBuilds/ef5b5ada-ee42-7735-988a-ae37c735ccff/build/deps/build/zlib/Debug/zlibd.lib (found version "1.2.11")
2>-- Found JPEG: C:/Users/rcr-aa/CMakeBuilds/ef5b5ada-ee42-7735-988a-ae37c735ccff/build/deps/build/jpeg/Debug/jpeg.lib (found version "90")
2>-- Found PNG: C:/Users/.../CMakeBuilds/ef5b5ada-ee42-7735-988a-ae37c735ccff/build/deps/build/png/Debug/libpng16d.lib (found version "1.6.38.git")
2>-- Which libraries should wxWidgets use?
2> wxUSE_STL: OFF (use C++ STL classes)
2> wxUSE_REGEX: builtin (enable support for wxRegEx class)
2> wxUSE_ZLIB: sys (use zlib for LZW compression)
2> wxUSE_EXPAT: builtin (use expat for XML parsing)
2> wxUSE_LIBJPEG: sys (use libjpeg (JPEG file format))
2> wxUSE_LIBPNG: sys (use libpng (PNG image format))
2> wxUSE_LIBTIFF: builtin (use libtiff (TIFF file format))
2> wxUSE_LIBLZMA: OFF (use liblzma for LZMA compression)
2>
2>-- Configured wxWidgets 3.1.6 for Windows-10.0.19042
2> Min OS Version required at runtime: Windows Vista / Windows Server 2008 (x64 Edition)
2> Which GUI toolkit should wxWidgets use? msw
2> Should wxWidgets be compiled into single library? OFF
2> Should wxWidgets be linked as a shared library? ON
2> Should wxWidgets support Unicode? ON
2> What wxWidgets compatibility level should be used? 3.0
2>-- Configuring done
While looking around I also checked the *.cmake files for the libraries I want to use a custom version of to confirm what needs to be set. An example for zlib can be seen below:
#############################################################################
# Name: build/cmake/lib/zlib.cmake
# Purpose: Use external or internal zlib
# Author: Tobias Taschner
# Created: 2016-09-21
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
if(wxUSE_ZLIB STREQUAL "builtin")
# TODO: implement building zlib via its CMake file, using
# add_subdirectory or ExternalProject_Add
wx_add_builtin_library(wxzlib
src/zlib/adler32.c
src/zlib/compress.c
src/zlib/crc32.c
src/zlib/deflate.c
src/zlib/gzclose.c
src/zlib/gzlib.c
src/zlib/gzread.c
src/zlib/gzwrite.c
src/zlib/infback.c
src/zlib/inffast.c
src/zlib/inflate.c
src/zlib/inftrees.c
src/zlib/trees.c
src/zlib/uncompr.c
src/zlib/zutil.c
)
if(WIN32)
# Define this to get rid of many warnings about using open(),
# read() and other POSIX functions in zlib code. This is much
# more convenient than having to modify it to avoid them.
target_compile_definitions(wxzlib PRIVATE _CRT_NONSTDC_NO_WARNINGS)
endif()
set(ZLIB_LIBRARIES wxzlib) # <----------- set via -DZLIB_LIBRARIES in my ExternalProject
set(ZLIB_INCLUDE_DIRS ${wxSOURCE_DIR}/src/zlib) # <----------- set via -DZLIB_INCLUDE_DIRS in my ExternalProject
elseif(wxUSE_ZLIB)
find_package(ZLIB REQUIRED)
endif()
My biggest problem here is that I apparently have to set the configuration for each and every 3rd party dependency (in my case set every other dependency to builtin)
2>CMake Error at build/cmake/functions.cmake:591 (add_library):
2> Cannot find source file:
2>
2> C:/Users/.../Documents/.../deps/wxwidgets/3rdparty/pcre/src/pcre2_auto_possess.c
2>
2> Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h
2> .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc
2>Call Stack (most recent call first):
2> build/cmake/lib/regex.cmake:13 (wx_add_builtin_library)
2> build/cmake/lib/CMakeLists.txt:28 (include)
2>
2>
2>CMake Error at build/cmake/functions.cmake:591 (add_library):
2> Cannot find source file:
2>
2> C:/Users/.../Documents/.../deps/wxwidgets/src/expat/expat/lib/xmlparse.c
2>
2> Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h
2> .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc
2>Call Stack (most recent call first):
2> build/cmake/lib/expat.cmake:13 (wx_add_builtin_library)
2> build/cmake/lib/CMakeLists.txt:28 (include)
2>
2>
2>CMake Error at build/cmake/functions.cmake:591 (add_library):
2> Cannot find source file:
2>
2> C:/Users/.../Documents/.../deps/wxwidgets/src/tiff/libtiff/tif_win32.c
2>
2> Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h
2> .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc
2>Call Stack (most recent call first):
2> build/cmake/lib/tiff.cmake:19 (wx_add_builtin_library)
2> build/cmake/lib/CMakeLists.txt:28 (include)
2>
2>
2>CMake Error at build/cmake/functions.cmake:591 (add_library):
2> No SOURCES given to target: wxregex
2>Call Stack (most recent call first):
2> build/cmake/lib/regex.cmake:13 (wx_add_builtin_library)
2> build/cmake/lib/CMakeLists.txt:28 (include)
2>
2>
2>CMake Error at build/cmake/functions.cmake:591 (add_library):
2> No SOURCES given to target: wxexpat
2>Call Stack (most recent call first):
2> build/cmake/lib/expat.cmake:13 (wx_add_builtin_library)
2> build/cmake/lib/CMakeLists.txt:28 (include)
2>
2>
2>CMake Error at build/cmake/functions.cmake:591 (add_library):
2> No SOURCES given to target: wxtiff
2>Call Stack (most recent call first):
2> build/cmake/lib/tiff.cmake:19 (wx_add_builtin_library)
2> build/cmake/lib/CMakeLists.txt:28 (include)
2>
2>
2>CMake Generate step failed. Build files cannot be regenerated correctly.
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(209,5): error MSB6006: "cmd.exe" exited with code 1.
2>Done building project "wxWidgets.vcxproj" -- FAILED.
Since I am not familiar with wxWidgets I would like to ask if I can just set all the rest of the dependencies to builtin.
First of all, you have to set things up so that the existing libraries can be found, either by CMake (using its find_package()) or configure (which uses pkg-config).
Second, with CMake, I believe that you need to explicit set options such as wxUSE_LIBPNG to sys. When building using configure, this is already the default, as configure will look for the system libraries first, and only fall back on the built-in ones if system ones are not found, but you can also use its command line options such as --with-libpng=sys to force using the system libraries (and fail the configuration if they're not found).
Problem:
After I run cmake to generate a project with a STATIC library, which completes successfully, both ninja and mingw32-make fail to make their targets at linking. For SHARED libraries or executables this same setup worked fine. I've tried this both for "Ninja" and "MinGW Makefiles" generators:
ninja output:
[2/2] Linking CXX static library hello_wsl.lib
FAILED: hello_wsl.lib
cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E remove hello_wsl.lib && "" qc hello_wsl.lib CMakeFiles/hello_wsl.dir/lib_hello_world.cpp.obj && cd ."
"""" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.
ninja: build stopped: subcommand failed.
mingw32-make output:
Scanning dependencies of target hello_wsl
[ 50%] Building CXX object CMakeFiles/hello_wsl.dir/lib_hello_world.cpp.obj
[100%] Linking CXX static library hello_wsl.lib
Error running link command: El parámetro no es correcto
CMakeFiles\hello_wsl.dir\build.make:93: recipe for target 'hello_wsl.lib' failed
mingw32-make.exe[2]: *** [hello_wsl.lib] Error 2
CMakeFiles\Makefile2:66: recipe for target 'CMakeFiles/hello_wsl.dir/all' failed
mingw32-make.exe[1]: *** [CMakeFiles/hello_wsl.dir/all] Error 2
Makefile:82: recipe for target 'all' failed
mingw32-make.exe: *** [all] Error 2
Also take a look at "project_root\build\CMakeFiles\hello_wsl.dir\link.txt" generated by "MinGW Makefiles":
"" qc hello_wsl.lib CMakeFiles/hello_wsl.dir/lib_hello_world.cpp.obj
Sample project, in steps, to reproduce the problem for "MinGW Makefiles":
Install CMake 3.8.0
Install MinGWx64 6.3 windows binaries (I've downloaded them from here)
Create a root folder for this project, I'll call it project_root in this sample.
Create these subfolders inside:
project_root\build
project_root\include
project_root\include\lib_hello_world
Create these files:
project_root\include\lib_hello_world\lib_hello_world.cpp:
#include <iostream>
class HelloWorldClass{
HelloWorldClass(){
std::cout << "Hello, world!" << std::endl;
}
};
project_root\include\lib_hello_world\CMakeLists.txt:
cmake_minimum_required(VERSION 3.8.0)
project(lib_hello_world)
add_library(lib_hello_world STATIC lib_hello_world.cpp)
project_root\toolchain.cmake:
# Target system (cross compile)
set(CMAKE_SYSTEM_NAME WindowsStore)
set(CMAKE_SYSTEM_VERSION 10.0)
# BIN utils
SET(CMAKE_AR "$ENV{MINGW_W64_BIN_DIR}/ar.exe")
SET(CMAKE_OBJCOPY "$ENV{MINGW_W64_BIN_DIR}/objcopy.exe")
SET(CMAKE_OBJDUMP "$ENV{MINGW_W64_BIN_DIR}/objdump.exe")
SET(CMAKE_RANLIB "$ENV{MINGW_W64_BIN_DIR}/ranlib.exe")
SET(CMAKE_NM "$ENV{MINGW_W64_BIN_DIR}/nm.exe")
SET(CMAKE_STRIP "$ENV{MINGW_W64_BIN_DIR}/strip.exe")
# C compiler
SET(CMAKE_C_COMPILER "$ENV{MINGW_W64_BIN_DIR}/gcc.exe")
# CXX compiler
SET(CMAKE_CXX_COMPILER "$ENV{MINGW_W64_BIN_DIR}/g++.exe")
# LINKER
SET(CMAKE_LINKER "$ENV{MINGW_W64_BIN_DIR}/ld.bfd.exe")
project_root\configure.bat:
#ECHO OFF
SETLOCAL
#ECHO OFF
REM Change these variables to the corresponding paths on your own system
SET "CMAKE_EXECUTABLE=C:\Program Files\CMake\bin\cmake.exe"
SET "MINGW_W64_BIN_DIR=C:/Program Files/MinGWx64/bin"
CD "%~dp0\build"
CALL "%CMAKE_EXECUTABLE%" "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON" "-DCMAKE_BUILD_TYPE=Debug" -G "MinGW Makefiles" "-DCMAKE_MAKE_PROGRAM='%MINGW_W64_BIN_DIR%/mingw32-make.exe'" "-DCMAKE_TOOLCHAIN_FILE='%~dp0/toolchain.cmake'" "%~dp0/include/lib_hello_world"
ENDLOCAL
project_root\build.bat:
#ECHO OFF
SETLOCAL
#ECHO OFF
REM Change this variable to the corresponding path on your own system
SET "MINGW_W64_BIN_DIR=C:/Program Files/MinGWx64/bin"
CD "%~dp0\build"
CALL "%MINGW_W64_BIN_DIR%/mingw32-make.exe"
ENDLOCAL
Finally, open CMD and run the commands:
project_root\configure.bat
project_root\build.bat
This is a sketchy fix/workaround that I found:
Create this file:
project_root\fix.bat:
#ECHO OFF
SETLOCAL
#ECHO OFF
MOVE "%~dp0\build\CMakeCache.txt" ".\"
RMDIR "%~dp0\build" /S /Q
MKDIR "%~dp0\build"
MOVE "%~dp0\CMakeCache.txt" ".\build\"
ENDLOCAL
After reproducing the error, open CMD and run:
project_root\fix.bat
project_root\configure.bat
project_root\build.bat
ninja output after fix (successfully linked):
[2/2] Linking CXX static library hello_wsl.lib
mingw32-make after fix (successfully linked):
Scanning dependencies of target hello_wsl
[ 50%] Building CXX object CMakeFiles/hello_wsl.dir/lib_hello_world.cpp.obj
[100%] Linking CXX static library hello_wsl.lib
[100%] Built target hello_wsl
A few things I did to try to figure this out:
I made a backup of CMakeCache.txt (CMakeCache.txt.before_fix) before applying the fix and reruning configure and build. There was no diference between the CMakeCache.txt.before_fix and CMakeCache.txt files after reconfiguring and successfully building the project.
I also made a backup of "rules.ninja" and then compared them with FC. This is the output of FC "project_root\rules.ninja.before_fix" "project_root\build\rules.ninja":
Comparando archivos .\rules.ninja.before_fix y .\BUILD\RULES.NINJA
***** .\rules.ninja.before_fix
rule CXX_STATIC_LIBRARY_LINKER__lib_hello_world
command = cmd.exe /C "$PRE_LINK && "C:\Program Files\CMake\bin\cmake.exe" -E remove $TARGET_FILE && "" qc $TARGET_FILE $LINK_
FLAGS $in && $POST_BUILD"
description = Linking CXX static library $TARGET_FILE
***** .\BUILD\RULES.NINJA
rule CXX_STATIC_LIBRARY_LINKER__lib_hello_world
command = cmd.exe /C "$PRE_LINK && "C:\Program Files\CMake\bin\cmake.exe" -E remove $TARGET_FILE && C:\PROGRA~1\MinGWx64\bin\
ar.exe qc $TARGET_FILE $LINK_FLAGS $in && C:\PROGRA~1\MinGWx64\bin\ranlib.exe $TARGET_FILE && $POST_BUILD"
description = Linking CXX static library $TARGET_FILE
*****
And did the same for "MinGW Makefiles". This is the output of FC "project_root\link.txt.before_fix" "project_root\build\CMakeFiles\lib_hello_world.dir\link.txt":
Comparando archivos .\link.txt.before_fix y .\BUILD\CMAKEFILES\LIB_HELLO_WORLD.DIR\LINK.TXT
***** .\link.txt.before_fix
"" qc hello_wsl.lib CMakeFiles/hello_wsl.dir/lib_hello_world.cpp.obj
***** .\BUILD\CMAKEFILES\LIB_HELLO_WORLD.DIR\LINK.TXT
C:\PROGRA~1\MinGWx64\bin\ar.exe qc lib_hello_world.lib CMakeFiles/lib_hello_world.dir/lib_hello_world.cpp.obj
C:\PROGRA~1\MinGWx64\bin\ranlib.exe lib_hello_world.lib
*****
There is some specific about CMAKE_AR and CMAKE_RUNLIB variables: according to that bugreport they should be declared as CACHED:
SET(CMAKE_AR "$ENV{MINGW_W64_BIN_DIR}/ar.exe" CACHE FILEPATH "Arhiver")
SET(CMAKE_RANLIB "$ENV{MINGW_W64_BIN_DIR}/ranlib.exe" CACHE FILEPATH "Runlib")
I have Visual Studio Pro 2019 (VS) and I switched NDK versions, from 16 to 18.
The thing is, my ndk 16 was an old one, from Android Studio, and the new one, I installed directly from VS (Tools/Android/Android SDK Manager)
My project uses cmake files among other things to build, and I have to include the new path for the ndk into them.
The new path to the ndk contains more SPACE characters, and that's what's troubleing me.
I build my project, and the following error occurs:
The C compiler
3>
3> "C:/Program Files (x86)/Android/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe"
3>
3> is not able to compile a simple test program.
3>
3> It fails with the following output:
3>
3> Change Dir: D:/Repos/Client_main/client/BuildResults/CustomDebug_AndroidArm_MRClient/CMakeFiles/CMakeTmp
3>
3> Run Build Command(s):ninja.exe cmTC_633e0 && [1/2] Building C object CMakeFiles/cmTC_633e0.dir/testCCompiler.c.o
3> FAILED: CMakeFiles/cmTC_633e0.dir/testCCompiler.c.o
3> C:\PROGRA~2\Android\ANDROI~1\NDK-BU~1\TOOLCH~1\llvm\prebuilt\WINDOW~1\bin\clang.exe --target=armv7-none-linux-androideabi27 --gcc-toolchain="C:/Program Files (x86)/Android/android-sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64" --sysroot="C:/Program Files (x86)/Android/android-sdk/ndk-bundle/sysroot" -isystem C:/Program Files (x86)/Android/android-sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb -mfpu=neon -Wa,--noexecstack -Wformat -Werror=format-security -fPIE -o CMakeFiles/cmTC_633e0.dir/testCCompiler.c.o -c testCCompiler.c
3>D:\Repos\Client_main\client\MediaroomAndroidApp\clang.exe : error : no such file or directory: 'Files'
3>D:\Repos\Client_main\client\MediaroomAndroidApp\clang.exe : error : no such file or directory: '(x86)/Android/android-sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi'
3> ninja: build stopped: subcommand failed.
After my research, I found out, that the following parameter is the cause of the problem:
-isystem C:/Program Files (x86)/Android/android-sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi
It should be with quotes (-isystem "C:...").
I have no idea how to do that, it is not my code, it seems that the cmake is building the command for clang.exe to run, but I have no idea how to correct it.
Any ideas?
Edit 1: CMAKE command:
<CmakeCommand><![CDATA[
call "$(VsToolsDir)VsDevCmd.bat" -no_logo
cmake -G "Ninja" -DCMAKE_INSTALL_PREFIX:PATH="$(MstvBuildTypeDir)" -DBUILD_PLATFORM:STRING="Android" -DANDROID_TOOLCHAIN:STRING="clang" -DCMAKE_SYSTEM_NAME:STRING="Android" -DANDROID_API_LEVEL:STRING="27" -DANDROID_PLATFORM:STRING="android-27" -DANDROID_ABI:STRING="armeabi-v7a" -DCMAKE_TOOLCHAIN_FILE:STRING="C:/PROGRA~2/Android/ANDROI~1/NDK-BU~1/build/cmake/android.toolchain.cmake" -DCMAKE_SYSTEM_VERSION:STRING="27" -DCMAKE_ANDROID_ARCH_ABI:STRING="armeabi-v7a" -DANDROID_STL:STRING="c++_shared" -DBUILD_TYPE:STRING="$(NativeLowercaseConfig)" -DBUILD_VARIANT:STRING="$(NativeLowercaseVariant)" -DBUILD_TARGET:STRING="Arm" -DCMAKE_NO_SYSTEM_FROM_IMPORTED:STRING="TRUE" -DTOOLCHAIN_ROOT:STRING="C:/PROGRA~2/Android/ANDROI~1/NDK-BU~1/toolchains/llvm/prebuilt/windows-x86_64" -DCMAKE_BUILD_TYPE="$(Configuration)" -DCMAKE_MAKE_PROGRAM="ninja.exe" "$(MstvClientDir)"
]]></CmakeCommand>
Edit 2:
I read all over that the LLVM directory (in there is clang.exe) MUST NOT be on a path containing SPACEs, is this still the case with version 7.0.2?
Thank you for your time.
In the end, I could not solve the problem as I wanted to, but found a diferent solution that keeps the NDK in its original position.
I made a symbolic link like this:
mklink /J C:\ProFiles86 "C:\Program Files (x86)"
Afterwards, I changed my path in order to use the link (C:\ProFiles86...) and it worked.
Again, this is not ideal for me, because it requires an aditional script to be included in my project, but for now it'll do.
I am trying to build a simple application on a Windows machine using CMake as the main build tool. Once CMake is invoked on the project the is an error on configuration phase:
> cmake -H. -G Ninja -Bbuild -DCMAKE_C_COMPILER:PATH="C:\Program Files\LLVM\bin\clang-cl.exe" -DCMAKE_CXX_COMPILER:PATH="C:\Program Files\LLVM\bin\clang-cl.exe"
-- The C compiler identification is Clang 7.0.0
-- The CXX compiler identification is Clang 7.0.0
-- Check for working C compiler: C:/Program Files/LLVM/bin/clang-cl.exe
-- Check for working C compiler: C:/Program Files/LLVM/bin/clang-cl.exe --broken
CMake Error at C:/Program Files/CMake/share/cmake-3.12/Modules/CMakeTestCCompile
r.cmake:52 (message):
The C compiler
"C:/Program Files/LLVM/bin/clang-cl.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/mak/Desktop/cmake-test/build/CMakeFiles/CMakeTmp
Run Build Command:"C:/Qt/Tools/QtCreator/bin/ninja.exe" "cmTC_f5485"
[1/2] Building C object CMakeFiles\cmTC_f5485.dir\testCCompiler.c.obj
[2/2] Linking C executable cmTC_f5485.exe
FAILED: cmTC_f5485.exe
cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\cmTC_f5485.dir --manifests -- CMAKE_LINKER-NOTFOUND /nologo CMakeFiles\cmTC_f5485.dir\testCCompiler.c.obj /out:cmTC_f5485.exe /implib:cmTC_f5485.lib /pdb:cmTC_f5485.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
RC Pass 1: command "rc /foCMakeFiles\cmTC_f5485.dir/manifest.res CMakeFiles\cmTC_f5485.dir/manifest.rc" failed (exit code 0) with the following output:
The system cannot find the given file
ninja: build stopped: subcommand failed.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:3 (project)
I read a lot through the web but my problem was not solved by any proposed solution. What I found so far is a simmilar but maybe outdated solution to the same problem which did not work for me, because Ninja was not able to build the executable:
> ninja all
[1/2] Building CXX object CMakeFiles/minimal.dir/main.cpp.obj
FAILED: CMakeFiles/minimal.dir/main.cpp.obj
C:\PROGRA~1\LLVM\bin\clang-cl.exe -MD -MT CMakeFiles/minimal.dir/main.cpp.obj -MF CMakeFiles\minimal.dir\main.cpp.obj.d -o CMakeFiles/minimal.dir/main.cpp.obj -c ../main.cpp
clang-cl.exe: warning: unknown argument ignored in clang-cl: '-MF' [-Wunknown-argument]
clang-cl.exe: error: no such file or directory: 'CMakeFiles/minimal.dir/main.cpp.obj'
clang-cl.exe: error: no such file or directory: 'CMakeFiles\minimal.dir\main.cpp.obj.d'
ninja: build stopped: subcommand failed.
Before this error CMake configured properly except that all compilers ABI info detection failed - but CMake resumed without error. There are some other questions out there which did not help either.
The official documentation states it is quite simple but in fact it is not.
So: How do I build a simple C++ project using CMake with the Ninja generator and Clang as the compiler? I try to avoid the installation of Visual Studio but it would be great if generated binaries are compatible with MSVC build binaries.
Versions:
CMake 3.12.2
Ninja 1.8.2
Clang 7.0.0
Example: Here is the minial example which I am working with:
CMakeLists.txt
cmake_minimum_required(VERSION 3.12)
project(minimal)
add_executable(${PROJECT_NAME} main.cpp)
main.cpp
#include <stdio.h>
int main(void)
{
printf("Hello World!\n");
return 0;
}
To compile with clang-cl, it is necessary to run cmake with MSVC environment loaded (use vcvarsall.bat). Otherwise it tries to use GCC compatibility options.
It is enough to install just the Build Tools.