# Qt and cpprestsdk

**URL:** <https://discourse.cmake.org/t/qt-and-cpprestsdk/2310>\
**Category:** Code\
**Tags:** os:windows, comp:msvc\
**Created:** [December 7, 2020, 5:18pm UTC](https://discourse.cmake.org/t/qt-and-cpprestsdk/2310 "2020-12-07T17:18:06Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![zombieanfuehrer](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/z/c6cbf5/32.png) [@zombieanfuehrer](https://discourse.cmake.org/u/zombieanfuehrer)\
**Post date:** [December 7, 2020, 5:18pm UTC](https://discourse.cmake.org/t/qt-and-cpprestsdk/2310/1 "2020-12-07T17:18:06Z")

</div>

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:

 ![Projekt_Struktur](https://discourse.cmake.org/uploads/default/original/2X/0/0f06b702703be8dcb3a19c2a48bc22e51ee63634.png)

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  
)##########################################################################

---

<div class="post-metadata">

**Author:** ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)\
**Post date:** [December 7, 2020, 5:55pm UTC](https://discourse.cmake.org/t/qt-and-cpprestsdk/2310/2 "2020-12-07T17:55:22Z")

</div>

@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?

---

<div class="post-metadata">

**Author:** ![zombieanfuehrer](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/z/c6cbf5/32.png) [@zombieanfuehrer](https://discourse.cmake.org/u/zombieanfuehrer)\
**Post date:** [December 7, 2020, 6:03pm UTC](https://discourse.cmake.org/t/qt-and-cpprestsdk/2310/3 "2020-12-07T18:03:42Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)\
**Post date:** [December 7, 2020, 6:20pm UTC](https://discourse.cmake.org/t/qt-and-cpprestsdk/2310/4 "2020-12-07T18:20:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![zombieanfuehrer](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/z/c6cbf5/32.png) [@zombieanfuehrer](https://discourse.cmake.org/u/zombieanfuehrer)\
**Post date:** [December 7, 2020, 6:42pm UTC](https://discourse.cmake.org/t/qt-and-cpprestsdk/2310/5 "2020-12-07T18:42:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![marc.chevrier](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@marc.chevrier](https://discourse.cmake.org/u/marc.chevrier)\
**Post date:** [December 7, 2020, 7:10pm UTC](https://discourse.cmake.org/t/qt-and-cpprestsdk/2310/6 "2020-12-07T19:10:43Z")

</div>

Not at all. 😣

---

<div class="post-metadata">

**Author:** ![hsattler](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/h/59ef9b/32.png) [@hsattler](https://discourse.cmake.org/u/hsattler)\
**Post date:** [December 7, 2020, 7:28pm UTC](https://discourse.cmake.org/t/qt-and-cpprestsdk/2310/7 "2020-12-07T19:28:42Z")

</div>

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:

```auto
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.

---

<div class="post-metadata">

**Author:** ![zombieanfuehrer](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/z/c6cbf5/32.png) [@zombieanfuehrer](https://discourse.cmake.org/u/zombieanfuehrer)\
**Post date:** [December 7, 2020, 8:05pm UTC](https://discourse.cmake.org/t/qt-and-cpprestsdk/2310/8 "2020-12-07T20:05:24Z")

</div>

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 😕

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

---

<div class="post-metadata">

**Author:** ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)\
**Post date:** [December 7, 2020, 10:39pm UTC](https://discourse.cmake.org/t/qt-and-cpprestsdk/2310/9 "2020-12-07T22:39:27Z")

</div>

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.
