I am working a project that uses the Discrete Gaussian Image Filter within ITK. I am using CMake to automate the build process but it seems that CMake is leaving out certain ITK libraries during the configuration/generate step. I am currently using other headers in the ITK library without any issue. There are no configuration error messages in CMake for the project.
The CMakeLists.txt for my project:
#PROJECT(REGISTRATION)
#
# List of source files
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
# Top of file: the name of the program
PROJECT(MultiObjModelToUSReg)
INCLUDE_REGULAR_EXPRESSION("^.*$")
FIND_PACKAGE( ITK REQUIRED)
IF( ITK_FOUND )
INCLUDE( ${USE_ITK_FILE} )
ENDIF( ITK_FOUND )
# Directories to search for #include (add more if needed)
# (ITK is already included through the use of INCLUDE(${ITK_USE_FILE})
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}
src
)
# Name of the executable
#SET(MultiObjModelToUSReg MultiObjModelToUSReg_EXE)
# All source files (only .cxx, not .h or .txx)
SET(MultiObjModelToUSReg_SRCS
src/Utilities.cpp
src/MultiObjModel.cpp
src/USVolume.cpp
src/Registration.cpp
src/BoneProbabilityMap.cpp
#src/MultiObjModelToUSRegistration.cpp
#src/USRegistrationDialog.cpp
#src/MainPanel.cpp
#src/ModelRegistration.cxx
)
#only .h files that use QT_ macros!
#SET(MultiObjModelToUSReg_HEADERS
#src/USRegistrationDialog.h
#src/MainPanel.h
#src/ModelRegistration.h)
#SET(MultiObjModelToUSReg_FORMS
##ui/USRegistrationDialog.ui
##ui/MainPanel.ui
#ui/ModelRegistration.ui)
#SET(MultiObjModelToUSReg_RESOURCES)
# These two lines will compile and link your executable
#ADD_EXECUTABLE(MultiObjModelToUSReg
#${MultiObjModelToUSReg_EXE}
#${MultiObjModelToUSReg_SRCS}
#${MultiObjModelToUSReg_HEADERS_MOC}
#${MultiObjModelToUSReg_FORMS_HEADERS}
#${MultiObjModelToUSReg_RESOURCES_RCC}
#)
ADD_LIBRARY(MultiObjModelToUSReg STATIC ${MultiObjModelToUSReg_SRCS})
TARGET_LINK_LIBRARIES(MultiObjModelToUSReg ${ITK_LIBRARIES} )
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
ENABLE_TESTING()
INCLUDE(CTEST)
IF (BUILD_TESTING)
ADD_SUBDIRECTORY (Test)
ENDIF (BUILD_TESTING)
CMake's error-free output:
Check for working C compiler using: Visual Studio 9 2008
Check for working C compiler using: Visual Studio 9 2008 -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler using: Visual Studio 9 2008
Check for working CXX compiler using: Visual Studio 9 2008 -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Configuring done
Generating done
However, when I compile in Visual C++ 2008:
1>------ Build started: Project: MultiObjModelToUSReg, Configuration: Debug Win32 ------
1>Compiling...
1>BoneProbabilityMap.cpp
1>..\src\BoneProbabilityMap.cpp(8) : fatal error C1083: Cannot open include file: 'itkDiscreteGaussianImageFilter.h': No such file or directory
1>Build log was saved at "file://c:\MultiObjModelToUSReg\bin\MultiObjModelToUSReg.dir\Debug\BuildLog.htm"
1>MultiObjModelToUSReg - 1 error(s), 0 warning(s)
2>------ Skipped Build: Project: ALL_BUILD, Configuration: Debug Win32 ------
2>Project not selected to build for this solution configuration
========== Build: 0 succeeded, 1 failed, 12 up-to-date, 1 skipped ==========
While there is a workaround to manually it into the project's configuration, I will need to collaborate with others so it would be ideal to have the build process automated.
Any help would be greatly appreciated! (I am quite new to Stackoverflow, please let me know if I made anything unclear).
You need to build ITK with ITK_BUILD_ALL_MODULES=ON.
Related
I have visual studio 2015 community version on Windows 10. I downloaded Ethereum project on github and tried running
CMake .. -G "Visual Studio 14 2015 ARM"
command but it failed with following message. (The failing step seems to be the installation of Boost through hunter):
-- Selecting Windows SDK version 10.0.15063.0 to target Windows 10.0.16299.
-- The C compiler identification is MSVC 19.0.24215.1
-- The CXX compiler identification is MSVC 19.0.24215.1
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_arm/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_arm/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_arm/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_arm/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test fstack-protector-strong
-- Performing Test fstack-protector-strong - Failed
-- Performing Test Wimplicit-fallthrough
-- Performing Test Wimplicit-fallthrough - Failed
-- [hunter] Calculating Toolchain-SHA1
-- [hunter] Calculating Config-SHA1
-- [hunter] HUNTER_ROOT: C:/.hunter
-- [hunter] [ Hunter-ID: b96750b | Toolchain-ID: bb3d68a | Config-ID: 59ec5bb ]
-- [hunter] BOOST_ROOT: C:/.hunter/_Base/b96750b/bb3d68a/59ec5bb/Install (ver.: 1.64.0)
-- [hunter] Building Boost
loading initial cache file C:/.hunter/_Base/b96750b/bb3d68a/59ec5bb/cache.cmake
loading initial cache file C:/.hunter/_Base/b96750b/bb3d68a/59ec5bb/Build/Boost/args.cmake
-- Selecting Windows SDK version 10.0.15063.0 to target Windows 10.0.16299.
-- The C compiler identification is MSVC 19.0.24215.1
-- The CXX compiler identification is MSVC 19.0.24215.1
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_arm/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_arm/cl.exe -- works
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_arm/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_arm/cl.exe -- works
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: C:/.hunter/_Base/b96750b/bb3d68a/59ec5bb/Build/Boost/Build
Microsoft (R) Build Engine version 14.0.25420.1
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 11/27/2017 11:33:03 AM.
Project "C:\.hunter\_Base\b96750b\bb3d68a\59ec5bb\Build\Boost\Build\ALL_BUILD.vcxproj" on node 1 (default targets).
Project "C:\.hunter\_Base\b96750b\bb3d68a\59ec5bb\Build\Boost\Build\ALL_BUILD.vcxproj" (1) is building "C:\.hunter\_Base\b96750b\bb3d68a\59ec5bb\Build\Boost\Build\ZERO_CHECK.vcxproj" (2) on node 1 (default targets).
PrepareForBuild:
Creating directory "ARM\Debug\ZERO_CHECK\".
Creating directory "ARM\Debug\ZERO_CHECK\ZERO_CHECK.tlog\".
InitializeBuildStatus:
Creating "ARM\Debug\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
CustomBuild:
Checking Build System
CMake does not need to re-run because C:/.hunter/_Base/b96750b/bb3d68a/59ec5bb/Build/Boost/Build/CMakeFiles/generate.stamp is up-to-date.
FinalizeBuildStatus:
Deleting file "ARM\Debug\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild".
Touching "ARM\Debug\ZERO_CHECK\ZERO_CHECK.tlog\ZERO_CHECK.lastbuildstate".
Done Building Project "C:\.hunter\_Base\b96750b\bb3d68a\59ec5bb\Build\Boost\Build\ZERO_CHECK.vcxproj" (default targets).
Project "C:\.hunter\_Base\b96750b\bb3d68a\59ec5bb\Build\Boost\Build\ALL_BUILD.vcxproj" (1) is building "C:\.hunter\_Base\b96750b\bb3d68a\59ec5bb\Build\Boost\Build\Boost.vcxproj" (3) on node 1 (default targets).
PrepareForBuild:
Creating directory "ARM\Debug\Boost\".
Creating directory "ARM\Debug\Boost\Boost.tlog\".
InitializeBuildStatus:
Creating "ARM\Debug\Boost\Boost.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
ComputeCustomBuildOutput:
Creating directory "C:\.hunter\_Base\b96750b\bb3d68a\59ec5bb\Build\Boost\Build\Boost-prefix\src\Boost-stamp\Debug\".
Creating directory "C:\.hunter\_Base\b96750b\bb3d68a\59ec5bb\Build\Boost\Build\CMakeFiles\Debug\".
CustomBuild:
Building Custom Rule C:/.hunter/_Base/b96750b/bb3d68a/59ec5bb/Build/Boost/CMakeLists.txt
CMake does not need to re-run because C:/.hunter/_Base/b96750b/bb3d68a/59ec5bb/Build/Boost/Build/CMakeFiles/generate.stamp is up-to-date.
Creating directories for 'Boost'
Performing download step (download, verify and extract) for 'Boost'
-- Boost download command succeeded. See also C:/.hunter/_Base/b96750b/bb3d68a/59ec5bb/Build/Boost/Build/Boost-prefix/src/Boost-stamp/Boost-download-*.log
No update step for 'Boost'
No patch step for 'Boost'
Performing configure step for 'Boost'
-- Boost configure command succeeded. See also C:/.hunter/_Base/b96750b/bb3d68a/59ec5bb/Build/Boost/Build/Boost-prefix/src/Boost-stamp/Boost-configure-*.log
No build step for 'Boost'
Performing install step for 'Boost'
CMake Error at C:/.hunter/_Base/b96750b/bb3d68a/59ec5bb/Build/Boost/Build/Boost-prefix/src/Boost-stamp/Boost-install-Debug.cmake:16 (message):
Command failed: 1
'C:/Program Files/CMake/bin/cmake.exe' '-Dmake=' '-Dconfig=Debug' '-P' 'C:/.hunter/_Base/b96750b/bb3d68a/59ec5bb/Build/Boost/Build/Boost-prefix/src/Boost-stamp/Boost-install-Debug-impl.cmake'
See also
C:/.hunter/_Base/b96750b/bb3d68a/59ec5bb/Build/Boost/Build/Boost-prefix/src/Boost-stamp/Boost-install-*.log
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code 1. [C:\.hunter\_Base\b96750b\bb3d68a\59ec5bb\Build\Boost\Build\Boost.vcxproj]
Done Building Project "C:\.hunter\_Base\b96750b\bb3d68a\59ec5bb\Build\Boost\Build\Boost.vcxproj" (default targets) -- FAILED.
Done Building Project "C:\.hunter\_Base\b96750b\bb3d68a\59ec5bb\Build\Boost\Build\ALL_BUILD.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\.hunter\_Base\b96750b\bb3d68a\59ec5bb\Build\Boost\Build\ALL_BUILD.vcxproj" (default target) (1) ->
"C:\.hunter\_Base\b96750b\bb3d68a\59ec5bb\Build\Boost\Build\Boost.vcxproj" (default target) (3) ->
(CustomBuild target) ->
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code 1. [C:\.hunter\_Base\b96750b\bb3d68a\59ec5bb\Build\Boost\Build\Boost.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:01:53.05
[hunter ** FATAL ERROR **] Build step failed (dir: C:/.hunter/_Base/b96750b/bb3d68a/59ec5bb/Build/Boost
[hunter ** FATAL ERROR **] [Directory:C:/.hunter/_Base/Download/Hunter/0.19.105/b96750b/Unpacked/cmake/projects/Boost]
------------------------------ WIKI -------------------------------
https://github.com/ruslo/hunter/wiki/error.external.build.failed
-------------------------------------------------------------------
CMake Error at C:/.hunter/_Base/Download/Hunter/0.19.105/b96750b/Unpacked/cmake/modules/hunter_wiki.cmake:12 (message):
Call Stack (most recent call first):
C:/.hunter/_Base/Download/Hunter/0.19.105/b96750b/Unpacked/cmake/modules/hunter_fatal_error.cmake:20 (hunter_wiki)
C:/.hunter/_Base/Download/Hunter/0.19.105/b96750b/Unpacked/cmake/modules/hunter_download.cmake:596 (hunter_fatal_error)
C:/.hunter/_Base/Download/Hunter/0.19.105/b96750b/Unpacked/cmake/projects/Boost/hunter.cmake:272 (hunter_download)
C:/.hunter/_Base/Download/Hunter/0.19.105/b96750b/Unpacked/cmake/modules/hunter_add_package.cmake:53 (include)
CMakeLists.txt:101 (hunter_add_package)
-- Configuring incomplete, errors occurred!
See also "C:/Users/Alan/Documents/Projects/cpp-ethereum/build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Alan/Documents/Projects/cpp-ethereum/build/CMakeFiles/CMakeError.log".
----------------------------Boost-install-err.log-----------------------
CMake Error at C:/.hunter/_Base/b96750b/bb3d68a/59ec5bb/Build/Boost/Build/Boost-prefix/src/Boost-stamp/Boost-install-Debug-impl.cmake:9 (message):
Command failed (The system cannot find the file specified):
'b2' '--layout=tagged' '-d0' 'install' '--without-atomic' '--without-chrono' '--without-container' '--without-context' '--without-coroutine' '--without-coroutine2' '--without-date_time' '--without-exception' '--without-fiber' '--without-filesystem' '--without-graph' '--without-graph_parallel' '--without-iostreams' '--without-locale' '--without-log' '--without-math' '--without-metaparse' '--without-mpi' '--without-program_options' '--without-python' '--without-random' '--without-regex' '--without-serialization' '--without-signals' '--without-system' '--without-test' '--without-thread' '--without-timer' '--without-type_erasure' '--without-wave' '--prefix=C:/.hunter/_Base/b96750b/bb3d68a/59ec5bb/Build/Boost/Install' '--ignore-site-config'
??In Boost-install-err.log, which file the system couldn't find? b2.exe? The folder 'C:/.hunter/_Base/b96750b/bb3d68a/59ec5bb/Build/Boost/Install' only contains a subfolder call 'lib'. Is it suppose to contain 'the' file that the command is looking for?
I try to use MSVC and MSVC_VERSION in toolchain file -
cmake-toolchain-file.cmake
message (STATUS "Toolchain MSVC=${MSVC} MSVC_VERSION=${MSVC_VERSION}")
CMakeLists.txt
message (STATUS "Project MSVC=${MSVC} MSVC_VERSION=${MSVC_VERSION}")
Output is
> cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/cmake-toolchain-file.cmake
-- Toolchain MSVC= MSVC_VERSION=
-- Project MSVC=1 MSVC_VERSION=1800
-- Bulding target for: windows-x86
-- Configuring done
-- Generating done
-- Build files have been written to: D:/test/build
Is it normal behavior that I get MSVC and MSVC_VERSION from toolchain file empty?
Is it normal behavior that I get MSVC and MSVC_VERSION from toolchain file empty?
Yes. Variables initialized after project command. This is where toolchain read also. Try to add some extra messages:
cmake_minimum_required(VERSION 3.0)
message(STATUS "Before project: MSVC(${MSVC})")
project(Foo)
message(STATUS "After project: MSVC(${MSVC})")
Result:
-- Before project: MSVC()
-- Toolchain MSVC()
-- Toolchain MSVC()
...
-- After project: MSVC(1)
-- Configuring done
-- Generating done
So I guess you have one hidden question in mind:
Is it confusing?
Yes, for the Visual Studio generators. Since usually you can set some critical stuff like path to compiler in toolchain it doesn't make sense to read compiler-related variables like CMAKE_CXX_COMPILER_ID before toolchain processed, i.e. before project command. But when you set generator to Visual Studio your compiler is always MSVC. This gives you a hint for the workaround. Just check CMAKE_GENERATOR variable in toolchain instead of MSVC_VERSION (though this will not work for NMake generator of course):
if("${CMAKE_GENERATOR}" STREQUAL "Visual Studio 12 2013")
message("Toolchain: MSVC 1800")
endif()
if("${CMAKE_GENERATOR}" STREQUAL "Visual Studio 9 2008")
message("Toolchain: MSVC 1500")
endif()
I have an error about installation in CGAL in Visual 2012 32bit.
I install Boost and Cmake also configuring and generating a CGAL project successfully.
I rebuild ALL_BUILD, CGAL, Demo, Example.. projects in both Release and Debug, all successed except INSTALL project
I rebuild INSTALL project had problem here:
Error 102 error MSB3073: The command "setlocal
"C:\Program Files\CMake\bin\cmake.exe" -DBUILD_TYPE=Release -P cmake_install.cmake
if %errorlevel% neq 0 goto :cmEnd:cmEnd endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
:cmErrorLevel exit /b %1 :cmDone if %errorlevel% neq 0 goto :VCEnd
:VCEnd" exited with code 1. C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets 134 5 INSTALL
Then, I copy "Hello World" into .cpp file CGAL Project, rebuilded successfully. Iam so excited but when I press Local Window Debug then it said: Unable to start program 'C:(name of project)\bin\Release\CGAL-vc-mt-4.5.dll'
Here CMake said:
The CXX compiler identification is MSVC 17.0.50727.1
The C compiler identification is MSVC 17.0.50727.1
Check for working CXX compiler using: Visual Studio 11 2012
Check for working CXX compiler using: Visual Studio 11 2012 -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Check for working C compiler using: Visual Studio 11 2012
Check for working C compiler using: Visual Studio 11 2012 -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
== Setting paths ==
Build CGAL from release in directory CGAL-4.5
Packagenames: CGAL-4.5
== Setting paths (DONE) ==
== Generate version files ==
CGAL_MAJOR_VERSION=4
CGAL_MINOR_VERSION=5
CGAL_BUGFIX_VERSION=0
CGAL_SONAME_VERSION=10
CGAL_SOVERSION =10.0.4
CGAL_REFERENCE_CACHE_DIR=
Building shared libraries
Targetting Visual Studio 11 2012
Target build enviroment supports auto-linking
Using VC11 compiler.
Generator uses intermediate configuration directory: $(Configuration)
USING CMake version: 3.1.0
System: Windows
CMake Warning (dev) at CMakeLists.txt:437 (if):
Policy CMP0054 is not set: Only interpret if() arguments as variables or
keywords when unquoted. Run "cmake --help-policy CMP0054" for policy
details. Use the cmake_policy command to set the policy and suppress this
warning.
Quoted variables like "MSVC" will no longer be dereferenced when the policy
is set to NEW. Since the policy is not set the OLD behavior will be used.
This warning is for project developers. Use -Wno-dev to suppress it.
== 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:/Program Files/CGAL-4.5/auxiliary/gmp/lib/libgmp-10.lib
GMP has been preconfigured:
UseGMP-file:
GMP include: C:/Program Files/CGAL-4.5/auxiliary/gmp/include
GMP libraries: C:/Program Files/CGAL-4.5/auxiliary/gmp/lib/libgmp-10.lib
GMP definitions:
USING GMP_VERSION = '5.0.1'
Preconfiguring library: MPFR ...
Found MPFR: C:/Program Files/CGAL-4.5/auxiliary/gmp/lib/libmpfr-4.lib
MPFR has been preconfigured:
UseMPFR-file:
MPFR include: C:/Program Files/CGAL-4.5/auxiliary/gmp/include
MPFR libraries: C:/Program Files/CGAL-4.5/auxiliary/gmp/lib/libmpfr-4.lib
MPFR definitions:
USING MPFR_VERSION = '3.0.0'
Boost version: 1.57.0
Found the following Boost libraries:
thread
system
Boost include: C:/boost_1_57_0
Boost libraries: optimized;C:/boost_1_57_0/stage/lib/boost_thread-vc110-mt- 1_57.lib;debug;C:/boost_1_57_0/stage/lib/boost_thread-vc110-mt-gd-1_57.lib;optimized;C:/boost_1_57_0/stage/lib/boost_system-vc110-mt-1_57.lib;debug;C:/boost_1_57_0/stage/lib/boost_system-vc110-mt-gd-1_57.lib
Boost definitions:
USING BOOST_VERSION = '1.57.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
Configuring libCGAL_Qt3
libCGAL_Qt3 needs Qt3, cannot be configured.
Sources for CGAL component library 'CGAL_Qt4' detected
Configuring libCGAL_Qt4
libCGAL_Qt4 needs Qt4, cannot be configured.
Sources for CGAL component libraries 'CGAL_Core;CGAL_ImageIO;CGAL_Qt3;CGAL_Qt4' detected
== Generating build files (DONE) ==
Configuring done
Generating done
I hope you can help me as soon as possible. Thanks you very much.
I was getting exactly same errors. I realized, when I was building QGLViewer via VS 2010 command prompt, it was giving an error for manipulatedFrame.cpp<244>. Error is about variable types.
So in manipulatedFrame.cpp, I changed line 244;
const qreal dist = sqrt(delta.x()*delta.x() + delta.y()*delta.y());
To this line;
const qreal dist = sqrt(((double)(delta.x()))*((double)(delta.x())) + ((double)(delta.y()))*((double)(delta.y())));
And build it again. It seems good now.
I am trying to run a simple program through cmake gui and I receive the following output. I am not really sure what the problem is and forgive me, because I am quite new to this. I have also uninstalled and installed visual studio 2012 and 2013 to see if that would make a difference. I am using Visual Studio 2013 as the compiler and get the following configuration error.
My environment is :
Windows 7 enterprise 64 bit
Cmake gui 2.8.12.2
Visual Studio 2013 Professional
The C compiler identification is MSVC 18.0.21005.1
The CXX compiler identification is MSVC 18.0.21005.1
Check for working C compiler using: Visual Studio 12
Check for working C compiler using: Visual Studio 12 -- broken
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler "C:/Program Files (x86)/Microsoft Visual Studio
12.0/VC/bin/cl.exe" is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/PM&R/Desktop/CMakeFiles/CMakeTmp
Run Build Command:C:\PROGRA~2\MSBuild\12.0\Bin\MSBuild.exe
cmTryCompileExec3676669247.vcxproj /p:Configuration=Debug
/p:VisualStudioVersion=12.0
Microsoft (R) Build Engine version 12.0.21005.1
[Microsoft .NET Framework, version 4.0.30319.18444]
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 3/31/2014 2:27:43 PM.
Project
"C:\Users\PM&R\Desktop\CMakeFiles\CMakeTmp\cmTryCompileExec3676669247.vcxproj"
on node 1 (default targets).
C:\Users\PM&R\Desktop\CMakeFiles\CMakeTmp\cmTryCompileExec3676669247.vcxproj(60,85):
error MSB4025: The project file could not be loaded. An error occurred
while parsing EntityName. Line 60, position 85.
Done Building Project
"C:\Users\PM&R\Desktop\CMakeFiles\CMakeTmp\cmTryCompileExec3676669247.vcxproj"
(default targets) -- FAILED.
Build FAILED.
"C:\Users\PM&R\Desktop\CMakeFiles\CMakeTmp\cmTryCompileExec3676669247.vcxproj"
(default target) (1) ->
C:\Users\PM&R\Desktop\CMakeFiles\CMakeTmp\cmTryCompileExec3676669247.vcxproj(60,85): error MSB4025: The project file could not be loaded. An error occurred while parsing EntityName. Line 60, position 85.
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.02
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:2 (project)
Configuring incomplete, errors occurred!
See also "C:/Users/PM&R/Desktop/CMakeFiles/CMakeOutput.log".
See also "C:/Users/PM&R/Desktop/CMakeFiles/CMakeError.log".
Try to generate build system in the folder C:/Tmp to test if the problem is related to corrupted cache or path issues. To build it to the folder stated in the question:
Check that you do have write permission in "PM&R" personal folders
Remove cmake cache when you change the generator
I have a solution consisting of 3 projects. One is a static library, and two are console-based .exe files that depend on and link against this library. Their settings seem to be identical. I build one of them:
1>------ Build started: Project: masksample, Configuration: Debug Win32 ------
1>Compiling...
1>stdafx.cpp
1>Compiling...
1>masksample.cpp
1>Compiling manifest to resources...
1>Linking...
1>LINK : C:\Users\DarekSz\Praca\cci\Debug\masksample.exe not found or not built by the last incremental link; performing full link
1>Embedding manifest...
1>masksample - 0 error(s), 0 warning(s)
========== Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
Then I go on to building the other:
1>------ Build started: Project: calibsample, Configuration: Debug Win32 ------
1>Compiling...
1>stdafx.cpp
1>Compiling...
1>calibsample.cpp
1>Compiling manifest to resources...
1>Linking...
1>LINK : C:\Users\DarekSz\Praca\cci\Debug\calibsample.exe not found or not built by the last incremental link; performing full link
1> Creating library C:\Users\DarekSz\Praca\cci\Debug\calibsample.lib and object C:\Users\DarekSz\Praca\cci\Debug\calibsample.exp
1>Embedding manifest...
1>calibsample - 0 error(s), 0 warning(s)
========== Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
Why does the linker create the .lib and .exp files this time? Is there some option to turn this on and off that I activated without knowing about it?
It's a bit late but, maybe someone else could find useful this hint.
BTW I'm not a c++ guru...
In my solution i have 3 projects. One is a dll project, the others are two Win32 app projects referencing the dll project.
Usually, with your dll built, you have also some others file generated (.exp, .lib) also for the NON dll projects. This can occour when you include a .h file of the dll project, into the app project, which contains a class marked with __declspec(dllexport).
To avoid the linker think your are trying to include some .h files to "export" use a conditional expression to define your _declspec macro.
Example:
#if defined(_DO_NOT_EXPORT)
#define DllExport
#else
#define DllExport __declspec(dllexport)
#endif
Ok, let's say you have a MyClass.h in your dll project.
in your .h file you could have now:
class DllExport MyClass {
...
}
When you want to include this .h file into a NON dll project, you have simply to define the _DO_NOT_EXPORT condition
#define _DO_NOT_EXPORT
#include "MyClass.h"
This is normal if one or more functions is/are exported from your executable.