Closed LSG8 closed 2 years ago
Are you linking taopq to your application? This library is not header-only.
In the project properties section of visual studio, I have put the include directory of taopq under the 'Additional Include Directories' section. Then in the Linker properties, I have put the lib directory of taopq under the 'Additional Library Directories' section. Is anything else needed?
Yes, you need to actually link the library, so add the library to the list of linked libraries. I only know how to do that in cmake. but with google you should find out how its done.
@LSG8 Is your issue resolved?
I am now directly using libpqxx instead of this. Though I think for this error, the suggestion from @emmenlau is important as well as checking the cmake build type for all third party library is also important. This way, I removed all errors from libpqxx. Anyway, you can close this issue.
I am new to c++ recently downloaded taopq for database connection to an existing cpp code I am using windows and vs2019 so, I have built taopq using cmakelist in vs2019 then included the tao/pq.hpp in my code from the introduction part of github page (https://github.com/taocpp/taopq), I tried to make a connection in my code const auto conn = tao::pq::connection::create("host=, port=, dbname=, user:");
whenever I try to build this, get the following error
error LNK2001: unresolved external symbol "public: static class std::shared_ptr __cdecl tao::pq::connection::create(class std::basic_string<char,struct std::char_traits,class std::allocator > const &)" (?create@connection@pq@tao@@SA?AV?$shared_ptr@Vconnection@pq@tao@@@std@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@5@@Z)
1>D:\Lahari\work\EQ\EQ C++ db\x64\Release\EQ.exe : fatal error LNK1120: 1 unresolved externals
1>Done building project "EQ.vcxproj" -- FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
any help??