On Jan 24, 2014, at 12:03 , Eugene Zolenko <[email protected]> wrote: > Things like > > "std::istream::peek()", referenced from: > CryptoPP::FileStore::CopyRangeTo2(CryptoPP::BufferedTransformation&, unsigned > long long&, unsigned long long, std::string const&, bool) const in > libcryptopp.a(files.o) > > indicate that you have C++ standard library mismatch.
Eugene is absolutely correct. I’ve had the same problem when I tried to link code compiled with clang to crypto++ library compiler with gcc. Tim, I wonder why it is happening to you, as you don’t seem to try to accomplish this cross-linking? Using the same compiler for crypto++ and user code seems trivially simple (i.e., nothing whatsoever needed changes)... > So your project uses a different stdlib from your build of cryptopp. Clang in > xcode comes with 2 standard libraries: libstdc++ and libc++, those has to be > matched across ALL libs and dlls using anything from C++ at all (so anything > but pure C stuff, and not just in interface, internally too). Because > std::string is different from std::string. > > For our code we wanted to use C++11 stuff, which is much better supported in > libc++ (the other one is being deprecated I think). I don't know what your > requirements are, but keep in mind that if you go to libc++, you'll need to > rebuild absolutely everything with that. In your case at least boost, > cryptopp and wxwidgets. My code in question doesn’t care about c++11, but I think in my experiments it worked with -std=c++11 too. > libstdc++ is the one that supposed to be compatible with GCC's stdlib, so > much less recompiling is required. But worse support for C++11, if that's > what you want. Yes… Anyway, I’m attaching two makefiles. As I said, the biggest problem was finding the minimal set of compiler and linker flags that would allow a library compiled by one compiler to be linked with code compiled by another compiler. GNUmakefile shows how I built libcryptopp.a. I used GCC-4.8 from MacPorts, but you don’t have to (just change “g++-mp-4.8” to “g++” or “/usr/bin/g++” if you want). My reason was significantly better AES performance of (real) GCC-compiled code compared to clang/llvm. With ECC stuff it’s a wash. Makefile shows how I build and link my code (compiled with clang-3.4 installed from MacPorts) to libcryptopp.a. It works even easier when I use GCC, and should work with the clang (or gcc) from Xcode. Please let me know how it works P.S. Apologies if this message is too large for you. Hopefully it’s nothing that the Delete button can’t fix. :) > On Fri, Jan 24, 2014 at 8:49 AM, Tim Burgess <[email protected]> wrote: > OK, I get the hint - I thought that I needed to have all the libraries > matched. > I've rebuilt using make static test and incorporated the .a file into my > XCode 5.02 project. The complete build log is at > https://dl.dropboxusercontent.com/u/29578720/Crypto.txt - the two warnings > about library directories are spurious - I've checked the directories called > in the ld line and they exist and are correct for my purposes (XCode adds > directories to the library search path when you drag/add a library file to > the project). I've removed and re-added all of my required library files to > ensure that the library search path is correctly set, but get unknown symbol > errors for the crypto++ calls (the log indicates a problem with the boost > library path also, but I get no symbol errors for boost calls at all). > What else could cause unknown symbol errors in this context? > Cheers. > Tim > > > -- > -- > You received this message because you are subscribed to the "Crypto++ Users" > Google Group. > To unsubscribe, send an email to [email protected]. > More information about Crypto++ and this group is available at > http://www.cryptopp.com. > --- > You received this message because you are subscribed to the Google Groups > "Crypto++ Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- > -- > You received this message because you are subscribed to the "Crypto++ Users" > Google Group. > To unsubscribe, send an email to [email protected]. > More information about Crypto++ and this group is available at > http://www.cryptopp.com. > --- > You received this message because you are subscribed to the Google Groups > "Crypto++ Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out.
-- -- You received this message because you are subscribed to the "Crypto++ Users" Google Group. To unsubscribe, send an email to [email protected]. More information about Crypto++ and this group is available at http://www.cryptopp.com. --- You received this message because you are subscribed to the Google Groups "Crypto++ Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
Makefile
Description: Binary data
GNUmakefile
Description: Binary data
P.S. Apologies if this message is too large for you. Hopefully it’s nothing that the Delete button can’t fix. :)
|
