0

I'm trying to compile an app with static openssl. I compiled openssl with mingw options and now my lib directory has: libcrypto.a libssl.a libcrypto.dll.a libssl.dll.a I used the correct -L compiler options and still I get these errors:

x86_64-w64-mingw32-gcc main.c -lws2_32 -s -ffunction-sections -fdata-sections -Wno-write-strings -fno-exceptions -fmerge-all-constants -static-libstdc++ -static-libgcc -static -L/rw/usrlocal/lib/ -I/rw/usrlocal/include/ -lssl -lcrypto ~~~~~~~~^~~~~ /usr/bin/x86_64-w64-mingw32-ld: skipping incompatible /rw/usrlocal/lib//libssl.a when searching for -lssl /usr/bin/x86_64-w64-mingw32-ld: cannot find -lssl /usr/bin/x86_64-w64-mingw32-ld: skipping incompatible /rw/usrlocal/lib//libcrypto.a when searching for -lcrypto /usr/bin/x86_64-w64-mingw32-ld: cannot find -lcrypto collect2: error: ld returned 1 exit status 

Can someone here tell me why mingw is using the libcrypto.a and not libcrypto.dll.a? And what's more important: How I can change that? Greetings

3
  • So you want to mix static and dynamic linking? Commented Oct 6, 2020 at 17:09
  • No i want to link statically (all into one .exe). Why did you assume that? Commented Oct 6, 2020 at 17:33
  • Because you mentioned libcrypto.dll.a, which is for linking against libcrypto.dll. Commented Oct 7, 2020 at 9:12

1 Answer 1

0

It literally says "skipping incompatible", which leads me to think the libraries are not targetting the same platform. Are you sure you're not mixing 32-bit and 64-bit Windows?

Run the file command with the .dll file of openssl to see if they are also targetting x86_64.

When building openssl you should specify mingw64 with the ./Configure command.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.