Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » How to link libeay32, libssl32 and ssleay32 statically in Windows?
How to link libeay32, libssl32 and ssleay32 statically in Windows? [message #53555] Sat, 11 April 2020 11:33 Go to next message
Tom1
Messages: 1212
Registered: March 2007
Senior Contributor
Hi,

I'm using Core/SSH and and Core/SSL and just as the title says: How to link libeay32, libssl32 and ssleay32 statically in Windows?

I seem to remain dependent on:

libeay32.dll
libssl32.dll
ssleay32.dll

I used MSBT19x64.

I also tried CLANGx64 but then I ended up with missing libraries:
Linking...
lld: error: unable to find library -llibeay32MT
lld: error: unable to find library -lssleay32MT
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)

There were errors. (3:58.39)


Is there a way to get them statically linked to avoid dependence of those DLLs?

Best regards,

Tom
Re: How to link libeay32, libssl32 and ssleay32 statically in Windows? [message #53586 is a reply to message #53555] Tue, 14 April 2020 01:55 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1182
Registered: March 2006
Location: Italy
Senior Contributor
Hello Tom,

I have (had?) the same problem but with MacOS and library crypto and ssl. CLANG refuse the static .a version.

Tonight I have found a post

https://stackoverflow.com/questions/37038472/osx-how-to-stat ically-link-a-library-and-dynamically-link-the-standard-libr ary

There one guy said "Compiler prefers dynamic version over static version of library". In my case the .dylib (equivalent of .dll for mac) and .a libraries are in the same folder. As last temptive I have renamed the .dylib... and worked! The compiler didn't find the .dylib and used the static library. The otool program no longer see the linked library. Tomorrow I'll inquire better but I am confident that this did the trick.

Best regards,
Luigi
Re: How to link libeay32, libssl32 and ssleay32 statically in Windows? [message #53588 is a reply to message #53586] Tue, 14 April 2020 09:38 Go to previous messageGo to next message
Tom1
Messages: 1212
Registered: March 2007
Senior Contributor
Hi Luigi,

Thanks, but this did not solve the .dll dependency issue on Windows.

I renamed the dlls so that they cannot be reached, but the result was the same. I started to think that maybe some or all of the ssl .lib files shipped with u++ are actually just import libraries for those dlls. Perhaps there is no static version included at all.

Best regards,

Tom
Re: How to link libeay32, libssl32 and ssleay32 statically in Windows? [message #53679 is a reply to message #53555] Mon, 20 April 2020 16:43 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Tom1 wrote on Sat, 11 April 2020 11:33
Hi,

I'm using Core/SSH and and Core/SSL and just as the title says: How to link libeay32, libssl32 and ssleay32 statically in Windows?

I seem to remain dependent on:

libeay32.dll
libssl32.dll
ssleay32.dll

I used MSBT19x64.

I also tried CLANGx64 but then I ended up with missing libraries:
Linking...
lld: error: unable to find library -llibeay32MT
lld: error: unable to find library -lssleay32MT
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)

There were errors. (3:58.39)


Is there a way to get them statically linked to avoid dependence of those DLLs?

Best regards,

Tom


This is at the moment problem to solve, one of problems I would like to have resolved before 2020.1....

Mirek
Re: How to link libeay32, libssl32 and ssleay32 statically in Windows? [message #53681 is a reply to message #53679] Mon, 20 April 2020 17:42 Go to previous messageGo to next message
Tom1
Messages: 1212
Registered: March 2007
Senior Contributor
Hi,

The 'missing libraries' linking error with CLANG is gone when using the following:

When: WIN32 (MSC | CLANG)
Library: libeay32MT.lib ssleay32MT.lib

So, only the problem of having static linking instead of dynamic is remaining.

Best regards,

Tom
Re: How to link libeay32, libssl32 and ssleay32 statically in Windows? [message #53701 is a reply to message #53681] Wed, 22 April 2020 18:01 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
I believe I have managed to solve this, tomorrow's nightly build should have static versions of ssl libraries, also Core/SSL upp is fixed to reflect that.
Re: How to link libeay32, libssl32 and ssleay32 statically in Windows? [message #53702 is a reply to message #53701] Wed, 22 April 2020 18:07 Go to previous messageGo to next message
Tom1
Messages: 1212
Registered: March 2007
Senior Contributor
Hi Mirek,

Sounds good! How about Core/SSH upp? It's equally dependent on these libs and has a slightly different configuration in upp...

Thanks and best regards,

Tom
Re: How to link libeay32, libssl32 and ssleay32 statically in Windows? [message #53710 is a reply to message #53702] Thu, 23 April 2020 10:16 Go to previous messageGo to next message
Tom1
Messages: 1212
Registered: March 2007
Senior Contributor
Hi,

This morning the nightly build upp-win-14352.7z had an empty file dbghelp.dll in root and prevented startup of TheIDE. I replaced the file with a copy from previous version and got it running. I also noticed that the README file is empty.

(During first startup it showed the license agreement with year up to 2019 only. Worth fixing to 2020 before release.)

Core/SSH.upp also needs the same change from:

library(WIN32 GCC) "ssl crypto";

to:
library(WIN32 (GCC | CLANG)) "ssl crypto";

Then it links statically and works correctly with CLANG and CLANGx64 on Windows.

On the MSBT19 and MSBT19x64 its still dependent on the .DLLs. This needs more attention.

Best regards,

Tom
Re: How to link libeay32, libssl32 and ssleay32 statically in Windows? [message #53711 is a reply to message #53710] Thu, 23 April 2020 10:38 Go to previous messageGo to next message
Tom1
Messages: 1212
Registered: March 2007
Senior Contributor
While on the subject, the following RLOGs should probably be dropped from Core/SSH:

Initializing libssh2...
Deinitializing libssh2...


Best regards,

Tom
Re: How to link libeay32, libssl32 and ssleay32 statically in Windows? [message #53721 is a reply to message #53711] Fri, 24 April 2020 16:20 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Problem resolved. Next nightly should come with statically built libs for VC++....

I have taken the oportunity to unify names as well, so across all platforms it is simply "crypto ssl"....

Mirek
Re: How to link libeay32, libssl32 and ssleay32 statically in Windows? [message #53729 is a reply to message #53721] Fri, 24 April 2020 22:35 Go to previous messageGo to next message
Tom1
Messages: 1212
Registered: March 2007
Senior Contributor
mirek wrote on Fri, 24 April 2020 17:20
Problem resolved. Next nightly should come with statically built libs for VC++....

I have taken the oportunity to unify names as well, so across all platforms it is simply "crypto ssl"....

Mirek

Hi,

Thanks! I'll take a look at it soon.

Best regards,

Tom
Re: How to link libeay32, libssl32 and ssleay32 statically in Windows? [message #53743 is a reply to message #53729] Sun, 26 April 2020 12:25 Go to previous message
Tom1
Messages: 1212
Registered: March 2007
Senior Contributor
Hi,

OK, now it works beautifully with both CLANG and MSBT19! Thanks Smile

Best regards,

Tom
Previous Topic: [BUG] TheIDE prevents using MSC Incremental link
Next Topic: invalid memory access
Goto Forum:
  


Current Time: Thu Mar 28 21:14:05 CET 2024

Total time taken to generate the page: 0.01162 seconds