Environment Var Issue



  • Hello,

    I am a brand new -QT- Qt user and having issues with running the .exe of the app I just created. Here is an image showing that the variable that the .exe is complaining about is in the directory that the path is set to. Is there something I'm missing? Thanks!

    !http://i55.tinypic.com/2utkqh2.png(screenshot of problem)!

    Edit: It is QT, not QT, as is explained in the text in the top; Andre



  • You need to make sure that all the library files that your application depends on can be found by the application. One way (not the only one) is to copy all these files to the same directory as your executable. the mingw dll is one of those, but so are the Qt dlls for the modules your application uses. Note that your screen shot shows the build settings, not the run settings. These may or may not be the same.



  • I just slowly added the .dll that gave errors until i got to this point. Thank you for moving the thread to an appropriate category.

    !http://i56.tinypic.com/dy82af.png(Image)!



  • I think you have picked the wrong version of the Qt dlls. Note that your SDK installation contains (at least) two versions. You need the one from here: C:\Qt\SDK1.1\Desktop\Qt\4.7.3\mingw\bin (depending on where you installed Qt your path may differ of course, of course.)



  • I just pulled all of them from that directory and seem to be getting the same thing. :(

    !http://i54.tinypic.com/25fox09.jpg(SC)!



  • Can you try running Dependency Walker on your application to see which dependencies your application has? You can post a screenshot of the dwi file here if you want us to take a look at the dependencies.



  • Ok I ran dependency walker on the .exe if that is correct and got this:

    !http://i54.tinypic.com/ibxtzc.png(pic)!



  • Ok, so it looks like your MSVC redistributables are not found. Find these files (correct verions), and put them in a place your application can find them.

    However, could you check what compiler toolchain you are actually using? It seems that you are using MSVC after all, and not mingw. You can check that in the Project tab in Creator.



  • [quote author="Andre" date="1304400423"]Ok, so it looks like your MSVC redistributables are not found. Find these files (correct verions), and put them in a place your application can find them.[/quote]

    No, MSVCRT is normally found via the manifest, so inside the winsxs directory, when the dll is build via MSVS tool chain. Also it would be interesting, on which way the msvcrt comes into the game, so which dll depends on it?

    Then open the manifest of the file (it can be extracted using mt.exe or using MSVS) and check the needed version of the msvcrt.



  • Can you also check the View/Full paths option in Dependency Walker? That way you will be able to see the full path of the Qt dlls, and can see if the correct ones are being picked up. Can you post a screenshot with the full paths? When looking at your current screenshot, then it looks like the incorrect QtGui is being picked up because it has a different link time than the QtCore one. The one for QtGui is before Qt 4.7.3 was released. The problem seems to be that QtCore and QtGui do not match, but if you show the full paths then this will be more visible.







  • Hi,

    I think your problem is, that you have QtCreator in the path, before your current Qt version you use. You see it, as the QtGui comes from:

    c:\qtsdk\qtcreator\bin\qtgui4.dll, your QtCore comes from c:\users...

    try putting all QtLibs you need beside your executable.



  • Or you can put the Qt version in c:\users...first in your global PATH and restart Qt Creator, that should ensure that the correct Qt dlls are being picked up. Then ensure you are using the "Qt in PATH" option in QtCreator.



  • Apparently my "Qt in PATH" isn't found?

    !http://i51.tinypic.com/6se4o4.png(path)!



  • Did you add yourQtVersion/bin first to the global PATH in your Control Panel/System/ Advanced System Settings/Environment Variables? And then restart Creator after having done so?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.