Postgresql driver is not found
-
Can you show the code your are actually using to setup the database ?
The output you show does not present any error quite the contrary.
-
Can you show the code your are actually using to setup the database ?
The output you show does not present any error quite the contrary.
this->app_conn = QSqlDatabase(); this->app_conn.addDatabase(this->db_type); this->app_conn.setDatabaseName(this->db_name); this->app_conn.setHostName(this->db_host); this->app_conn.setPort(this->db_port); this->app_conn.setUserName(this->user_name); this->app_conn.setPassword(this->user_password);
this->db_type is "QPSQL".
-
You are using QSqlDatabase in the wrong manner.
addDatabase
is a static member, you are manipulating an invalid object.As the QSqlDatabase warns about: do not store local variables of that type. The class already provides everything needed to handle the objects you create from it.
-
You are using QSqlDatabase in the wrong manner.
addDatabase
is a static member, you are manipulating an invalid object.As the QSqlDatabase warns about: do not store local variables of that type. The class already provides everything needed to handle the objects you create from it.
-
What debug dll ?
-
Ah, you meant the content of the Debug folder.
One thing you can do is go in the Run part of the Project panel and modify the PATH environment variable to include the path to these dlls.
-
Ah, you meant the content of the Debug folder.
One thing you can do is go in the Run part of the Project panel and modify the PATH environment variable to include the path to these dlls.
-
On Windows there's two way to find .dlls:
- they are in the same folder
- they are in a folder in your PATH environment variable
Qt Creator does the change for Qt for you based on which kit you are using. Since you use external dependencies, it's up to you to provide a mean to find your dependencies dlls. And no, modifying your system's PATH environment is not the correct way.
-
@SGaist
I've made additional folder inside my project and move all DLLs into it. After that add path to this folder in PATH variable. It works but this method is crutch anyway…