【发布时间】:2012-10-17 20:09:19
【问题描述】:
我正在使用 g++ 在 Eclipse CDT 中构建 C++ 代码,但出现以下链接器错误:
Undefined symbols for architecture x86_64:
"std::__throw_bad_function_call()", referenced from:
std::function<void (graphics::RenderingContext*)>::operator()(graphics::RenderingContext*) const in GameWindow.o
我在一个名为 GameWindow 的类中有 std::function 成员。
为了让代码使用std::function 正确链接,我必须链接到什么?
【问题讨论】:
-
我遇到了类似的问题。我在网上搜索,发现当您错过包含任何内部标题时会发生这种情况。希望这会有所帮助