On Saturday, May 12, 2018 at 8:23:52 AM UTC-4, Gintas wrote:
>
> I'm building a Windows application on OS X with Mingw that needs to 
> utilize Crypto++ library. How can I build Crypto++ static library from 
> source code with target as Windows using mingw on OS X? Here is what I 
> tried:
>
>     download crypto++ source
>     $ export CC=x86_64-w64-mingw32-gcc
>     $ export CXX=x86_64-w64-mingw32-g++
>     $ make static
>
> This exports libcryptopp.a which I include into my application when 
> building:
>
>     x86_64-w64-mingw32-g++ rsa.cpp -L/Users/user/project/ -lcryptopp 
> -I/usr/local/opt/openssl/include/ -static-libstdc++ -static-libgcc -o 
> main.exe
>
> However, this gives ridiculous amount of undefined reference errors (full 
> list: https://pastebin.com/Fjjg9fZc), e.g.:
>
>     
> /var/folders/8k/t6rljvrs6l32k49b3834_njr0000gn/T//ccuBBmtW.o:rsa.cpp:(.rdata$.refptr._ZTVN8CryptoPP22BufferedTransformationE[.refptr._ZTVN8CryptoPP22BufferedTransformationE]+0x0):
>  
> undefined reference to `vtable for CryptoPP::BufferedTransformation'
>

Forgive my ignorance... What are the CXXFLAGS used by the GNUmakefile when 
building in your setup? Can you show the compiler invocation for 
cryptlib.cpp?

For example, on Linux it looks like:

    $ make cryptlib.o
    g++ -DNDEBUG -g2 -O3 -fPIC -pthread -pipe -c cryptlib.cpp

Or:

    $ CXX=clang++ make cryptlib.o
    clang++ -DNDEBUG -g2 -O3 -fPIC -pthread -pipe -c cryptlib.cpp

Uri and Marcel, do you have any experience with this setup?

Jeff

-- 
You received this message because you are subscribed to "Crypto++ Users". More 
information about Crypto++ and this group is available at 
http://www.cryptopp.com and 
http://groups.google.com/forum/#!forum/cryptopp-users.
--- 
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 cryptopp-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to