The Issue
I'm trying to use lipqxx to interact with a PostgreSQL database. However, despite #include-ing pqxx, its namespace doesn't seem to be recognized and as such no pqxx functions are recognized. (simplified code with annotations of issue below:)
#include <iostream>
#include <pqxx/pqxx> // no errors indicated in Visual Studio (VS) here.
void Classname::operator() (){ // functor method implementation
using namespace std;
using namespace pqxx; // **red underline in Visual Studio indicating "name must be a namespace"**
try{
connection C("String text"); // **red underline in VS: "identifier 'connection' is undefined"**
}catch(const std::exception &e) {
cerr << e.what() << std::endl;
}
}
What I've done
Conclusion
I'd like the pqxx namespace to be properly recognized and am not sure where to go from here. I've been stuck on this for quite a while and would really appreciate some clear guiding steps on how to fix this.
Many thanks
I had the same problem after running:
vcpkg install libqpxx:x64-windows
Running (as administrator)
vcpkg integrate install
solved the issue for me