xcode std::terminate 在 Cocoa App 中未定义
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13040652/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
std::terminate undefined in Cocoa App
提问by WebDrive
I have a Cocoa app that compiles and links fine. I've since broken out some of the code into a static library and then have gone back and tried to link that libMyLib.a library to my original program.
我有一个编译和链接很好的 Cocoa 应用程序。从那以后,我将一些代码分解为一个静态库,然后返回并尝试将该 libMyLib.a 库链接到我的原始程序。
I now get a linker error
我现在收到链接器错误
Undefined symbols for architecture x86_64:
"std::terminate()", referenced from:
referencing one of the source modules that use to live in my main project, but now lives in the library.
引用曾经存在于我的主项目中但现在存在于库中的源模块之一。
I've tried to go back and match up each compiler and linker setting to see which one is different, but I just can't seem to nail it down. My hunch is that I'm linking with a C STD and need a C++ STD, but everything is using the C99 compiler with standard libs.
我试图返回并匹配每个编译器和链接器设置以查看哪个不同,但我似乎无法确定它。我的预感是我正在与 C STD 链接并需要 C++ STD,但一切都使用带有标准库的 C99 编译器。
Any ideas?
有任何想法吗?
Thanks!
谢谢!
回答by WebDrive
linking in libc++.dylib fixed the issue
在 libc++.dylib 中链接修复了这个问题