I've recently decided to try out PostgreSQL as the database platform for some C++ development I'm working on. I decided to use libpqxx as the connection library for my project, and quickly found out this would be an uphill battle to do from VS 2015 on a Windows 10 machine.
After much teeth-gnashing and nail-biting, I have gotten libpqxx to compile on Windows 10. This leaves me with the following directory structure
Per libpqxx's documentation, I also placed a copy of libpq.dll in my project's executable directory. Please note: I have done this for both debug and release builds, tried to build both, and ended up with the same result.
All the tutorials I've seen seem to indicate that the library can be used after linking it and simply #including pqxx/pqxx, so I set up a small project to do just that. I receive the error:
fatal error C1083: Cannot open include file: 'pqxx/pqxx': No such file or directory
When attempting to build the project. I have also tried this will both debug and release builds, to no avail.
Here is a screenshot of my linker settings.
Does anyone have any suggestions for how I might be able to link and use this library from Visual Studio 2015?
C:\libpqxx\lib
is not that folder. Is there aC:\libpqxx\include
? What folder contains the folderpqxx
? – drescherjm Jan 3 '16 at 18:43error LNK2019: unresolved external symbol PQconnectStart referenced in function "public: virtual struct pg_conn * __cdecl pqxx::connect_async::do_startconnect(struct pg_conn *)" (?do_startconnect@connect_async@pqxx@@UEAAPEAUpg_conn@@PEAU3@@Z).
There are 58 of them. – TheFrog Jan 3 '16 at 20:14