I hava a problem in using mongo-c-driver in VS2010.
I used mongo-c-driver-1.2.0/VS2010/Win7-64bit;
Follow the steps in API document, I got four lib files.(I used cmake and VS2010 to build)
bson-1.0.lib bson-static-1.0.lib mongoc-1.0.lib mongoc-static-1.0.lib
And in my test program ,I put follow #pragma comment:
#pragma comment(lib,"bson-1.0.lib")
#pragma comment(lib,"mongoc-1.0.lib")
#pragma comment(lib,"bson-static-1.0.lib")
#pragma comment(lib,"mongoc-static-1.0.lib")
But it return some link error said
error LNK2019: unresolved external symbol _mongoc_cleanup
error LNK2019:unresolved external symbol _mongoc_client_destroy,
error LNK2019: unresolved external symbol mongoc_database_destroy,
error LNK2019: unresolved external symbol _mongoc_collection_destroy,
error LNK2019: unresolved external symbol _bson_free,
error LNK2019: unresolved external symbol _bson_destroy,
error LNK2019: unresolved external symbol _mongoc_collection_insert,
error LNK2019: unresolved external symbol _bson_as_json,
error LNK2019: unresolved external symbol _mongoc_client_command_simple,
error LNK2019: unresolved external symbol _bcon_new,
error LNK2019: unresolved external symbol _bson_bcon_magic,
error LNK2019: unresolved external symbol _mongoc_client_get_collection,
error LNK2019: unresolved external symbol _mongoc_client_get_database,
error LNK2019: unresolved external symbol _mongoc_client_new,
error LNK2019: unresolved external symbol _mongoc_init
Does anyone have idea about this problem. TAT.
Related
I have a project in VC++ where I am using libcurl library. Even after adding the library in Additional Dependencies I am facing around 150 unresolved external errors, all majorly for libcurl_a.lib file.
Error -
1>OLDNAMES.lib(open.obi): warning LNK4049: locally defined symbol open imported
1>libcurl_a.lib(mime.obj): error LNK2019: unresolved external symbol imp__feof referenced
1>libcurl_a.lib(mime.obj): error LNK2019: unresolved external symbol imp_access referenced in function Curl_mime_duppart in function _read_part content
1>OLDNAMES.lib(access.obi): error LNK2001: unresolved external symbol imp access
1>libcurl_a.lib(mime.obj): error LNK2019: unresolved external symbolimp_ stat64 referenced in function Curl_nine duppart 1>libcurl_a.lib(strerror.obj): error LNK2019: unresolved external symbolimp_strerror referenced in function Curl strerror
1>libcurl_a.lib(url.obj): error LNK2001: unresolved external symbol imp_strerror
1>1ibcurl_a.lib(telnet.obj): error LNK2001: unresolved external symbol imp_strncpy
1>1ibcurl_a.lib(ftp.obj): error LNK2001: unresolved external symbolimp_strncpy
1>libcurl_alib(curl_sspi.obj): error LNK2001: unresolved external symbolimp_strncpy
1>1ibcurl_s.lib(strerror.obj): error LNK2001: unresolved external symbolimp_strncpy
1>1ibcurl_a.lib(vtis.obj): error LNK2001: unresolved external symbol imp_strncpy 1>1ibcurl_.1ib(url.obj): error LNK2001: unresolved external symbolimp_strncpy
1>libcurl_a.lib(schannel.obj) error LNK 2001: unresolved external symbol_imp_strncpy
1>libcuri_a.lip(strerror.obj) : error LNK2019: unresolved external symbol imp sys_nerr referenced in function Curi strerror
1>libcurl_a.lib(warnless.obj): error LNK2019: unresolved external symbol 1 OLDNAMES1ib(read.obi): error LNK2001: unresolved external symbolimp_read imp_read referenced in function curl_read
111bcurt a.lib/warmless.obj) error LNK2019: unresolved external symbol_imp_write referenced in function curl, weite
1 OLDNAMES-110(write.obi): error LNK2001: unresolved external symbolimp_write
I have solved this problem by building the library with RTLIBCFG=static option.
I'm working on an existing C++ project. We include libcurl as a static library, which we build from source. I'm trying to upgrade us from version 7.38.0 to version 7.61.1.
I downloaded curl-7.61.1.zip from here: https://curl.haxx.se/download/.
I made no modifications to the source and did not run any scripts that came with curl 7.61.1.
We have an existing VS solution we used for compiling curl 7.38.0, so I started from that and modified as needed for the new files in curl 7.61.1.
Everything compiled fine, however, when I try to link the compiled result into my project, I get the following errors:
1>libcurl.lib(schannel.obj) : error LNK2019: unresolved external symbol __imp_CertOpenStore referenced in function schannel_connect_step1
1>libcurl.lib(schannel_verify.obj) : error LNK2001: unresolved external symbol __imp_CertOpenStore
1>libcurl.lib(schannel.obj) : error LNK2019: unresolved external symbol __imp_CertCloseStore referenced in function schannel_connect_step1
1>libcurl.lib(schannel_verify.obj) : error LNK2001: unresolved external symbol __imp_CertCloseStore
1>libcurl.lib(schannel.obj) : error LNK2019: unresolved external symbol __imp_CertFindCertificateInStore referenced in function schannel_connect_step1
1>libcurl.lib(schannel.obj) : error LNK2019: unresolved external symbol __imp_CertFreeCertificateContext referenced in function pkp_pin_peer_pubkey
1>libcurl.lib(schannel_verify.obj) : error LNK2001: unresolved external symbol __imp_CertFreeCertificateContext
1>libcurl.lib(schannel.obj) : error LNK2019: unresolved external symbol __imp_CryptStringToBinaryA referenced in function schannel_connect_step1
1>libcurl.lib(schannel_verify.obj) : error LNK2019: unresolved external symbol __imp_CertAddCertificateContextToStore referenced in function add_certs_to_store
1>libcurl.lib(schannel_verify.obj) : error LNK2019: unresolved external symbol __imp_CertGetNameStringA referenced in function verify_host
1>libcurl.lib(schannel_verify.obj) : error LNK2019: unresolved external symbol __imp_CryptQueryObject referenced in function add_certs_to_store
1>libcurl.lib(schannel_verify.obj) : error LNK2019: unresolved external symbol __imp_CertCreateCertificateChainEngine referenced in function verify_certificate
1>libcurl.lib(schannel_verify.obj) : error LNK2019: unresolved external symbol __imp_CertFreeCertificateChainEngine referenced in function verify_certificate
1>libcurl.lib(schannel_verify.obj) : error LNK2019: unresolved external symbol __imp_CertGetCertificateChain referenced in function verify_certificate
1>libcurl.lib(schannel_verify.obj) : error LNK2019: unresolved external symbol __imp_CertFreeCertificateChain referenced in function verify_certificate
1>C:\Users\CoffeeTableEspresso\project\win64-vs15\debug-mt\executable.exe : fatal error LNK1120: 12 unresolved externals
Has anyone run into similar issues before? Please let me know if I need to edit this with more info as well.
As Peter mentioned in a comment, I needed to link against windows libraries. In this case, linking against crypt32.lib solved the issue for me.
I compiled CURL for windows to use in VS2017 as
shown in this video
Also i have defined CURL_STATICLIB in preprocessor in C/C++ configuration properties.
Actual project properties is as
But it get below unresolved symbol errors for LIBCURL only
1>mainfile.obj : error LNK2001: unresolved external symbol _curl_easy_init
1>mainfile.obj : error LNK2001: unresolved external symbol _curl_easy_setopt
1>mainfile.obj : error LNK2001: unresolved external symbol _curl_easy_perform
1>mainfile.obj : error LNK2001: unresolved external symbol _curl_easy_cleanup
Please help in resolving , it 5 hrs i have been trying to remove this :(
I'm using OpenSSL 1.1.0d for a Managed C++ project built with Visual Studio 2013. Building for Debug works great, but building for Release generates these linker errors:
error LNK2019: unresolved external symbol _SSLv23_server_method
error LNK2019: unresolved external symbol _SSLv23_client_method
error LNK2019: unresolved external symbol _CRYPTO_num_locks
error LNK2019: unresolved external symbol _CRYPTO_set_locking_callback
error LNK2019: unresolved external symbol _CRYPTO_set_dynlock_create_callback
error LNK2019: unresolved external symbol _CRYPTO_set_dynlock_lock_callback
error LNK2019: unresolved external symbol _CRYPTO_set_dynlock_destroy_callback
error LNK2019: unresolved external symbol _OPENSSL_add_all_algorithms_noconf
error LNK2019: unresolved external symbol _EVP_cleanup
error LNK2019: unresolved external symbol _SSL_load_error_strings
error LNK2019: unresolved external symbol _SSL_library_init
error LNK2019: unresolved external symbol _ERR_free_strings
error LNK2019: unresolved external symbol _CONF_modules_free
error LNK2019: unresolved external symbol _sk_num
error LNK2019: unresolved external symbol _sk_value
I've tried using my own build of OpenSSL as well as a pre-compiled version from sigmoid, and results are the same.
My hypothesis is that while these OpenSSL builds are with '/MD', that alone isn't enough to be compatible with my Managed C++ project. Since there are no direct calls from the Managed layer into OpenSLL, however, my understanding is that building with '/MD' should suffice. Plus, the Debug version works just fine. So why does just the Release one choke?
What is causing these linker errors, and how do I resolve them?
You're probably using the wrong OpenSSL version. Try OpenSSL v1.0.2k. The symbols it is complaining about are not included in the 1.1.x branch.
Remember to also link in ws_lib32.lib and crypt32.lib if necessary.
I have a project that includes the GLFW3 library, and a second project that includes the first project as a lib file, but when I compile the second one I get this error:
1>Duno-Core.lib(Display.obj) : error LNK2001: unresolved external symbol __imp_glfwSwapBuffers
1>Duno-Core.lib(Display.obj) : error LNK2001: unresolved external symbol __imp_glfwTerminate
1>Duno-Core.lib(Display.obj) : error LNK2001: unresolved external symbol __imp_glfwSetMouseButtonCallback
1>Duno-Core.lib(Display.obj) : error LNK2001: unresolved external symbol __imp_glfwPollEvents
1>Duno-Core.lib(Display.obj) : error LNK2001: unresolved external symbol __imp_glfwInit
1>Duno-Core.lib(Display.obj) : error LNK2001: unresolved external symbol __imp_glfwSetKeyCallback
1>Duno-Core.lib(Display.obj) : error LNK2001: unresolved external symbol __imp_glfwSetWindowShouldClose
1>Duno-Core.lib(Display.obj) : error LNK2001: unresolved external symbol __imp_glfwCreateWindow
1>Duno-Core.lib(Display.obj) : error LNK2001: unresolved external symbol __imp_glfwSetInputMode
1>Duno-Core.lib(Display.obj) : error LNK2001: unresolved external symbol __imp_glfwMakeContextCurrent
1>Duno-Core.lib(Display.obj) : error LNK2001: unresolved external symbol __imp_glfwDestroyWindow
1>Duno-Core.lib(Display.obj) : error LNK2001: unresolved external symbol __imp_glfwSetCursorPosCallback
1>Duno-Core.lib(Display.obj) : error LNK2001: unresolved external symbol __imp_glfwSetWindowSizeCallback
1>Duno-Core.lib(Display.obj) : error LNK2001: unresolved external symbol __imp_glfwWindowShouldClose
I've been trying to figure out why this is happening and cannot find anything like this, anywhere. If you can figure out all the horrible mistakes I’ve made, then that will help me massively!
Thanks.