Important: Please read the Qt Code of Conduct -

[SOLVED]can't find the "src" directory to build my QPSQL driver

  • If you have installed with msvc2010 you cannot work with the 32-Bit postgres. I never worked with msvc2010.

  • ok i'll try with mingw32. thanks

  • Hi Clochydd, i've downloaded Qt with mingw32...
    About the #11 here is the error message i get: "cannot find file"

  • Hi k_arnaud, the message says that the project file for building the plugin cannot be found.
    Did you go to the plugins directory:
    8. cd QT_SRC_PATH\src\plugins\sqldrivers\psql
    If so, does the exist here?

  • after entering mingw32-make debug , in the unreadable message i get, i can see makefile:48: recipe for target 'debug' failed and i get the same with release

  • You should check your pathnames again - it seems that dependencies cannot be found. If you cannot find a fault: What is the unreadable message?

  • may be the problem is from here QTSDK_SQLDRIVERS_PATH=C:\Qt\Qt5.2.0\5.2.1\mingw48_32\plugins\sqldrivers i don't know wehter i should replace "QTSDK_SQLDRIVERS_PATH" with anything

  • Hi k_arnaud, with "set QTSDK_SQLDRIVERS_PATH=C:\Qt\Qt5.2.0\5.2.1\mingw48_32\plugins\sqldrivers" you create the environment-variable QTSDK_SQLDRIVERS_PATH, which you need later (#12.). Where appropriate you must modify the path itself - according to your system.
    These variables are for your comfort - you may use the complete pathname instead.

  • that is what i did, i entered QTSDK_SQLDRIVERS_PATH=C:\Qt\Qt5.2.0\5.2.1\mingw48_32\plugins\sqldrivers in the CMD-windows without any change

  • maybe a silly question: did you enter "set QTSDK..." and is that visible in your environment if you type SET in the cmd?

  • No, i ca'nt see that

  • But - do you use SET to bring it to the environment?

  • i tried again, and i can see the three variables; QTSDK_SQLDRIVERS_PATH, QT_SRC_PATH and

  • are you able to build the plugin now? You should not see the "recipe" message again.

  • sorry i can't. "qmake is not a command line", that is the error message when i try to buld with CMD-window. But when i try with the the "qt-cmd" i get the same error message "recipe..."

  • must be a wrong path, too:
    your_qt_path is something like C:\Qt\Qt5.2.1\5.2.1 and
    qmake.exe is located in your_qt_path\mingw48_32\bin
    so you must start qmake by:
    your_qt_path\mingw48_32\bin\qmake “INCLUDEPATH+=%POSTGRES32%\include” “LIBS+=%POSTGRES32%\lib\libpq.lib”

    when this task is done, you will continue with:
    mingw32-make debug
    mingw32-make release

  • here is the error message when i did what you said : cannot find file
    that file is not in the qmake.exe directory so when i enter cd C:\Qt\Qt5.2.1\5.2.1\mingw48_32\bin\qmake “INCLUDEPATH+=%POSTGRES32%\include” “LIBS+=%POSTGRES32%\lib\libpq.lib”, i get an error message

  • the is in the sources, in the plugin\sqldrivers directory (see above cd QT_SRC_PATH\src\plugins\sqldrivers\psql)
    you should start your qmake from THIS directory, not from the ...bin dir!

  • When i try to start qmake there, i get an error message "qmake is not a command line..."

  • Do you call qmake with the complete path:
    remember to use the path for your machine - maybe you have to modify slightly

  • always the same error "recipe for target 'debug' failed"

  • You must be sure, that all pathnames are correct and the commands are called from the right directories.

  • about "Program~2", for my system it is Program Files (x86). what shall i use ?

  • This follows the 8.3 format, a relict from DOS-times. I think you should use the same name but you can test it in the command window with cd.

  • both work, so i will use Program Files (x86)

  • Hi k_arnaud, you only need the 8.3 format if you have problems with building the plugins - as Windows may refuse to work with spaces in the pathnames.
    Did you succeed in building your plugin now?

  • Hi Clochydd, sorry i can't build the plugin. idon't know where the issue is from, thanks for the time you've spent on this thread

  • You are welcome! Shall we start another analysis of your problem?
    Will you post the the last error messages?

  • Hi Clochydd,
    always the same error message "recipe....failed",
    maybe i forgot something... but there's no configuration when you instal Qt

  • Hi k_arnaud, I will try to find more possible reasons for the message and come back with some new support.

  • Lifetime Qt Champion

    Currently, avoid spaces in path to libraries when developing. Or use the 8.3 names (you can check which one is correct using sir /x in a cmd prompt). To be on the safe side, reinstall PostgreSQL in a path without spaces. That will eliminate one possible source of problems. If the build fails again, then post the error log, it might give the clue to what you are missing.

    Also, ensure that you have a 32bit version of PostgreSQL installed since you are using the 32bit MinGW package.

  • Hi SGaist,
    i have a PostgreSQL 32bit installed. I try to instal an ohter, but the installer wizard doesn't allow me to choose my own directory, it updates the older which is in C:\Program Files (x86)\PostgreSQL... about to the error log, i don't know to post it. i think this site doesn't allow uploaded picture from computer ("i've printed my screen which shows the cmd with the error log")

  • You should uninstall your old version first and you can post a picture, too, if you use DropBox or similar. It's described "here: ":

  • ok, thanks ! i built the plugin(the problem was from the old version of my PostgreSQL, i couldn't edit the .h file you talked about).now the new issue is that i get this error message "The specified path was not found" when i enter copy release\libqsqlpsql.a QTSDK_SQLDRIVERS_PATH... just a precision: those files are in C:\Qt\Qt5.2.1\5.2.1\Src\qtbase\plugins\sqldrivers and i think they have just been created.the modification date is today on 3 pm

  • The plugins are built in directories release and debug. I suggest to search for these directories and if you find the newly created DLLs there copy these to QTSDK_SQLDRIVERS_PATH. If there are issues again please post your environment (set > env.txt) and your error messages

  • Hi Clochydd,
    I didn't see the plugins in the directories named "release" and "debug", but i found them here(based on the creation date which was 03:04pm(it was 03:04pm when i built the plugins)): C\Qt\Qt5.2.1\Src\qtbase\plugins\sqldrivers and i copied them manually(Ctrl+C...) to QTSDK_SQLDRIVERS_PATH.... about the env.txt file, i can't find it. Thanks !

  • Hi k_arnaud,

    sorry, it should read: set > env.txt - this creates the file env.txt which contains the entries like PATH etc.
    You may do it by set and copy and paste, too.

  • Hi Clochydd,
    i think the right files are the files i talk about, you know, the file i've found here: C\Qt\Qt5.2.1\Src\qtbase\plugins\sqldrivers

  • I understand you moved these to QTSDK_SQLDRIVERS_PATH already.
    If it still does not work, you may try this:

    Create a directory sqldrivers** in your app-directory (where your application's exe-file will be built: eg.: myBUILD\Debug\sqldrivers).
    and copy the dlls to this directory.
    If this does not work, a look at your environment may be useful.

  • here is my env.txt file "env.txt...":

Log in to reply