Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
206 views
in Technique[技术] by (71.8m points)

windows - Cmake build error for c++

I want to build the bayes optimization program error is

The C compiler identification is GNU 4.9.2
The CXX compiler identification is GNU 4.9.2
Check for working C compiler: C:/MinGW/bin/gcc.exe
CMake Error: Generator: execution of make failed. Make command was: "C:MinGWin" "cmTryCompileExec2576605559/fast"
Check for working C compiler: C:/MinGW/bin/gcc.exe -- broken
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.2/Modules/CMakeTestCCompiler.cmake:61 (message):

The C compiler "C:/MinGW/bin/gcc.exe" is not able to compile a simple test program.

It fails with the following output:

Change Dir: C:/Code-Lite-Test/CMakeFiles/CMakeTmp
Run Build Command:"C:MinGWin" "cmTryCompileExec2576605559/fast"
Access is denied
Generator: execution of make failed.  Make command was: "C:MinGWin"
"cmTryCompileExec2576605559/fast"
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):

I have downloaded source from url https://bitbucket.org/rmcantin/bayesopt/ and i have downloaded the MinGW compiler for Windows when I try to build the program the error is:

Please help me on this I have also deleted the old cache when I try to build the bayes optimization.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You could try to compile a simple C++ program first without CMake. E.g. store a simple main.cpp somewhere in your user directory C:Users<yourname>Temp directory with following content:

int main() 
{
   return 0;
}

Now open CMD window in your C:Users<yourname>Temp directory and run:

C:MinGWingcc.exe main.cpp -o testprog

If an error popup appears that is saying something about a missing .dll, run following command in your CMD window and try to compile again:

set PATH=%PATH%;C:MinGWin

If you had to run the last command, add the C:MinGWin path permanently. After all it should be possible to run CMake with MinGW as compiler.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...