C++ Equivalent Windows of dl library

2k views Asked by At

I created an app that encrypt decript using OpenSSL.

To compile/link it in g++ needed to include static libs:

g++ -o gssag agent_main.cpp libssl.a libcrypto.a -ldl -std=c++14

this "dl" library seems to be a library to load dinamic libraries that LINUX need.

I dont undersand why need them if using *.a static libraries. But without this ld library nothing works.

But In Windows using openssl and crypto *.libs g++ linkeditor also ask for dlopen functions.

What I use in Windows to substitute the linux dl library???

1

There are 1 answers

2
SoronelHaetir On

You would need to get a windows openssl dll and use the LoadLibrary function instead of dlopen.

HINSTANCE hDllInstance = LoadLibrary(_T("MyDll.dll"));
if(!hDllInstance)
{ /* dll failed to load */ }