I'm currently working on Ubuntu 20.04 and I am building a web application with WebToolkit. I want to use a Postgresql database to store my data. I built Wt from source, following these steps.
Unfortunately, when I include the header file Wt/Dbo/backend/Postgres.h in my code, I get the following error
cannot open source file Wt/Dbo/backend/Postgres.h
Indeed, the directory Wt/Dbo/backend includes only Sqlite3.h and WDboSqlite3DllDefs.h.
How can I solve the problem?
It seems you haven't build the
Postresbackend while buildingWtfrom source. This may be due one of the following reasons:ENABLE_POSTGRESis not checked while configuringWtusingCMakePostgres, is not met. This should be mentioned in the cmake output. It may be necessary to specify thePostgresdirectory in thePOSTGRES_PREFIXvariable ofCMake.Note that
sqlite3is the only backend which is supported without external dependencies.Note that the same procedure should be followed for other database too, such as
MySQL(orMariaDB),Firebird, ...