May 9, 2012

Philili Philili
Lab Rat
12 posts

[SOLVED] (Beginner) Help for Installation of Qt 4.8.1

 

(I post here since my problem is more about installation.)
I’ve got problems for the installation on Windows 7, 32bits.
I ve downloaded the latest setup (1.7 Gb) and install the QtSDK. Now, I must set the right Path

I’ve tried:
in User variables :

  1. PATH :     C:\QtSDK\Desktop\Qt\4.8.1\msvc2010\bin;C:\QtSDK\Desktop\Qt\4.7.4\mingw\bin

and
  1. QTDIR :    C:\QtSDK\Desktop\Qt\4.8.1

and
  1. QMAKESPEC  : win32-g++
(don’t know whether it’s used)

like I’ve seen: http://sector.ynet.sk/qt4-tutorial/preparations.html

But apparently, I’m doing it wrong. When I build:

  1. The program has unexpectedly finished.
  2. C:\test\test2\debug\test2.exe exited with code -1073741511

Thanks for your help!

7 replies

May 9, 2012

sierdzio sierdzio
Area 51 Engineer
2544 posts

I’m not 100% sure, but it might be that the SDK sets the paths for you automatically.

Anyway, the program RUNS and crashes, which would indicate that everything is OK with paths. Could you provide the source of your app? It’s likely that the problem lies there.

Last question: are you using msvc compiler or mingw? You seem to be setting both in path, which might be dangerous.

 Signature 

(Z(:^

May 9, 2012

Philili Philili
Lab Rat
12 posts

Thanks for your help!
It’s only an Hello world test:
main.cpp

  1.  #include <QApplication>
  2.  #include <QPushButton>
  3.  
  4.  int main(int argc, char *argv[])
  5.  {
  6.      QApplication app(argc, argv);
  7.  
  8.      QPushButton hello("Hello world!");
  9.      hello.resize(100, 30);
  10.  
  11.      hello.show();
  12.      return app.exec();
  13.  }

test2.pro:

  1. SOURCES += \
  2.     main.cpp

I don’t know which compiler is used. I’m using Qt Creator and the Run function to test it for the moment. Which one should I keep?

May 9, 2012

sierdzio sierdzio
Area 51 Engineer
2544 posts

If you don’t know, then probably mingw is the way to go. MSVC is valid only when you are using Microsoft tools to compile and run your stuff. Clean msvc from path and see what happens (msvc and mingw libraries are NOT compatible, but will not rise errors during compilation, so it might be the cause of your problem).

Code looks OK. Just to be sure, add this to .pro>

  1. QT += core gui

 Signature 

(Z(:^

May 9, 2012

Sam Sam
Area 51 Engineer
628 posts

Hi,
You can try the following steps.

1. Goto you project folder, then delete the .pro.user file
2. Open QtCreator and then Goto File->Open.
3. Browse to your Project folder and then select the .pro file.
4. Then it will ask for Target Setup like this [imageshack.us]
5. Select the above option and rebuild again.

Try if this works!

May 9, 2012

Philili Philili
Lab Rat
12 posts

Thanks Sierdzio and Soumitra, it’s solved!
Except that I put mingw and not msvc in the Target Setup (and deleted the compile msvc in the path)
Everything is working now, thanks a lot!

May 9, 2012

Sam Sam
Area 51 Engineer
628 posts

You are welcome!!!

May 9, 2012

sierdzio sierdzio
Area 51 Engineer
2544 posts

Nice. Happy coding in Qt :)

 Signature 

(Z(:^

 
  ‹‹ build 32bit-only with qt 4.8.1 and xcode-4.3.2      Building QtWebKit2.2.0 on OS X 7.3 (Beginner) ››

You must log in to post a reply. Not a member yet? Register here!