__next_prime symbol undefined [英] __next_prime symbol undefined

查看:300
本文介绍了__next_prime symbol undefined的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在iOS的XCode项目中包含unordered_map。最初当我尝试链接时,我有新的和删除操作的错误,但是当我添加-lstdc ++到其他链接器标志那些消失,但我留下了以下缺少的符号。

I am including unordered_map in a XCode project for iOS. Originally when I tried linking I got errors for new and delete operations, but when I added "-lstdc++" to "Other Linker Flags" those go away, but I am left with the following missing symbol.

"std::__1::__next_prime(unsigned long)", referenced from:

我尝试了C ++标准语言/方言的不同组合,但是不能让它消失。

I tried different combinations of C++ Standard Language/Dialect but cannot get this to go away.

谢谢!

推荐答案

在LLVM的 libc ++ http://www.opensource.apple.com/source/libcpp/libcpp-31/src/hash.cpp?txt 。因此,您需要将 C ++标准库更改为 libc ++(支持C ++ 11的LLVM C ++标准库),或将链接器标记更改为 -lc ++

This function is a private method in LLVM's libc++: http://www.opensource.apple.com/source/libcpp/libcpp-31/src/hash.cpp?txt. Therefore, you need to change your C++ Standard Library to libc++ (LLVM C++ standard library with C++11 support), or change your linker flag to -lc++.

这篇关于__next_prime symbol undefined的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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