luasec icon indicating copy to clipboard operation
luasec copied to clipboard

Rockspec support static OpenSSL on Windows

Open moteus opened this issue 8 years ago • 6 comments

Just try build LuaSec with OpenSSL 1.0.2h and got:

   Creating library ssl.lib and object ssl.exp
libeay32.lib(cryptlib.obj) : error LNK2019: unresolved external symbol __imp_DeregisterEventSource referenced in function OPENSSL_showfatal
libeay32.lib(cryptlib.obj) : error LNK2019: unresolved external symbol __imp_RegisterEventSourceW referenced in function OPENSSL_showfatal
libeay32.lib(cryptlib.obj) : error LNK2019: unresolved external symbol __imp_ReportEventW referenced in function OPENSSL_showfatal
libeay32.lib(cryptlib.obj) : error LNK2019: unresolved external symbol __imp_GetProcessWindowStation referenced in function OPENSSL_isservice
libeay32.lib(cryptlib.obj) : error LNK2019: unresolved external symbol __imp_GetUserObjectInformationW referenced in function OPENSSL_isservice
libeay32.lib(cryptlib.obj) : error LNK2019: unresolved external symbol __imp_MessageBoxW referenced in function OPENSSL_showfatal
libeay32.lib(rand_win.obj) : error LNK2019: unresolved external symbol __imp_CreateCompatibleBitmap referenced in function readscreen
libeay32.lib(rand_win.obj) : error LNK2019: unresolved external symbol __imp_DeleteObject referenced in function readscreen
libeay32.lib(rand_win.obj) : error LNK2019: unresolved external symbol __imp_GetDeviceCaps referenced in function readscreen
libeay32.lib(rand_win.obj) : error LNK2019: unresolved external symbol __imp_GetDIBits referenced in function readscreen
libeay32.lib(rand_win.obj) : error LNK2019: unresolved external symbol __imp_GetObjectW referenced in function readscreen
libeay32.lib(rand_win.obj) : error LNK2019: unresolved external symbol __imp_GetDC referenced in function readscreen
libeay32.lib(rand_win.obj) : error LNK2019: unresolved external symbol __imp_ReleaseDC referenced in function readscreen
ssl.dll : fatal error LNK1120: 13 unresolved externals

To resolve this deps need also ling against Advapi32.lib, User32.lib and Gdi32.lib

moteus avatar Sep 08 '16 15:09 moteus

Hi can you help me with this error how you solved it? i need to include these libraries ? where? in my configure where?

martingonzalez123 avatar Oct 01 '16 03:10 martingonzalez123

you need add this to rockspec file there https://github.com/brunoos/luasec/blob/master/luasec-0.6-1.rockspec#L84 But it needs only if you link with static openssl. But i see no problem to do this in all cases

moteus avatar Oct 01 '16 06:10 moteus

I don't use Windows... Has anyone technical argument about to include these library in rockspec?

brunoos avatar Oct 02 '16 17:10 brunoos

must lost some include/lib setting in project file, all the APIs he mentioned are windows native one.

momofarm avatar Nov 05 '16 14:11 momofarm

Yes its Windows only. And even need only if OpenSSL build as static library. Because by default is most likely that executable file links with this libs. But if this libs not loaded in host process and you try load this openssl dll you also get error.

moteus avatar Nov 05 '16 15:11 moteus

Would It be better to create two rockspec? (one static linkage and other for dll)

brunoos avatar Nov 06 '16 23:11 brunoos