一个月前,我用cmake 3.9.6在debian挤压机上安装了cmake,效果很好。
现在,我正在另一台挤压机上安装cmake,但当我安装时,它不工作
./configure
.
上面写着:
------------------------------------------------------------------------------------------
CMake 3.10.1, Copyright 2000-2017 Kitware, Inc. and Contributors
Found GNU toolchain
C compiler on this system is: gcc
---------------------------------------------
Error when bootstrapping CMake:
Cannot find a C++ compiler supporting C++11 on this system.
Please specify one using environment variable CXX.
See cmake_bootstrap.log for compilers attempted.
---------------------------------------------
Log of errors: /home/doom/things/cmake-3.10.1/Bootstrap.cmk/cmake_bootstrap.log
---------------------------------------------
以及日志:
Checking for GNU toolchain
Try: gcc
Line: gcc cmake_bootstrap_28642_test.c -o cmake_bootstrap_28642_test
---------- file -----------------------
int main() { return 0; }
------------------------------------------
Test succeeded
Try: g++
Line: g++ cmake_bootstrap_28642_test.cpp -o cmake_bootstrap_28642_test
---------- file -----------------------
int main() { return 0; }
------------------------------------------
Test succeeded
Checking whether 'gcc ' works.
Try: gcc
Line: gcc cmake_bootstrap_28642_test.c -o cmake_bootstrap_28642_test
---------- file -----------------------
int main(int argc, char* argv[])
{
printf("%d%c", (argv != 0), (char)0x0a);
return argc - 1;
}
------------------------------------------
1
Test succeeded
Checking whether 'g++ ' works.
Try: g++
Line: g++ cmake_bootstrap_28642_test.cxx -o cmake_bootstrap_28642_test
---------- file -----------------------
class Class
{
public:
int Get() const { return this->Member; }
private:
int Member = 1;
};
int main()
{
auto const c = std::unique_ptr<Class>(new Class);
std::cout << c->Get() << std::endl;
return 0;
}
------------------------------------------
In file included from /usr/include/c++/4.4/unordered_map:35,
from cmake_bootstrap_28642_test.cxx:4:
/usr/include/c++/4.4/c++0x_warning.h:31:2: error:
cmake_bootstrap_28642_test.cxx:7:2: error:
cmake_bootstrap_28642_test.cxx:19: error: ISO C++ forbids initialization of member âMemberâ
cmake_bootstrap_28642_test.cxx:19: error: making âMemberâ static
cmake_bootstrap_28642_test.cxx:19: error: ISO C++ forbids in-class initialization of non-const static member âMemberâ
cmake_bootstrap_28642_test.cxx: In function âint main()â:
cmake_bootstrap_28642_test.cxx:23: error: ISO C++ forbids declaration of âcâ with no type
cmake_bootstrap_28642_test.cxx:23: error: âunique_ptrâ is not a member of âstdâ
cmake_bootstrap_28642_test.cxx:23: error: expected primary-expression before â>â token
cmake_bootstrap_28642_test.cxx:24: error: base operand of â->â is not a pointer
Test failed to compile
Checking whether 'g++ -std=gnu++1z' works.
Try: g++
Line: g++ -std=gnu++1z cmake_bootstrap_28642_test.cxx -o cmake_bootstrap_28642_test
---------- file -----------------------
class Class
{
public:
int Get() const { return this->Member; }
private:
int Member = 1;
};
int main()
{
auto const c = std::unique_ptr<Class>(new Class);
std::cout << c->Get() << std::endl;
return 0;
}
------------------------------------------
cc1plus: error: unrecognized command line option "-std=gnu++1z"
Test failed to compile
Checking whether 'g++ ' works.
Try: g++
Line: g++ cmake_bootstrap_28642_test.cxx -o cmake_bootstrap_28642_test
---------- file -----------------------
class Class
{
public:
int Get() const { return this->Member; }
private:
int Member = 1;
};
int main()
{
auto const c = std::unique_ptr<Class>(new Class);
std::cout << c->Get() << std::endl;
return 0;
}
------------------------------------------
In file included from /usr/include/c++/4.4/unordered_map:35,
from cmake_bootstrap_28642_test.cxx:4:
/usr/include/c++/4.4/c++0x_warning.h:31:2: error:
cmake_bootstrap_28642_test.cxx:7:2: error:
cmake_bootstrap_28642_test.cxx:19: error: ISO C++ forbids initialization of member âMemberâ
cmake_bootstrap_28642_test.cxx:19: error: making âMemberâ static
cmake_bootstrap_28642_test.cxx:19: error: ISO C++ forbids in-class initialization of non-const static member âMemberâ
cmake_bootstrap_28642_test.cxx: In function âint main()â:
cmake_bootstrap_28642_test.cxx:23: error: ISO C++ forbids declaration of âcâ with no type
cmake_bootstrap_28642_test.cxx:23: error: âunique_ptrâ is not a member of âstdâ
cmake_bootstrap_28642_test.cxx:23: error: expected primary-expression before â>â token
cmake_bootstrap_28642_test.cxx:24: error: base operand of â->â is not a pointer
Test failed to compile
Checking whether 'g++ -std=gnu++14' works.
Try: g++
Line: g++ -std=gnu++14 cmake_bootstrap_28642_test.cxx -o cmake_bootstrap_28642_test
---------- file -----------------------
class Class
{
public:
int Get() const { return this->Member; }
private:
int Member = 1;
};
int main()
{
auto const c = std::unique_ptr<Class>(new Class);
std::cout << c->Get() << std::endl;
return 0;
}
------------------------------------------
cc1plus: error: unrecognized command line option "-std=gnu++14"
Test failed to compile
Checking whether 'g++ -std=gnu++1y' works.
Try: g++
Line: g++ -std=gnu++1y cmake_bootstrap_28642_test.cxx -o cmake_bootstrap_28642_test
---------- file -----------------------
class Class
{
public:
int Get() const { return this->Member; }
private:
int Member = 1;
};
int main()
{
auto const c = std::unique_ptr<Class>(new Class);
std::cout << c->Get() << std::endl;
return 0;
}
------------------------------------------
cc1plus: error: unrecognized command line option "-std=gnu++1y"
Test failed to compile
Checking whether 'g++ ' works.
Try: g++
Line: g++ cmake_bootstrap_28642_test.cxx -o cmake_bootstrap_28642_test
---------- file -----------------------
class Class
{
public:
int Get() const { return this->Member; }
private:
int Member = 1;
};
int main()
{
auto const c = std::unique_ptr<Class>(new Class);
std::cout << c->Get() << std::endl;
return 0;
}
------------------------------------------
In file included from /usr/include/c++/4.4/unordered_map:35,
from cmake_bootstrap_28642_test.cxx:4:
/usr/include/c++/4.4/c++0x_warning.h:31:2: error:
cmake_bootstrap_28642_test.cxx:7:2: error:
cmake_bootstrap_28642_test.cxx:19: error: ISO C++ forbids initialization of member âMemberâ
cmake_bootstrap_28642_test.cxx:19: error: making âMemberâ static
cmake_bootstrap_28642_test.cxx:19: error: ISO C++ forbids in-class initialization of non-const static member âMemberâ
cmake_bootstrap_28642_test.cxx: In function âint main()â:
cmake_bootstrap_28642_test.cxx:23: error: ISO C++ forbids declaration of âcâ with no type
cmake_bootstrap_28642_test.cxx:23: error: âunique_ptrâ is not a member of âstdâ
cmake_bootstrap_28642_test.cxx:23: error: expected primary-expression before â>â token
cmake_bootstrap_28642_test.cxx:24: error: base operand of â->â is not a pointer
Test failed to compile
Checking whether 'g++ -std=gnu++11' works.
Try: g++
Line: g++ -std=gnu++11 cmake_bootstrap_28642_test.cxx -o cmake_bootstrap_28642_test
---------- file -----------------------
class Class
{
public:
int Get() const { return this->Member; }
private:
int Member = 1;
};
int main()
{
auto const c = std::unique_ptr<Class>(new Class);
std::cout << c->Get() << std::endl;
return 0;
}
------------------------------------------
cc1plus: error: unrecognized command line option "-std=gnu++11"
Test failed to compile
Checking whether 'g++ -std=gnu++0x' works.
Try: g++
Line: g++ -std=gnu++0x cmake_bootstrap_28642_test.cxx -o cmake_bootstrap_28642_test
---------- file -----------------------
class Class
{
public:
int Get() const { return this->Member; }
private:
int Member = 1;
};
int main()
{
auto const c = std::unique_ptr<Class>(new Class);
std::cout << c->Get() << std::endl;
return 0;
}
------------------------------------------
cmake_bootstrap_28642_test.cxx:7:2: error:
cmake_bootstrap_28642_test.cxx:19: error: ISO C++ forbids initialization of member âMemberâ
cmake_bootstrap_28642_test.cxx:19: error: making âMemberâ static
cmake_bootstrap_28642_test.cxx:19: error: ISO C++ forbids in-class initialization of non-const static member âMemberâ
Test failed to compile
但它与cmake 3.9.6在同一台机器上运行良好。
g++版本为
gcc version 4.4.5 (Debian 4.4.5-8)
.
“我的镜子”上提供的最新版本。
这真的是g++版本的问题还是cmake新版本的问题?
如有必要,
How can I install g++ compiler from sources?
谢谢你的回答。