I've been looking for solutions, and honestly I'm stuck.
I'm trying to install Box2D, as you can see by the file paths.
Anyway, this prompt appears several times before the following:
The CXX compiler identification is unknown
Check for working CXX compiler: C:/MinGW/bin/g++.exe
Check for working CXX compiler: C:/MinGW/bin/g++.exe -- broken
CMake Error at C:/Program Files/CMake/share/cmake-3.6/Modules/CMakeTestCXXCompiler.cmake:54 (message):
The C++ compiler "C:/MinGW/bin/g++.exe" is not able to compile a simple
test program.
It fails with the following output:
Change Dir: C:/Users/alexm/Documents/Box2D/Build/CMakeFiles/CMakeTmp
Run Build Command:"C:/MinGW/bin/mingw32-make.exe" "cmTC_31089/fast"
C:/MinGW/bin/mingw32-make.exe -f CMakeFiles\cmTC_31089.dir\build.make
CMakeFiles/cmTC_31089.dir/build
mingw32-make.exe[1]: Entering directory
'C:/Users/alexm/Documents/Box2D/Build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_31089.dir/testCXXCompiler.cxx.obj
C:\MinGW\bin\g++.exe -o CMakeFiles\cmTC_31089.dir\testCXXCompiler.cxx.obj
-c
C:\Users\alexm\Documents\Box2D\Build\CMakeFiles\CMakeTmp\testCXXCompiler.cxx
CMakeFiles\cmTC_31089.dir\build.make:64: recipe for target
'CMakeFiles/cmTC_31089.dir/testCXXCompiler.cxx.obj' failed
mingw32-make.exe[1]: ***
[CMakeFiles/cmTC_31089.dir/testCXXCompiler.cxx.obj] Error 1
mingw32-make.exe[1]: Leaving directory
'C:/Users/alexm/Documents/Box2D/Build/CMakeFiles/CMakeTmp'
Makefile:125: recipe for target 'cmTC_31089/fast' failed
mingw32-make.exe: *** [cmTC_31089/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:3 (project)
Configuring incomplete, errors occurred!
See also "C:/Users/alexm/Documents/Box2D/Build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/alexm/Documents/Box2D/Build/CMakeFiles/CMakeError.log".
So, there's the error. I'm trying to install it on code::blocks with MinGW, I've currently got 2 copies of MinGW installed, one that's located in the code::blocks folder and the other is in my root drive, I installed MinGW seperately to fix this problem.
This is my first time using CMake, I'm trying to get it to work with my sfml project on code::blocks in C++.
Apologies if I missed anything, if you spot any information you'd need don't hesitate to comment!
Go to system variables and add
C:\Program Files (x86)\CodeBlocks\MinGW\bin
to your path
You download libintl-8.dll and copy to C:\MinGW\bin:
https://www.dll-files.com/libintl-8.dll.html
It worked for me.
You should run Cmake as admin. I had the same problem, worked for me
I had the same problem and I tried every solution proposed below and did not work for me then I realized that CMake uses C:\Program Files (x86)\CodeBlocks\MinGW\mingw32\bin instead of C:\Program Files (x86)\CodeBlocks\MinGW\bin so I copied the "dll" files to that folder. If that does not work for you try adding C:\Program Files (x86)\CodeBlocks\MinGW\mingw32\bin to your path.
I had the same problem.
I was runing cmake with compability to win 7,
when I untick it, it started work.
Related
I'm trying to use cmake build an empty project of mine over the command line.
My project has this barebones file structure
-Project
-Build
-CMakeLists.txt (empty file)
-main.cpp (contains hello world and nothing else)
I'm running the command "cmake .." in the build folder of the project
However I'm getting this error...
CMake Warning (dev) in CMakeLists.txt:
No project() command is present. The top-level CMakeLists.txt file must
contain a literal, direct call to the project() command. Add a line of
code such as
project(ProjectName)
near the top of the file, but after cmake_minimum_required().
CMake is pretending there is a "project(Project)" command on the first
line.
This warning is for project developers. Use -Wno-dev to suppress it.
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19043.
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error in CMakeLists.txt:
No CMAKE_C_COMPILER could be found.
CMake Error in CMakeLists.txt:
No CMAKE_CXX_COMPILER could be found.
I have all the required visual studio modules installed, also when I try to configure the same cmake project through the GUI I don't have the same problem and can open the project through visual studio.
I've figured out the issue, installing cmake before installing VS is the main cause of this problem. Uninstalling cmake, reinstalling and then restarting your pc seems to fix the issue.
I am very new (my first time) to installing software through command lines and source files and C++. So the solution could be quite simple but I just simply don't understand it.
My objective here is to install the GODDeSS-Package following these instructions.
I am currently under the section "How to install the example simulation" and I am stuck on the final step (step 8). To my knowledge, I believe I have installed all the prerequisite software correctly listed from steps 1-3.
Following the procedures when I arrive at step 8, I execute the following command and receive this error:
$cmake C:/Users/Patrick/Desktop/Research/GODDeSS-Package/goddess-package/GODDeSS_4_3/source
...
Could NOT find Boost (missing: regex) (found version "1.59.0")
...
I used the ellipse to show there is text before and after that error message. However this is not the main problem. I was able to over come this with a add-on argument (which I don't really understand how it works) -DBoost_USE_STATIC_LIBS=ON
So after this modification, I get the following results:
$cmake C:/Users/Patrick/Desktop/Research/GODDeSS-Package/goddess-package/GODDeSS_4_3/source -DBoost_USE_STATIC_LIBS=ON
...
-- Generating done
-- Build files have been written to: C:/Users/Patrick/Desktop/Research/GODDeSS-Package/goddess-build
So I assume part 1 of step 8 done correctly? ...since it says "Generating done".
Now here is where I run into the problem. the next command is:
$make -j install
But I don't have a Makefile in the generated files!
Here is a picture of my build directory which I have generated the files into:
Build Directory Picture
I have done some reading and it seems like cmake is Building for Visual Studios 16 2019 so it creates the .sln files instead (theres alot of them! Almost one in every folder). I'm not entire sure how to deal with this situation. Instead I tried to force cmake to generate me a Makefile by using the add-on command -G "MinGW Makefiles" I picked MinGW randomly just because it was one of the few options that generated a Makefile.
So I created a fresh build directory and used the following command:
cmake -G "MinGW Makefiles" C:/Users/Patrick/Desktop/James_L_Pinfold_Research/GODDeSS-Package/goddess-package/GODDeSS_4_3/source -DBoost_USE_STATIC_LIBS=ON
But I get the following error:
CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
So now I'm stuck... I see 2 paths I can go down. 1. Make use of the .sln files created by cmake to install the package... or 2. Somehow make cmake create a Makefile so I can use the make command. Neither of which how to do.
I'm having a hard time trying to find documentations of how to install this package but I have yet to succeed. What can I try next?
I am using Windows 10, Terminal: Git Bash, Visual Studios 2019, Boost_1_5_9, zlib1211, geant4_10_02_p03, and cmake-3.17.2
I generated VTK 8.1.1 VS2015 solution by CMake, and when I build 'ALL_BUILD' project, it works well.
but when I try building 'INSTALL' project, the error followed occurs:
-- Installing: C:/Program Files/VTK/share/doc/vtk-8.1/doxygen/doc_index.stop
2> -- Installing: C:/Program Files/VTK/share/doc/vtk-8.1/doxygen/doc_readme.txt
2> CMake Error at Utilities/Doxygen/cmake_install.cmake:60 (file):
2> file INSTALL cannot find
2> "C:/workspace/VTK_build/Utilities/Doxygen/doc/html".
2> Call Stack (most recent call first):
2> cmake_install.cmake:226 (include)
2>
I do run vs2015 as administrator.
and I have checked that there doesn't have a folder called doc under 'Doxygen' indeed.
please tell me why does this error happen? did I config something wrong?
and what should I do now?
update 1 :
I delete the sentence in file 'cmake_install.cmake' that uses /Doxygen/doc/html.
It is compiled successfully, but I don't know if there would have some thing wrong in the future.
update 2 :
The problem is solved. It just need to build DoxygenDoc separately and /Doxygen/doc/ and some other files will be generated. For more details please see comments below.
The problem is that the documentation has not been build as its target DoxygenDoc is not part off the ALL_BUILD target (which makes sense as you don't want always rebuild the documentation during the development).
Building the documentation creates the required directories and makes it possible to install the documentation.
Note also that the BUILD_DOCUMENTATION in CMake has to be set to be able to build the documentation.
I've downloaded the cpp-netlib source, extracted it to a folder and for some reason I'm completely lost. I read the documentation carefully, it states I have to download CMake as well, which I did. Then I set the source directory and build directories, and upon clicking the "Generate" button I got this output:
The CXX compiler identification is MSVC 19.0.23506.0
Check for working C compiler using: Visual Studio 14 2015
Check for working C compiler using: Visual Studio 14 2015 -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler using: Visual Studio 14 2015
Check for working CXX compiler using: Visual Studio 14 2015 -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.5/Modules/FindBoost.cmake:1657 (message):
Unable to find the requested Boost libraries.
Unable to find the Boost header files. Please set BOOST_ROOT to the root
directory containing Boost or BOOST_INCLUDEDIR to the directory containing
Boost's headers.
Call Stack (most recent call first):
CMakeLists.txt:49 (find_package)
Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_LIBRARIES OPENSSL_INCLUDE_DIR)
Looking for pthread.h
Looking for pthread.h - not found
Found Threads: TRUE
CMake Error at CMakeLists.txt:131 (export):
export given target "cppnetlib-client-connections" which is not built by
this project.
Configuring incomplete, errors occurred!
See also "C:/Users/Nick/Documents/cpp-netlib/cpp-netlib-build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Nick/Documents/cpp-netlib/cpp-netlib-build/CMakeFiles/CMakeError.log"
It couldn't find the Boost libraries, and that's where I'm stuck. I installed boost, but I have no idea where to set "BOOST_ROOT". I did some research on that, tried to use the command line with the -DBOOST_ROOT option like so:
c:\Program Files>cmake -DBOOST_ROOT=/boost/boost_1_55_0
But it gives me the following error:
CMake Error: The source directory "C:/Program Files" does not appear to contain
CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
I'm really unsure as to what to do now and I feel this isn't the end of my problems... Is there anything obvious I'm missing?
You need to either run cmake from the source tree (which would contain CMakeLists.txt), or, more typically, run it from a build folder and tell it where the source tree is.
A common case would be creating a build folder next to the source tree and running cmake ../sourcedir.
You seem to have initially been using a gui; surely that provides a means to set the BOOST_ROOT variable?
Alternatively, if you just put boost in the VC++ include/lib paths (either in the vc dirs, or by setting %INCLUDE%/%LIB%), you probably would not need BOOST_ROOT. Same for OpenSSL.
I'm completely at a loss here.
I have a C++ project that uses CMake. It used to work, but recently some weird problems came up, so I decided to reinstall the Qt SDK and CMake. However, now I get the following error when trying to build a file:
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler "C:/Qt/Qt5.0.1/Tools/MinGW/bin/gcc.exe" is not able to
compile a simple test program.
It fails with the following output:
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:1 (project)
CMake Error: your C compiler: "C:/Qt/Qt5.0.1/Tools/MinGW/bin/gcc.exe" was not found. Please set CMAKE_C_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "C:/Qt/Qt5.0.1/Tools/MinGW/bin/g++.exe" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: Internal CMake error, TryCompile configure of cmake failed
CMake Error: your C compiler: "C:/Qt/Qt5.0.1/Tools/MinGW/bin/gcc.exe" was not found. Please set CMAKE_C_COMPILER to a valid compiler path or name.-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Check for working C compiler: C:/Qt/Qt5.0.1/Tools/MinGW/bin/gcc.exe
-- Check for working C compiler: C:/Qt/Qt5.0.1/Tools/MinGW/bin/gcc.exe -- broken
-- Configuring incomplete, errors occurred!
This completely boggles my mind. MinGW is located in C:/Qt/Qt5.0.2/Tools/, not Qt5.0.1. I tell it so in the CMakeLists.txt file:
SET(CMAKE_C_COMPILER C:/Qt/Qt5.0.2/Tools/MinGW/bin/gcc)
SET(CMAKE_CXX_COMPILER C:/Qt/Qt5.0.2/Tools/MinGW/bing++)
I even added C:/Qt/Qt5.0.2/Tools/MinGW/bin/ to the global PATH variable, but this hasn't helped any. CMake keeps thinking it should be in Qt5.0.1 -- a folder that doesn't exist.
Does anybody know what option I might be overlooking? I've tried just about everything.
I also had the "not able to compile a simple test program"-issue (Qt Creator, CMake). The reason in my case was that the path to CMake contained forbidden characters: neither spaces nor parentheses are apparently allowed. Uninstalling CMake and reinstalling it under \ProgramFilesx86\CMake fixed the issue for me.
I have problem same as you and I found the answer for this. It seem be like mingw of Qt has bug so you will get the error like "gcc is broken". Reinstall mingw at http://www.mingw.org/ and link gcc.exe, g++.exe from C:\MingW\Bin\ to your CMake. Build it again and see.
Good luck!