std :: terminate未定义在Cocoa应用程序 [英] std::terminate undefined in Cocoa App

查看:282
本文介绍了std :: terminate未定义在Cocoa应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Cocoa应用程序编译和链接罚款。我已经把一些代码分解成一个静态库,然后回来,试图将libMyLib.a库链接到我的原始程序。

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.

我现在获取链接器错误

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.

我试图回去,匹配每个编译器和链接器设置,看看哪一个是不同的,但我只是似乎无法确定。我的预感是,我链接到C STD,需要一个C ++ STD,但一切都使用C99编译器与标准库。

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.

任何想法?

谢谢!

推荐答案

在libc ++中链接dylib修复问题

linking in libc++.dylib fixed the issue

这篇关于std :: terminate未定义在Cocoa应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆