Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failed on windows #2848

Open
star-hengxing opened this issue Jul 11, 2023 · 0 comments
Open

Build failed on windows #2848

star-hengxing opened this issue Jul 11, 2023 · 0 comments

Comments

@star-hengxing
Copy link

Some logs

mosquitto\lib\net_mosq.h(22): fatal error C1083: Cannot open include file: 'sys/socket.h': No such file or directory

mosquitto/lib/net_mosq.h

Lines 21 to 25 in 5dceeb9

#ifndef WIN32
# include <sys/socket.h>
# include <unistd.h>
#else
# include <winsock2.h>

WIN32 is not a predefined macros in the latest msvc, maybe need to use _WIN32 instead of WIN32 or add add_definitions("-DWIN32") in cmakelists.
ref:
https://groups.google.com/g/fltkcoredev/c/BwKvvtJ_Mog
https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=msvc-170

Creating library plugins\dynamic-security\mosquitto_dynamic_security.lib and object plugins\dynamic-security\mosquitto_dynamic_security.exp
libcrypto.lib(e_capi.obj) : error LNK2019: unresolved external symbol __imp_CertOpenStore referenced in function capi_list_certs
libcrypto.lib(e_capi.obj) : error LNK2019: unresolved external symbol __imp_CertCloseStore referenced in function capi_find_key
libcrypto.lib(e_capi.obj) : error LNK2019: unresolved external symbol __imp_CertEnumCertificatesInStore referenced in function capi_find_cert
libcrypto.lib(e_capi.obj) : error LNK2019: unresolved external symbol __imp_CertFindCertificateInStore referenced in function capi_find_cert
libcrypto.lib(e_capi.obj) : error LNK2019: unresolved external symbol __imp_CertDuplicateCertificateContext referenced in function capi_load_ssl_client_cert
libcrypto.lib(e_capi.obj) : error LNK2019: unresolved external symbol __imp_CertFreeCertificateContext referenced in function capi_dsa_free
libcrypto.lib(e_capi.obj) : error LNK2019: unresolved external symbol __imp_CertGetCertificateContextProperty referenced in function capi_cert_get_fname
plugins\dynamic-security\mosquitto_dynamic_security.dll : fatal error LNK1120: 7 unresolved externals
ninja: build stopped: subcommand failed.

target_link_libraries(mosquitto_dynamic_security mosquitto)

Need to add crypt32 lib.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant