I am newbie in using C++ and I have hard times to compile the io2d with CMake. I am currently using Windows, and I have used vcpkg to download the io2d packages, cairo packages and graphicsmagick packages. Everything are downloaded by both x64 and x86 windows.
The way I follow through on the installation work is from the Buildings Steps in Cairo/Win32 on Windows:
https://github.com/cpp-io2d/P0267_RefImpl/blob/master/BUILDING.md
However, when I build with cmake -G "Visual Studio 16 2019" --config Debug "-DCMAKE_BUILD_TYPE=Debug" "-DCMAKE_TOOLCHAIN_FILE=c:/source/vcpkg/scripts/buildsystems/vcpkg.cmake" "-DVCPKG_TARGET_TRIPLET=x64-windows" ..\. , it appears the following error. And I have looked for online but seems cannot find a solution with windows system.
Happy to get any opinions and help on this issue.
PS C:\Users\samue\OneDrive\桌面\Udacity\CppND-Route-Planning-Project\P0267_RefImpl\Debug> cmake -G "Visual Studio 16 2019" --config Debug "-DCMAKE_BUILD_TYPE=Debug" "-DCMAKE_TOOLCHAIN_FILE=c:/source/vcpkg/scripts/buildsystems/vcpkg.cmake" "-DVCPKG_TARGET_TRIPLET=x64-windows" ..\.
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.18363.
Default IO2D backend was not specified, choosing automatically...
Found Windows, using CAIRO_WIN32.
CMake Error at C:/Program Files/CMake/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:218 (message):
Could NOT find Cairo (missing: CAIRO_INCLUDE_DIRS CAIRO_LIBRARIES)
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:577 (_FPHSA_FAILURE_MESSAGE)
cmake/FindCairo.cmake:102 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
P0267_RefImpl/P0267_RefImpl/cairo/CMakeLists.txt:5 (find_package)
-- Configuring incomplete, errors occurred!
I have tried another way to compile, but also does not work which yield to another problem. The location of my entire project folder is in the following address: C:\Users\samue\OneDrive\桌面\Udacity\CppND-Route-Planning-Project.
When I tried to build the project, firstly I cd to the address above.
Then use mkdir build and cd build
Then run cmake ..
But, it appears the error code in finding the io2d configuration files. I have no idea how to let CMake to find the required files. The error is located as belows:
PS C:\Users\samue\OneDrive\桌面\Udacity\CppND-Route-Planning-Project\build> cmake ..
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.18363.
CMake Error at C:/source/vcpkg/scripts/buildsystems/vcpkg.cmake:622 (_find_package):
By not providing "Findio2d.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "io2d", but
CMake did not find one.
Could not find a package configuration file provided by "io2d" with any of
the following names:
io2dConfig.cmake
io2d-config.cmake
Add the installation prefix of "io2d" to CMAKE_PREFIX_PATH or set
"io2d_DIR" to a directory containing one of the above files. If "io2d"
provides a separate development package or SDK, be sure it has been
installed.
Call Stack (most recent call first):
CMakeLists.txt:15 (find_package)
-- Configuring incomplete, errors occurred!
When i try to build the opencv package in python using command line
PS C:\Program Files\Open_CV\opencv-python> python setup.py build
It throws an error:
Version: 4.3.0+3073e9e
setup.py:85: DeprecationWarning: SO is deprecated, use EXT_SUFFIX
['python/cv2[^/]*%(ext)s' % {'ext': re.escape(sysconfig.get_config_var('SO'))}],
Trying "Visual Studio 14 Win64" generator
Not searching for unused variables given on the command line.
Selecting Windows SDK version to target Windows 10.0.18363.
CMake Error at CMakeLists.txt:2 (PROJECT):
Failed to run MSBuild command:
MSBuild.exe
to get the value of VCTargetsPath:
The system cannot find the file specified
Configuring incomplete, errors occurred!
See also "C:/Program Files/Open_CV/opencv-python/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
Trying "Visual Studio 14 Win64" generator - failure
scikit-build could not get a working generator for your system. Aborting build.
Building windows wheels for Python 3.8 requires Microsoft Visual Studio 2017.
Get it with "Visual Studio 2017":
https://visualstudio.microsoft.com/vs/
They don't automatically detect VS2019 yet. You have to specify the generator.
python setup.py build -G "Visual Studio 16 2019"
I am trying to build something with CMake (it has to be an older version because of the project) and when I run it I get this error:
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.4/Modules/FindCUDA.cmake:617 (message):
Specify CUDA_TOOLKIT_ROOT_DIR
Call Stack (most recent call first):
libethash-cuda/CMakeLists.txt:3 (FIND_PACKAGE)
I have looked everywhere online but I only find solutions for Linux.
So, my CMake (v3.7.0) found the toolkit automatically. It's located in:
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0
In general, I've found on Windows it has difficulty finding the SDK which is in:
C:\ProgramData\NVIDIA Corporation\CUDA Samples\v8.0
To set CUDA_TOOLKIT_ROOT_DIR in CMake on windows, open up cmake-gui, run "configure" once then go to "advanced:"
Scroll down until you see CUDA_TOOLKIT_ROOT_DIR:
And set it to your CUDA toolkit directory (which is probably C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0 if you're using CUDA version 8.0)
git clone —recursive https://github.com/Danko-Lab/Rgtsvm.git
cd Rgtsvm
git submodule init
git submodule update
mkdir build
cd build
cmake .. -G”Visual Studio 15 2017 Win64" -DCUDA_TOOLKIT_ROOT_DIR="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/lib/x64" -DUSE_CUDA=ON -DLIBR_EXECUTABLE=”C:/Program Files/Microsoft SQL Server/140/R_SERVER/bin/R.exe” -DR_LIB=ON -DGPU_COMPUTE_VER=52
cmake --build . --target install --config Release
does it for Win10, where
-G”Visual Studio 15 2017 Win64" what your VS version is
-DCUDA_TOOLKIT_ROOT_DIR="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/lib/x64" where your CUDA version is installed
-DGPU_COMPUTE_VER=52 choose your GPU architecture
Can you specify from a batch file or edit a file under the cmake installation??
I want to use msbuild.exe without visual studio IDE but I get this error:
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:6 (project):
No CMAKE_C_COMPILER could be found.
CMake Error at CMakeLists.txt:6 (project):
No CMAKE_CXX_COMPILER could be found.
I figure it's looking for msbuild.exe under an installation of the IDE but can't find it because there is no IDE.
1) Am I correct in thinking that?
I want to specify the compiler, but it can't be through a cmakeList.txt and I can't change what's already set up in cmake.
2) can you install msbuild 2013 instead of vs2013 and still use cmake where GENERATOR="Visual Studio 12 vs2013 Win64"
3) if so, can you specify where msbuild is from a batch file or edit a file under the cmake installation?
using msbuild 2013 and generator is set from a batch file like this where vc_ver is 12 and vs_version is 2013:
set GENERATOR="Visual Studio %VC_VER% %VS_VERSION% Win64"
We are having trouble compiling a project using CMake (v2.8.12) under Windows 7 64Bit using Visual Studio 2012. CMake gives us the following errors. We already tried starting Cmake from the Visual Studio Command Line using admin rights. There seems to have been a similar bug in CMake 2.8.11: http://www.cmake.org/Bug/view.php?id=14440
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:446 (execute_process):
execute_process given COMMAND argument with no value.
Call Stack (most recent call first):
C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:48 (CMAKE_DETERMINE_COMPILER_ID_VENDOR)
C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineCCompiler.cmake:131 (CMAKE_DETERMINE_COMPILER_ID)
CMakeLists.txt:2 (project)
The C compiler identification is unknown
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:446 (execute_process):
execute_process given COMMAND argument with no value.
Call Stack (most recent call first):
C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:48 (CMAKE_DETERMINE_COMPILER_ID_VENDOR)
C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineCXXCompiler.cmake:127 (CMAKE_DETERMINE_COMPILER_ID)
CMakeLists.txt:2 (project)
The CXX compiler identification is unknown
Could NOT find SWIG (missing: SWIG_EXECUTABLE SWIG_DIR)
CMake Warning at src/CMakeLists.txt:44 (message):
SWIG was not found. You will not be able to compile for C#.
Configuring incomplete, errors occurred!
See also "C:/Users/hci/laser_control/CMakeFiles/CMakeOutput.log".
See also "C:/Users/hci/laser_control/CMakeFiles/CMakeError.log".
I had the same issue and fixed it running cmake as Admin
Those error messages
The C compiler identification is unknown
The CXX compiler identification is unknown
means CMake did find or assume a compiler but it wasn't able to compile a simple test program.
Take a look at CMakeFiles\CMakeError.log and check the error message there to see:
which compiler path/command line CMake did use
what the error message calling the compiler was
e.g. LINK : fatal error LNK1181: cannot open input file 'kernel32.lib'
If you add --debug-trycompile to the cmake call CMake will even keep the files it has tried to test compile (so you can copy/paste/re-run the command line from the error log in your cmd shell).
The last time I had this problem ...
The last time I had this problem was when my Visual Studio 2012 Professional standard installation did not install any Windows SDK (the error log was showing an missing SDK header).
To verify your SDK installation e.g. check that you have any Resource Compiler installed. It should be in a path similar to:
C:\Program Files (x86)\Microsoft SDKs\Windows\v[some version]\bin\RC.Exe
Since I was missing this - or more accurate any SDK - I installed Windows 8.1 SDK (since Visual Studio 2012 does target Windows 8.x) and voila my CMake was able again to compile the (test) programs.
Reference
Does Visual Studio 2012 include the full Windows SDK
CMake Error at CMakeLists.txt:30 (project): No CMAKE_C_COMPILER could be found
I was getting the terminal output:
The C compiler identification is unknown
The CXX compiler identification is unknown
I checked the CMakeError.log output:
\build\CMakeFiles\CMakeError.log
It showed the error:
warning MSB8003: The WindowsSDKDir property is not defined. Some build tools may not be found.
Going back to visual Studio I needed to install the Windows 10 SDK:
After installing the SDK and running cmake it showed:
Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.18363.
The C compiler identification is MSVC 19.28.29334.0
The CXX compiler identification is MSVC 19.28.29334.0
And built successfully!
I had similar problem also, if you are using Microsoft Visual Studio 2012, that might be because of update of KB2781514 is missing.
After I installed following update, CMake start to detect Visual Studio 2012 c/c++ compilers correctly.
http://www.microsoft.com/en-us/download/details.aspx?id=36020
I faced the same problem. Building and running a project from Visual Studio didn't work for me. However following worked for me:
Open command prompt for developers from Visual Studio tools.
Goto the directory where cmake.exe is present.
Run it.
Lets hope it works for you as well.
For some reason, deleting the build folder in my machine, solved the issue.
cmake:
The cmake assume that you set g++ compiler path accurately.In case due any reason if it did't find compiler path{/usr/bin/g++} then it throw an error like:
**The CXX compiler identification is unknown**
So given step will short out this error:
Locate your compiler CXX path{for g++ path under Linux is :/usr/bin/g++}
Set the Compiler Path and export it configuration: PATH=/usr/bin:$PATH;export PATH
Export compiler like : export CXX=/usr/bin/g++-7
Here we assume that g++,cmake,build-essential install in your Linux system...!!
Same problem here with cmake 2.8.12 and visual studio 10. Cmake may not be able to find the compiler. I solved the problem by uninstalling latest version and installed cmake 2.8.10.
I just encounter with this issue, after I uninstalled some MS software.
I fixed it by repair visual studio 2012.
First go to [Control panel], then select visual studio and repair it,things will go right now.
Make sure you select the proper version of visual Studio.
For example, Visual Studio 2012 is version 11.
I had the same problem and I had to use the "File -> Delete Cache", since I accidentally configured CMake to use wrong visual studio version.
If you use CMake 3.4.0, try upgrading to a newer version. A bug concerning this was fixed relatively recently (see the bug report).
Make sure that you have installed Clang tools
open tools -> Get tools and features, select individual components, search cmake, then uninstall cmake and then re-install cmake, when complete, restart your computer.
I was seeing this on ubuntu - issue was cmake was assuming clang++ as c compiler.
CMake Error at /usr/share/cmake-3.10/Modules/CMakeTestCCompiler.cmake:52 (message):
The C compiler
"/usr/bin/clang++-9"
To fix it, export C, C++ compiler paths:
export CC=/usr/bin/clang
export CXX=/usr/bin/clang++