Unsolved Cannot install postgreSQL driver
-
@paladinmain It looks like you're using Visual C++ compiler, is this correct? You not provide this information. So, which exact compiler and Qt version do you use?
-
Copied from the kits "Desktop Qt %{Qt:Version} MSVC2015 64bit" so yea msvc it seems
-
@paladinmain Did you install MSVC2015?
-
I have it installed, yes.
-
Hi and welcome to devnet,
To add to @jsulm, did you install the C++ components when installing VS2015 ? They are not selected by default.
-
Generally, you don't have to compile drivers for PostgreSQL.
There are steps to use PostgreSQL:- Add to your *.pro file this line:
QT += sql
- Copy to the folder with your application (exe) this folder:
%QTDIR%\plugins\sqldrivers
Especially files "qsqlpsql.dll" (for Release) and/or "qsqlpsqld.dll" (for Debug).
3. Copy to the folder with your application (exe) this files from PostgreSQL folder:libeay32.dll libiconv-2.dll libintl-8.dll libpq.dll ssleay32.dll
You can get them from zip archive of the binaries if you don't want to install PostgreSQL.
Note that you will need files for the same system version like your Qt version.
For example:
If you use MinGW32 (witch is only 32-bit) or MSVC x32 you need these files from 32-bit version of PostgreSQL.
If you use MSVC x64 you need these files from 64-bit version of PostgreSQL. -
on 2. , do you mean to copy the sqldrivers to the folder where i'm compiling my project or?
-
@paladinmain
Where your *.exe file will be. Something like this:.../ProjectRelease/project.exe .../ProjectRelease/sqldrivers/qsqlpsql.dll .../ProjectRelease/libpq.dll
-
Thanks for the quick replies.
I copied the dlls and the sqldrivers in the .pro folder and added the QT += sql in the .pro file. Did you mean to put them into the folder like that?
-
Just a small update.
I just gave up. Installed qt and postgresql on ubuntu and compiled the project with no problems. Guess I'll be finishing it on Ubuntu. Thanks for all the replies, guys.
-
@paladinmain
No. This is wrong folder.
Look one level up -> (for example) chess-game-Release\release
Or look from Qt Creator:
Projects -> Build Settings -> Build directory