User forums > Using Code::Blocks

[Please Help]cant build QT4 application after installation.

(1/2) > >>

ko9ko9ko9:
Hi, i just getting into QT4/C++ and try to run the sample program from the code blocks template

After I installed everything it seems not working (cant build/run) :(

My OS: Windows XP Home Edition
Code Blocks Version i am using:codeblocks-1.0rc2.exe (without MinGw compiler)
Qt4 version:qt-win-opensource-4.2.1-mingw

I also set up my system environment variables (System Variable not User Variable):
Path : C:\Qt\4.2.1\bin;C:\MinGW\bin;C:\WINDOWS\System32
QMAKESPEC : win32-g++
QTDIR : C:\QT\4.2.1

Also after installation of both i went to the QT4 and build the debug library (took real long time) and restart.


The following are the error showing:

==================================================
Project   : QT Application
Compiler  : GNU GCC Compiler (called directly)
Directory : C:\Documents and Settings\John Chiu\My Documents\
--------------------------------------------------------------------------------
Switching to target: default
Linking executable: C:\Documents and Settings\John Chiu\My Documents\QTapp.exe
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw32\bin\ld.exe: cannot find -lQtAssistantClient
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
1 errors, 0 warnings

==========================================================



The Code i am using is the following:

=======================================================
#include <qstring.h>
#include <qapplication.h>
#include <qpushbutton.h>

int main(int argc, char **argv)
{
    QApplication    app(argc, argv);
    QPushButton     quit("Hello World!");
   
    quit.resize(300, 40);
    quit.setFont(QFont("Arial", 18, QFont::Bold));
    QObject::connect(&quit, SIGNAL(clicked()), &app, SLOT(quit()));
    quit.show();
   
    return app.exec();
}

======================================================


Can anyone tell me what went wrong? I think my installation is on right track right??.....or not ( :( :( :( :()



Please help me Please Please  :shock:

oz:
try a nightly build should work well, Qt4.2 has been changed compare with previous releases.

thomas:

--- Quote ---ld.exe: cannot find -lQtAssistantClient
--- End quote ---
Looks like you forgot to add a library path. Adding the correct path should make it work even with RC2 (although it is true that nightly builds work better).

MortenMacFly:
I wonder if the library "QtAssistantClient" exists at all?! The time RC2 came out there was no QT4 yet. And I believe these libs are now named something like "QtAssistantClient4" under Windows.
With regards, Morten.

oz:
Yes, Just add the $qt4.2/include/Qt* in your compiler path and the corresponding libs for your linker library, RC2 will be OK.

Navigation

[0] Message Index

[#] Next page

Go to full version