I am trying to import and use OpenSSL FIPS validated object module in my iOS project. When I build the project I get this error saying:
Undefined symbols for architecture armv7:
"std::string::clear()", referenced from:
+[CryptoUtilities getSeed:::] in CryptoUtilities.o
+[CryptoUtilities getKey:::] in CryptoUtilities.o
"___cxa_pure_virtual", referenced from:
vtable for WBXML::CWBXMLParser in CWBXMLParser.o
"std::string::substr(unsigned long, unsigned long) const", referenced from:
WBXML::CWBXMLParser::LoadWBXMLHeader(std::string const&, unsigned long, unsigned long&) in CWBXMLParser.o
WBXML::CWBXMLParser::LoadTagContents(WBXML::CTag*, std::string const&, unsigned long, unsigned long&, unsigned short&, bool&) in CWBXMLParser.o
+[CryptoUtilities getKey:::] in CryptoUtilities.o
"operator delete(void*)", referenced from:
__gnu_cxx::new_allocator<WBXML::CTag>::deallocate(WBXML::CTag*, unsigned long) in CTag.o
__gnu_cxx::new_allocator<int>::deallocate(int*, unsigned long) in CryptoUtilities.o
// This goes for some more functions and then
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I know this question has been asked and answered at here. I tried all the solutions that are mentioned but I am not able to fix this issue.
Here are the things/settings I tried to fix the problem.
I have added the libs and the canister in the linked frameworks and libraries section.
Since it is a lib, i do not have any .m files to add.
I tried changing the C++ compiler to Compiler Default, LLVM , GNU and none of them worked.
I tried adding -ObjC in the other linker flags.
I tried extern C when including the header files. The header files' definition also has extern C correctly used.
Update :
I do have set the compiler settings correctly as mentioned below.
Also if this would be any help in figuring out this error. It is when running this script in the runscript phase that I get these errors that are mentioned.
https://docs.google.com/document/d/1YEebn2p8HKhc7lxUWa3xMHXWt1cELXLm3AoKElbEyuU/edit?usp=sharing
Please help me.
Update2 :
Output of xcrun -sdk iphoneos lipo -info CryptoUtilities.o is
Non-fat file : CryptoUtilities.o is architecture: armv7
More details about the errors : https://docs.google.com/document/d/1CqSa_tAsQP1JY_IxvXLDyYyQUI0iebV_REiCquwDXyk/edit?usp=sharing
Please help. I am in this position for around a month.