NO

Author Topic: Compiling and linking with openssl library libcrypto.a  (Read 4196 times)

bik

  • Guest
Compiling and linking with openssl library libcrypto.a
« on: November 04, 2014, 02:29:19 PM »
Hello,

if compiling with __cdecl and linking with libcrypto.a I get linker error messages:

POLINK: error: Unresolved external symbol '__errno'.
POLINK: error: Unresolved external symbol '__imp___iob'.
POLINK: error: Unresolved external symbol '___umoddi3'.
POLINK: error: Unresolved external symbol '___udivdi3'.
POLINK: error: Unresolved external symbol '__imp____mb_cur_max'.
POLINK: error: Unresolved external symbol '__imp___pctype'.
POLINK: error: Unresolved external symbol '__isctype'.

This symbols are listed in PODUMP of the library as

... UNDEF  notype      external ...

in several *.c sources.
Compiling and linking the same sources in DevCpp IDE, all references are solved.

Therefor my question: What's the matter? Are there some PellesC-Libraries to solve that problem?

Thanks for answer.   

BiK

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
Re: Compiling and linking with openssl library libcrypto.a
« Reply #1 on: November 04, 2014, 03:31:02 PM »
That libcrypto.a is linked against msvcrt.lib or mingw static library ?

May the source be with you

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: Compiling and linking with openssl library libcrypto.a
« Reply #2 on: November 04, 2014, 05:12:23 PM »
If it works in DevCpp it should be linked against MingW I suppose ...  :(
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
Re: Compiling and linking with openssl library libcrypto.a
« Reply #3 on: November 05, 2014, 09:18:09 AM »
Isn't libeay32.lib/ssleay32.lib enough for openssl from here ?

EDIT: 32-bit msvcrt.def/msvcrt.lib for testing static linking with libcrypto.a.
« Last Edit: November 06, 2014, 02:46:59 PM by TimoVJL »
May the source be with you

bik

  • Guest
Re: Compiling and linking with openssl library libcrypto.a
« Reply #4 on: November 06, 2014, 01:03:38 PM »
Thank you for answer.

Compiling with difmod.c is ok, but linking now with libcrypto.a and msvcrt.lib conflicts. One only error message:
POLINK: error: Symbol '_fclose' is multiply defined: 'msvcrt.lib(msvcrt.dll)' and 'crt.lib(fclose.obj)'.

Linking with libeya32.lib resolves all externals. But for run it is nessesary also to include libeay32.dll in windows directory.
To avoid to place libeay32.dll in windows or working directory of the exe, I converted libeay32.dll with the import library libeay32.lib to the static library libeay32dll.lib (by means of DLL to LIB 3.0, http://www.binary-soft.com/).
With the linker parameters

-subsystem:windows -machine:x86 -map -release kernel32.lib user32.lib gdi32.lib advapi32.lib wsock32.lib libeay32dll.lib

the exe was built successful.
« Last Edit: November 08, 2014, 05:03:59 PM by bik »