Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/132.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 如何编译c++;使用std::bind的程序?_C++_G++_Debian - Fatal编程技术网

C++ 如何编译c++;使用std::bind的程序?

C++ 如何编译c++;使用std::bind的程序?,c++,g++,debian,C++,G++,Debian,我想从以下位置编译这个简单的test.cpp程序: 我得到一个错误: error: no match for call to ‘(std::_Bind<void (*(std::_Placeholder<1>, int)) (int, int)>) (int)’ 错误:对“(std::_Bind)(int)”的调用不匹配 为什么程序不编译 我也无法从中编译示例程序。std::bind是C++11,g++4.4不支持它。您需要通过系统升级或使用/etc/apt/pref

我想从以下位置编译这个简单的test.cpp程序:

我得到一个错误:

error: no match for call to ‘(std::_Bind<void (*(std::_Placeholder<1>, int))
(int, int)>) (int)’
错误:对“(std::_Bind)(int)”的调用不匹配
为什么程序不编译


我也无法从中编译示例程序。

std::bind
是C++11,g++4.4不支持它。您需要通过系统升级或使用/etc/apt/preferences包绑定升级到Debian Wheezy的g++4.7

std::bind
是C++11,这是g++4.4不支持的,您至少需要通过系统升级或使用/etc/apt/preferences包绑定升级到Debian Wheezy的g++4.7,这对我来说是有效的(GCC 4.8.1)。您可能需要更新编译器。
apt get install g++
之后,我收到消息“程序已经是最新版本”。是否可以在Debian Squence中升级g++4.4?对我来说很有用(GCC 4.8.1)。您可能需要更新编译器。
apt get install g++
之后,我收到消息“程序已经是最新版本”。是否可以在Debian Squeeze中升级g++4.4?GCC在上发布了一份受支持的C++11功能列表。不幸的是,我找不到包含
std::bind
函数模板的功能。哦,我当然找不到它,因为它不是语言功能,而是库功能。它是libstdc++的一部分,在这里列出了它的C++11实现状态:不幸的是,它们没有指定功能实现的版本。GCC在上发布了受支持的C++11功能的列表。不幸的是,我找不到包含
std::bind
函数模板的功能。哦,我当然找不到它,因为它不是语言功能,而是库功能。它是libstdc++的一部分,在这里列出了它的C++11实现状态:不幸的是,它们没有指定实现特性的版本。
g++ -std = c++0x test.cpp -o test
error: no match for call to ‘(std::_Bind<void (*(std::_Placeholder<1>, int))
(int, int)>) (int)’