__next_prime symbol undefined

2020-04-07 05:02发布

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:

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

Any idea what library includes this?

Thanks!

标签: c++ ios xcode std
1条回答
戒情不戒烟
2楼-- · 2020-04-07 05:19

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++.

查看更多
登录 后发表回答