Qt and cpprestsdk

Good evening folks,

i am quite a beginner and am just struggling through the correct configuration of CMakeLists.txt files.

I have created a project based on my own file, Qt framework files and cpprestsdk (casablanca) from MS.
For the installation of the cpprestsdk I use conan.

Unfortunately I get several LNK Errors when building the _executable.
The individual libraries can be built without problems.

Here is the CMake output during build all:
[main] Ordner wird erstellt: Miele_Oculus
[build] Build wird gestartet.
[proc] Befehl wird ausgeführt: “C:\Program Files\CMake\bin\cmake.EXE” --build c:/Projekte/Cpp/dev/Miele_Oculus/build --config Release --target ALL_BUILD – /maxcpucount:10
[build] Microsoft ®-Build-Engine, Version 16.7.0+b89cb5fde für .NET Framework
[build] Copyright © Microsoft Corporation. Alle Rechte vorbehalten.
[build]
[build] Checking Build System
[build] Automatic MOC and UIC for target Qt_GUI
[build] Building Custom Rule C:/Projekte/Cpp/dev/Miele_Oculus/src/CMakeLists.txt
[build] Building Custom Rule C:/Projekte/Cpp/dev/Miele_Oculus/gui/CMakeLists.txt
[build] Building Custom Rule C:/Projekte/Cpp/dev/Miele_Oculus/src/CMakeLists.txt
[build] server.cpp
[build] mocs_compilation.cpp
[build] fabrikat.cpp
[build] mainwindow.cpp
[build] connection.cpp
[build] Code wird generiert…
[build] Code wird generiert…
[build] Qt_GUI.vcxproj -> C:\Projekte\Cpp\dev\Miele_Oculus\build\gui\Qt_GUI.dir\Release\Qt_GUI.lib
[build] ServerService.vcxproj -> C:\Projekte\Cpp\dev\Miele_Oculus\build\src\ServerService.dir\Release\ServerService.lib
[build] TANDEM_FABRIKAT.vcxproj -> C:\Projekte\Cpp\dev\Miele_Oculus\build\src\TANDEM_FABRIKAT.dir\Release\TANDEM_FABRIKAT.lib
[build] Building Custom Rule C:/Projekte/Cpp/dev/Miele_Oculus/app/CMakeLists.txt
[build] main.cpp
[build] mainwindow.obj : error LNK2001: Nicht aufgelöstes externes Symbol "“public: virtual struct QMetaObject const * __cdecl MainWindow::metaObject(void)const " (?metaObject @ MainWindow @ @ UEBAPEBUQMetaObject @ @ XZ)”. [C:\Projekte\Cpp\dev\Miele_Oculus\build\app\MIELE_OCULUS_Executable.vcxproj]
[build] mainwindow.obj : error LNK2001: Nicht aufgelöstes externes Symbol ““public: virtual void * __cdecl MainWindow::qt_metacast(char const *)” (?qt_metacast @ MainWindow @ @ UEAAPEAXPEBD @ Z)”. [C:\Projekte\Cpp\dev\Miele_Oculus\build\app\MIELE_OCULUS_Executable.vcxproj]
[build] mainwindow.obj : error LNK2001: Nicht aufgelöstes externes Symbol ““public: virtual int __cdecl MainWindow::qt_metacall(enum QMetaObject::Call,int,void * *)” (?qt_metacall @ MainWindow @ @ UEAAHW4Call @ QMetaObject @ @ HPEAPEAX @ Z)”. [C:\Projekte\Cpp\dev\Miele_Oculus\build\app\MIELE_OCULUS_Executable.vcxproj]
[build] cpprest142_2_10.lib(web_utilities.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol “__imp_CryptProtectMemory” in Funktion ““public: __cdecl web::details::win32_encryption::win32_encryption(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &)” (??0win32_encryption @ details @ web @ @ QEAA @ AEBV?$basic_string @ _WU?$char_traits @ _W @ std @ @ V?$allocator @ _W @ 2 @ @ std @ @ @ Z)”. [C:\Projekte\Cpp\dev\Miele_Oculus\build\app\MIELE_OCULUS_Executable.vcxproj]
[build] cpprest142_2_10.lib(web_utilities.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol “__imp_CryptUnprotectMemory” in Funktion "“public: class std::unique_ptr<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >,class web::details::zero_memory_deleter> __cdecl web::details::win32_encryption::decrypt(void)const " (?decrypt @ win32_encryption @ details @ web @ @ QEBA?AV?$unique_ptr @ V?$basic_string @ _WU?$char_traits @ _W @ std @ @ V?$allocator @ _W @ 2 @ @ std @ @ Vzero_memory_deleter @ details @ web @ @ @ std @ @ XZ)”. [C:\Projekte\Cpp\dev\Miele_Oculus\build\app\MIELE_OCULUS_Executable.vcxproj]
[build] cpprest142_2_10.lib(oauth1.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol “BCryptOpenAlgorithmProvider” in Funktion ““private: static class std::vector<unsigned char,class std::allocator > __cdecl web::http::oauth1::experimental::oauth1_config::_hmac_sha1(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &,class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &)” (?_hmac_sha1 @ oauth1_config @ experimental @ oauth1 @ http @ web @ @ CA?AV?$vector @ EV?$allocator @ E @ std @ @ @ std @ @ AEBV?$basic_string @ _WU?$char_traits @ _W @ std @ @ V?$allocator @ _W @ 2 @ @ 7 @ 0 @ Z)”. [C:\Projekte\Cpp\dev\Miele_Oculus\build\app\MIELE_OCULUS_Executable.vcxproj]
[build] cpprest142_2_10.lib(oauth1.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol “BCryptGetProperty” in Funktion ““private: static class std::vector<unsigned char,class std::allocator > __cdecl web::http::oauth1::experimental::oauth1_config::_hmac_sha1(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &,class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &)” (?_hmac_sha1 @ oauth1_config @ experimental @ oauth1 @ http @ web @ @ CA?AV?$vector @ EV?$allocator @ E @ std @ @ @ std @ @ AEBV?$basic_string @ _WU?$char_traits @ _W @ std @ @ V?$allocator @ _W @ 2 @ @ 7 @ 0 @ Z)”. [C:\Projekte\Cpp\dev\Miele_Oculus\build\app\MIELE_OCULUS_Executable.vcxproj]
[build] cpprest142_2_10.lib(oauth1.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol “BCryptCloseAlgorithmProvider” in Funktion ““private: static class std::vector<unsigned char,class std::allocator > __cdecl web::http::oauth1::experimental::oauth1_config::_hmac_sha1(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &,class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &)” (?_hmac_sha1 @ oauth1_config @ experimental @ oauth1 @ http @ web @ @ CA?AV?$vector @ EV?$allocator @ E @ std @ @ @ std @ @ AEBV?$basic_string @ _WU?$char_traits @ _W @ std @ @ V?$allocator @ _W @ 2 @ @ 7 @ 0 @ Z)”. [C:\Projekte\Cpp\dev\Miele_Oculus\build\app\MIELE_OCULUS_Executable.vcxproj]
[build] cpprest142_2_10.lib(oauth1.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol “BCryptCreateHash” in Funktion ““private: static class std::vector<unsigned char,class std::allocator > __cdecl web::http::oauth1::experimental::oauth1_config::_hmac_sha1(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &,class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &)” (?_hmac_sha1 @ oauth1_config @ experimental @ oauth1 @ http @ web @ @ CA?AV?$vector @ EV?$allocator @ E @ std @ @ @ std @ @ AEBV?$basic_string @ _WU?$char_traits @ _W @ std @ @ V?$allocator @ _W @ 2 @ @ 7 @ 0 @ Z)”. [C:\Projekte\Cpp\dev\Miele_Oculus\build\app\MIELE_OCULUS_Executable.vcxproj]
[build] cpprest142_2_10.lib(oauth1.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol “BCryptHashData” in Funktion ““private: static class std::vector<unsigned char,class std::allocator > __cdecl web::http::oauth1::experimental::oauth1_config::_hmac_sha1(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &,class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &)” (?_hmac_sha1 @ oauth1_config @ experimental @ oauth1 @ http @ web @ @ CA?AV?$vector @ EV?$allocator @ E @ std @ @ @ std @ @ AEBV?$basic_string @ _WU?$char_traits @ _W @ std @ @ V?$allocator @ _W @ 2 @ @ 7 @ 0 @ Z)”. [C:\Projekte\Cpp\dev\Miele_Oculus\build\app\MIELE_OCULUS_Executable.vcxproj]
[build] cpprest142_2_10.lib(oauth1.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol “BCryptFinishHash” in Funktion ““private: static class std::vector<unsigned char,class std::allocator > __cdecl web::http::oauth1::experimental::oauth1_config::_hmac_sha1(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &,class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &)” (?_hmac_sha1 @ oauth1_config @ experimental @ oauth1 @ http @ web @ @ CA?AV?$vector @ EV?$allocator @ E @ std @ @ @ std @ @ AEBV?$basic_string @ _WU?$char_traits @ _W @ std @ @ V?$allocator @ _W @ 2 @ @ 7 @ 0 @ Z)”. [C:\Projekte\Cpp\dev\Miele_Oculus\build\app\MIELE_OCULUS_Executable.vcxproj]
[build] cpprest142_2_10.lib(oauth1.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol “BCryptDestroyHash” in Funktion ““private: static class std::vector<unsigned char,class std::allocator > __cdecl web::http::oauth1::experimental::oauth1_config::_hmac_sha1(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &,class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &)” (?_hmac_sha1 @ oauth1_config @ experimental @ oauth1 @ http @ web @ @ CA?AV?$vector @ EV?$allocator @ E @ std @ @ @ std @ @ AEBV?$basic_string @ _WU?$char_traits @ _W @ std @ @ V?$allocator @ _W @ 2 @ @ 7 @ 0 @ Z)”. [C:\Projekte\Cpp\dev\Miele_Oculus\build\app\MIELE_OCULUS_Executable.vcxproj]
[build] cpprest142_2_10.lib(http_client_winhttp.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol “__imp_WinHttpSetStatusCallback” in Funktion ““void __cdecl std::_Destroy_in_place(class web::http::client::details::winhttp_client &)” (??$_Destroy_in_place @ Vwinhttp_client @ details @ client @ http @ web @ @ @ std @ @ YAXAEAVwinhttp_client @ details @ client @ http @ web @ @ @ Z)”. [C:\Projekte\Cpp\dev\Miele_Oculus\build\app\MIELE_OCULUS_Executable.vcxproj]
[build] cpprest142_2_10.lib(http_client_winhttp.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol “__imp_WinHttpGetDefaultProxyConfiguration” in Funktion ““protected: unsigned long __cdecl web::http::client::details::winhttp_client::open(void)” (?open @ winhttp_client @ details @ client @ http @ web @ @ IEAAKXZ)”. [C:\Projekte\Cpp\dev\Miele_Oculus\build\app\MIELE_OCULUS_Executable.vcxproj]
[build] cpprest142_2_10.lib(http_client_winhttp.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol “__imp_WinHttpOpen” in Funktion ““protected: unsigned long __cdecl web::http::client::details::winhttp_client::open(void)” (?open @ winhttp_client @ details @ client @ http @ web @ @ IEAAKXZ)”. [C:\Projekte\Cpp\dev\Miele_Oculus\build\app\MIELE_OCULUS_Executable.vcxproj]
[build] cpprest142_2_10.lib(http_client_winhttp.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol “__imp_WinHttpCloseHandle” in Funktion ““void __cdecl std::_Destroy_in_place(class web::http::client::details::winhttp_client &)” (??$_Destroy_in_place @ Vwinhttp_client @ details @ client @ http @ web @ @ @ std @ @ YAXAEAVwinhttp_client @ details @ client @ http @ web @ @ @ Z)”. [C:\Projekte\Cpp\dev\Miele_Oculus\build\app\MIELE_OCULUS_Executable.vcxproj]
[build] cpprest142_2_10.lib(http_client_winhttp.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol “__imp_WinHttpConnect” in Funktion ““protected: unsigned long __cdecl web::http::client::details::winhttp_client::open(void)” (?open @ winhttp_client @ details @ client @ http @ web @ @ IEAAKXZ)”. [C:\Projekte\Cpp\dev\Miele_Oculus\build\app\MIELE_OCULUS_Executable.vcxproj]
[build] cpprest142_2_10.lib(http_client_winhttp.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol “__imp_WinHttpReadData” in Funktion ““private: static void __cdecl web::http::client::details::winhttp_client::completion_callback(void *,unsigned __int64,unsigned long,void *,unsigned long)” (?completion_callback @ winhttp_client @ details @ client @ http @ web @ @ CAXPEAX_KK0K @ Z)”. [C:\Projekte\Cpp\dev\Miele_Oculus\build\app\MIELE_OCULUS_Executable.vcxproj]
[build] cpprest142_2_10.lib(http_client_winhttp.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol “__imp_WinHttpWriteData” in Funktion "“public: void __cdecl <lambda_35fd11593e92fc746a6952dcd3f7df9a>::operator()(class Concurrency::task)const " (??R<lambda_35fd11593e92fc746a6952dcd3f7df9a> @ @ QEBAXV?$task @ _K @ Concurrency @ @ @ Z)”. [C:\Projekte\Cpp\dev\Miele_Oculus\build\app\MIELE_OCULUS_Executable.vcxproj]
[build] cpprest142_2_10.lib(http_client_winhttp.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol “__imp_WinHttpQueryDataAvailable” in Funktion ““private: static void __cdecl web::http::client::details::winhttp_client::read_next_response_chunk(class web::http::client::details::winhttp_request_context *,unsigned long,bool)” (?read_next_response_chunk @ winhttp_client @ details @ client @ http @ web @ @ CAXPEAVwinhttp_request_context @ 2345 @ K_N @ Z)”. [C:\Projekte\Cpp\dev\Miele_Oculus\build\app\MIELE_OCULUS_Executable.vcxproj]
[build] cpprest142_2_10.lib(http_client_winhttp.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol “__imp_WinHttpQueryOption” in Funktion ““private: static class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > __cdecl web::http::client::details::winhttp_client::get_request_url(void *)” (?get_request_url @ winhttp_client @ details @ client @ http @ web @ @ CA?AV?$basic_string @ _WU?$char_traits @ _W @ std @ @ V?$allocator @ _W @ 2 @ @ std @ @ PEAX @ Z)”. [C:\Projekte\Cpp\dev\Miele_Oculus\build\app\MIELE_OCULUS_Executable.vcxproj]
[build] cpprest142_2_10.lib(http_client_winhttp.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol “__imp_WinHttpSetOption” in Funktion ““protected: unsigned long __cdecl web::http::client::details::winhttp_client::open(void)” (?open @ winhttp_client @ details @ client @ http @ web @ @ IEAAKXZ)”. [C:\Projekte\Cpp\dev\Miele_Oculus\build\app\MIELE_OCULUS_Executable.vcxproj]
[build] cpprest142_2_10.lib(http_client_winhttp.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol “__imp_WinHttpSetTimeouts” in Funktion ““protected: unsigned long __cdecl web::http::client::details::winhttp_client::open(void)” (?open @ winhttp_client @ details @ client @ http @ web @ @ IEAAKXZ)”. [C:\Projekte\Cpp\dev\Miele_Oculus\build\app\MIELE_OCULUS_Executable.vcxproj]
[build] cpprest142_2_10.lib(http_client_winhttp.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol “__imp_WinHttpOpenRequest” in Funktion ““protected: virtual void __cdecl web::http::client::details::winhttp_client::send_request(class std::shared_ptr const &)” (?send_request @ winhttp_client @ details @ client @ http @ web @ @ MEAAXAEBV?$shared_ptr @ Vrequest_context @ details @ client @ http @ web @ @ @ std @ @ @ Z)”. [C:\Projekte\Cpp\dev\Miele_Oculus\build\app\MIELE_OCULUS_Executable.vcxproj]
[build] cpprest142_2_10.lib(http_client_winhttp.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol “__imp_WinHttpAddRequestHeaders” in Funktion ““protected: virtual void __cdecl web::http::client::details::winhttp_client::send_request(class std::shared_ptr const &)” (?send_request @ winhttp_client @ details @ client @ http @ web @ @ MEAAXAEBV?$shared_ptr @ Vrequest_context @ details @ client @ http @ web @ @ @ std @ @ @ Z)”. [C:\Projekte\Cpp\dev\Miele_Oculus\build\app\MIELE_OCULUS_Executable.vcxproj]
[build] cpprest142_2_10.lib(http_client_winhttp.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol “__imp_WinHttpSendRequest” in Funktion ““private: void __cdecl web::http::client::details::winhttp_client::_start_request_send(class std::shared_ptr const &,unsigned __int64)” (?_start_request_send @ winhttp_client @ details @ client @ http @ web @ @ AEAAXAEBV?$shared_ptr @ Vwinhttp_request_context @ details @ client @ http @ web @ @ @ std @ @ _K @ Z)”. [C:\Projekte\Cpp\dev\Miele_Oculus\build\app\MIELE_OCULUS_Executable.vcxproj]
[build] cpprest142_2_10.lib(http_client_winhttp.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol “__imp_WinHttpSetCredentials” in Funktion ““private: static bool __cdecl web::http::client::details::winhttp_client::handle_authentication_failure(void *,class std::shared_ptr const &,unsigned long)” (?handle_authentication_failure @ winhttp_client @ details @ client @ http @ web @ @ CA_NPEAXAEBV?$shared_ptr @ Vwinhttp_request_context @ details @ client @ http @ web @ @ @ std @ @ K @ Z)”. [C:\Projekte\Cpp\dev\Miele_Oculus\build\app\MIELE_OCULUS_Executable.vcxproj]
[build] cpprest142_2_10.lib(http_client_winhttp.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol “__imp_WinHttpQueryAuthSchemes” in Funktion ““private: static bool __cdecl web::http::client::details::winhttp_client::handle_authentication_failure(void *,class std::shared_ptr const &,unsigned long)” (?handle_authentication_failure @ winhttp_client @ details @ client @ http @ web @ @ CA_NPEAXAEBV?$shared_ptr @ Vwinhttp_request_context @ details @ client @ http @ web @ @ @ std @ @ K @ Z)”. [C:\Projekte\Cpp\dev\Miele_Oculus\build\app\MIELE_OCULUS_Executable.vcxproj]
[build] cpprest142_2_10.lib(http_client_winhttp.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol “__imp_WinHttpReceiveResponse” in Funktion ““private: static void __cdecl web::http::client::details::winhttp_client::completion_callback(void *,unsigned __int64,unsigned long,void *,unsigned long)” (?completion_callback @ winhttp_client @ details @ client @ http @ web @ @ CAXPEAX_KK0K @ Z)”. [C:\Projekte\Cpp\dev\Miele_Oculus\build\app\MIELE_OCULUS_Executable.vcxproj]
[build] cpprest142_2_10.lib(http_client_winhttp.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol “__imp_WinHttpQueryHeaders” in Funktion ““private: static void __cdecl web::http::client::details::winhttp_client::completion_callback(void *,unsigned __int64,unsigned long,void *,unsigned long)” (?completion_callback @ winhttp_client @ details @ client @ http @ web @ @ CAXPEAX_KK0K @ Z)”. [C:\Projekte\Cpp\dev\Miele_Oculus\build\app\MIELE_OCULUS_Executable.vcxproj]
[build] cpprest142_2_10.lib(http_client_winhttp.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol “__imp_WinHttpGetProxyForUrl” in Funktion ““protected: virtual void __cdecl web::http::client::details::winhttp_client::send_request(class std::shared_ptr const &)” (?send_request @ winhttp_client @ details @ client @ http @ web @ @ MEAAXAEBV?$shared_ptr @ Vrequest_context @ details @ client @ http @ web @ @ @ std @ @ @ Z)”. [C:\Projekte\Cpp\dev\Miele_Oculus\build\app\MIELE_OCULUS_Executable.vcxproj]
[build] cpprest142_2_10.lib(http_client_winhttp.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol “__imp_WinHttpGetIEProxyConfigForCurrentUser” in Funktion ““protected: unsigned long __cdecl web::http::client::details::winhttp_client::open(void)” (?open @ winhttp_client @ details @ client @ http @ web @ @ IEAAKXZ)”. [C:\Projekte\Cpp\dev\Miele_Oculus\build\app\MIELE_OCULUS_Executable.vcxproj]
[build] cpprest142_2_10.lib(http_client_winhttp.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol “__imp_CertFreeCertificateContext” in Funktion ““public: __cdecl web::http::client::details::winhttp_cert_context::~winhttp_cert_context(void)” (??1winhttp_cert_context @ details @ client @ http @ web @ @ QEAA @ XZ)”. [C:\Projekte\Cpp\dev\Miele_Oculus\build\app\MIELE_OCULUS_Executable.vcxproj]
[build] cpprest142_2_10.lib(http_client_winhttp.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol “__imp_CertGetCertificateChain” in Funktion ““public: void __cdecl web::http::client::details::winhttp_request_context::on_send_request_validate_cn(void)” (?on_send_request_validate_cn @ winhttp_request_context @ details @ client @ http @ web @ @ QEAAXXZ)”. [C:\Projekte\Cpp\dev\Miele_Oculus\build\app\MIELE_OCULUS_Executable.vcxproj]
[build] cpprest142_2_10.lib(http_client_winhttp.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol “__imp_CertFreeCertificateChain” in Funktion ““public: __cdecl web::http::client::details::winhttp_cert_chain_context::~winhttp_cert_chain_context(void)” (??1winhttp_cert_chain_context @ details @ client @ http @ web @ @ QEAA @ XZ)”. [C:\Projekte\Cpp\dev\Miele_Oculus\build\app\MIELE_OCULUS_Executable.vcxproj]
[build] cpprest142_2_10.lib(http_client_winhttp.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol “__imp_CertVerifyCertificateChainPolicy” in Funktion ““public: void __cdecl web::http::client::details::winhttp_request_context::on_send_request_validate_cn(void)” (?on_send_request_validate_cn @ winhttp_request_context @ details @ client @ http @ web @ @ QEAAXXZ)”. [C:\Projekte\Cpp\dev\Miele_Oculus\build\app\MIELE_OCULUS_Executable.vcxproj]
[build] cpprest142_2_10.lib(http_client_winhttp.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol “CONF_modules_unload” in Funktion ““private: virtual void __cdecl std::_Ref_count::_Destroy(void)” (?_Destroy @ ?$_Ref_count @ Vdo_init @ openssl_init_base @ detail @ ssl @ asio @ boost @ @ @ std @ @ EEAAXXZ)”. [C:\Projekte\Cpp\dev\Miele_Oculus\build\app\MIELE_OCULUS_Executable.vcxproj]
[build] cpprest142_2_10.lib(http_client_winhttp.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol “ERR_reason_error_string” in Funktion "“public: virtual class std::basic_string<char,struct std::char_traits,class std::allocator > __cdecl boost::asio::error::detail::ssl_category::message(int)const " (?message @ ssl_category @ detail @ error @ asio @ boost @ @ UEBA?AV?$basic_string @ DU?$char_traits @ D @ std @ @ V?$allocator @ D @ 2 @ @ std @ @ H @ Z)”. [C:\Projekte\Cpp\dev\Miele_Oculus\build\app\MIELE_OCULUS_Executable.vcxproj]
[build] C:\Projekte\Cpp\dev\Miele_Oculus\build\bin\MIELE_OCULUS_Executable.exe : fatal error LNK1120: 38 nicht aufgelöste Externe [C:\Projekte\Cpp\dev\Miele_Oculus\build\app\MIELE_OCULUS_Executable.vcxproj]
[build] Der Build wurde mit dem Exitcode 1 abgeschlossen.

Hier ein Bild der Projekt-Struktur in VS Code 2019:

Im Projekt Verzeichnis befindet sich die im Screenshot zu sehende CMakeLists.txt.

In den Ordnern src, gui und app habe ich jeweils eine weitere CMakeLists.txt um die einzelen .o Datein zu builden.

src:
#-------ServerService----------------#####################################
add_library(${LIBRARY_NAME} OBJECT

"${PROJECT_SOURCE_DIR}/src/server.cpp"
"${PROJECT_SOURCE_DIR}/src/connection.cpp"

)
target_include_directories(${LIBRARY_NAME} PUBLIC

"${PROJECT_SOURCE_DIR}/include/"

)##########################################################################
#-------TANDEM_FABRIKAT----------------####################################
add_library(${LIBRARY_NAME_2} OBJECT

"${PROJECT_SOURCE_DIR}/src/fabrikat.cpp"

)
target_include_directories(${LIBRARY_NAME_2} PUBLIC

"${PROJECT_SOURCE_DIR}/include/"

)##########################################################################

gui:
#.ui File aus dem Qt designer importieren
set(sources “${PROJECT_SOURCE_DIR}/gui/mainwindow.ui” )
#MOC automatisch ausfuehren wenn diese in header oder bibliotheken benoetugt werden
set(CMAKE_AUTOMOC ON)

set(CMAKE_AUTORCC ON)
#UIC automatisch ausfuehren wenn ui und ui**.h exestieren um einen header fuer das UI zu generieren
set(CMAKE_AUTOUIC ON)

#-------Qt-Framework-GUI----------------###################################
add_library(${LIBRARY_NAME_3} OBJECT

"${sources}"   
"${PROJECT_SOURCE_DIR}/gui/mainwindow.cpp"

)
target_include_directories(${LIBRARY_NAME_3} PUBLIC

"C:/Qt/5.15.1/msvc2019_64/include/QtWidgets"    
"C:/Qt/5.15.1/msvc2019_64/include/QtGui"   
"C:/Qt/5.15.1/msvc2019_64/include/"   
"${PROJECT_SOURCE_DIR}/include/"

)##########################################################################

app:
#Ausfuehrbare Datei erstellen##############################################
add_executable(${MAIN} WIN32

"${PROJECT_SOURCE_DIR}/app/main.cpp" 

)##########################################################################
#librarys für ausführbares programm linken#################################
target_link_libraries(
${MAIN} PUBLIC
${LIBRARY_NAME}
${LIBRARY_NAME_2}
${LIBRARY_NAME_3}
Qt5::Widgets
Qt5::Core
cpprest142_2_10
WS2_32
)##########################################################################

@marc.chevrier IIRC, you understand German?

What I think is missing is a Core component in the find_package? It appears that moc is not being run on the MainWindow class somehow?

Hi Ben,

sorry I forgot to translate it :o.
I used set(CMAKE_PREFIX_PATH " … /cmake/Qt5") to my Qt installation dir.
I have read that I do not need find_package cause my enviroment var. of Qt is not fine.

You still need find_package(Qt5) so that CMake knows to look for it.

I think you’re confusing two things though. “Prefixes” and “roots” are the equivalent of CMAKE_INSTALL_PREFIX. I suspect that you want CMAKE_PREFIX_PATH to be the one which contains lib in your there. What you have is suitable for Qt5_DIR though.

In My CMakelist at the main directory at line 19 (Screenshot) I have the find_package(Qt5 Required Widgets) command

Not at all. :persevere:

You do not use the Qt targets correctly. You must link all libraries to Qt, not just the executable unless you make all libraries STATIC.

Something like this is wrong and indicates the problem:

target_include_directories(${LIBRARY_NAME_3} PUBLIC
"C:/Qt/5.15.1/msvc2019_64/include/QtWidgets"    
"C:/Qt/5.15.1/msvc2019_64/include/QtGui"   
"C:/Qt/5.15.1/msvc2019_64/include/"

This must be replaced by target_link_libraries.

And something like
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
should by the top-level for all targets, not just gui.

OK thanks,

i changes my CMakeLists in gui to this:
#.ui File aus dem Qt designer importieren

set(sources "${PROJECT_SOURCE_DIR}/gui/mainwindow.ui" )

#-------Qt-Framework-GUI----------------###################################

add_library(${LIBRARY_NAME_3} OBJECT

     

    "${sources}"   

    "${PROJECT_SOURCE_DIR}/gui/mainwindow.cpp"

       

)

target_link_libraries(${LIBRARY_NAME_3} 

    Qt5::Widgets 

)

And this

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)

is now in my top-level CMakeList.

Also I delete the targe_link_libraries

Qt5::Widgets 
Qt5::Core 

from my app CMakeList.

But now the compiler does not find the header files anymore e.g. mainwindow.h :confused:

I also added this part to the CMakelists.txt in gui:

target_include_directories(${LIBRARY_NAME_2} PUBLIC

"${PROJECT_SOURCE_DIR}/include/"

)

To find the mainwindow.h which is in the include directory.
But also does not work

Why would you delete the Qt5:: targets from target_link_libraries? They need to be linked to from any target (library or executable) using Qt5 libraries.