uNetworking / uSockets

Miniscule cross-platform eventing, networking & crypto for async applications
Apache License 2.0
1.29k stars 268 forks source link

Build with SSL using Visual studio #119

Closed polhaghverdian closed 4 years ago

polhaghverdian commented 4 years ago

Hi,

Am trying to build the project using Visual studio 19 with SSL enabled. However when i remove this _LIBUS_NOSSL from preprocessor definitions and adding following: _WITHOPENSSL=1 or _WITH_WOLFSSL=1_ I get below output:

I have added the libs belonging to both openssl and wolfssl but still getting the same output. Which libs are missing?

1>------ Build started: Project: uSockets, Configuration: Debug x64 ------
1>   Creating library C:\Users\Pol\Desktop\Git\uSockets\x64\Debug\uSockets.lib and object C:\Users\Pol\Desktop\Git\uSockets\x64\Debug\uSockets.exp
1>context.obj : error LNK2019: unresolved external symbol us_internal_ssl_socket_context_get_native_handle referenced in function us_socket_context_get_native_handle
1>context.obj : error LNK2019: unresolved external symbol us_internal_create_ssl_socket_context referenced in function us_create_socket_context
1>context.obj : error LNK2019: unresolved external symbol us_internal_ssl_socket_context_free referenced in function us_socket_context_free
1>context.obj : error LNK2019: unresolved external symbol us_internal_ssl_socket_context_on_open referenced in function us_socket_context_on_open
1>context.obj : error LNK2019: unresolved external symbol us_internal_ssl_socket_context_on_close referenced in function us_socket_context_on_close
1>context.obj : error LNK2019: unresolved external symbol us_internal_ssl_socket_context_on_data referenced in function us_socket_context_on_data
1>context.obj : error LNK2019: unresolved external symbol us_internal_ssl_socket_context_on_writable referenced in function us_socket_context_on_writable
1>context.obj : error LNK2019: unresolved external symbol us_internal_ssl_socket_context_on_timeout referenced in function us_socket_context_on_timeout
1>context.obj : error LNK2019: unresolved external symbol us_internal_ssl_socket_context_on_end referenced in function us_socket_context_on_end
1>context.obj : error LNK2019: unresolved external symbol us_internal_ssl_socket_context_listen referenced in function us_socket_context_listen
1>context.obj : error LNK2019: unresolved external symbol us_internal_ssl_socket_context_connect referenced in function us_socket_context_connect
1>context.obj : error LNK2019: unresolved external symbol us_internal_ssl_socket_context_ext referenced in function us_socket_context_ext
1>context.obj : error LNK2019: unresolved external symbol us_internal_ssl_socket_context_adopt_socket referenced in function us_socket_context_adopt_socket
1>context.obj : error LNK2019: unresolved external symbol us_internal_create_child_ssl_socket_context referenced in function us_create_child_socket_context
1>loop.obj : error LNK2019: unresolved external symbol us_internal_free_loop_ssl_data referenced in function us_internal_loop_data_free
1>socket.obj : error LNK2019: unresolved external symbol us_internal_ssl_socket_get_native_handle referenced in function us_socket_get_native_handle
1>socket.obj : error LNK2019: unresolved external symbol us_internal_ssl_socket_write referenced in function us_socket_write
1>socket.obj : error LNK2019: unresolved external symbol us_internal_ssl_socket_ext referenced in function us_socket_ext
1>socket.obj : error LNK2019: unresolved external symbol us_internal_ssl_socket_is_shut_down referenced in function us_socket_is_shut_down
1>socket.obj : error LNK2019: unresolved external symbol us_internal_ssl_socket_shutdown referenced in function us_socket_shutdown
1>C:\Users\Pol\Desktop\Git\uSockets\x64\Debug\uSockets.dll : fatal error LNK1120: 20 unresolved externals
ghost commented 4 years ago

You define LIBUS_USE_OPENSSL in your linker settings. WITH_OPENSSL is just a Makefile switch that triggers LIBUS_USE_OPENSSL.

polhaghverdian commented 4 years ago

@alexhultman @alexhultman-2fa

Really sorry to bother about this.

You mean that "LIBUS_USE_OPENSSL" should not be placed in column "Preprocessor definitions" but instead somewhere in linker settings?

bild

ghost commented 4 years ago

I meant preprocessor yes