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!
Undefined Symbols After all of the input files have been read and all symbol resolution is complete, the link-editor searches the internal symbol table for any symbol references that have not been bound to symbol definitions. These symbol references are referred to as undefinedsymbols.
The prime symbol is used to denote the derivative of a function. Typically, the symbol is used in an expression like this: In plain language, this expression represents the first derivative of the function f.
If a dynamic executable or shared object is being produced, the symbol is left as an undefined weak reference with an assigned value of zero. During process execution, the runtime linker searches for this symbol.
First of all, take a boolean variable found and initialise it to false.; Now, until that variable not equals to true, increment N by 1 in each iteration and check whether it is prime or not.; If it is prime then print it and change value of found variable to True. otherwise, iterate the loop untill you will get the next prime number.
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++
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With