Hi,
I have recently started using the code blocks IDE and have found it to be absolutely amazing. I am to work on QT on windows xp . so have set up the environment. I am having trouble configuring the include files
A major part of the problem as i understand is not configuring the library paths properly....
#include <QApplication>
#include <QFont>
#include <QPushButton>
/*
// The Libraries wont open..
#include <QReadWriteLock>
#include <QWaitCondition>
#include <QStringList> // also for QString & QList
#include <QThread>
#include <QMutex>
#include <QDate>
#include <QSize>
#include <QPair>
#include <QMap>
#include <QSet>
*/
int main(int argc, char* argv[])
{
QApplication app(argc, argv);
QPushButton quit("Quit");
quit.resize(75, 30);
quit.setFont(QFont("Times", 18, QFont::Bold));
QObject::connect(&quit, SIGNAL(clicked()), &app, SLOT(quit()));
quit.show();
return app.exec();
}
This program runs when there are only the default 3 libraries.
the libraries are present in
Quote
C:\Qt\2010.05\qt\include\QtCore
C:\Qt\2010.05\qt\include\Qt
C:\Qt\2010.05\qt\include\QtGui
How do i set these libraries in the project....
Project -> Build options -> Search Dirs -> Include for the include paths
Project -> Build options -> Search Dirs -> Libs for the libs paths
Take a look at the global variables, they are made for such things/setups
I have done the same but the problem persists. I even tried clicking on the header file and trying to open it through code blocks. but i get an error stating that the file is not found. I have taken screen shots of the linker settings , search directories, global variables and the error. kindly let me know what i seem to be missing.
linker settings
(http://www.fileden.com/files/2009/12/29/2706571/My%20Documents/Linker.JPG)
search directory settings
(http://www.fileden.com/files/2009/12/29/2706571/My%20Documents/searchDirectories.JPG)
global variable settings
(http://www.fileden.com/files/2009/12/29/2706571/My%20Documents/globalVariables.JPG)
header file open error
(http://www.fileden.com/files/2009/12/29/2706571/My%20Documents/error.JPG)
Read this: http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F
And post pasted logs, not screen shots (using code tags).
some how enabling the "Full command line" option in compiler logging seems to have .. worked a bit.
the build log is as below
Build started on: 23-02-2011 at 15:27.44
Build ended on: 23-02-2011 at 15:27.46
-------------- Build: Debug in qt_test ---------------
mingw32-g++.exe -Wall -g
-IC:\Qt\2010.05\qt\include
-IC:\Qt\2010.05\qt\include\QtGui
-IC:\Qt\2010.05\qt\include\QtCore
-IC:\Qt\2010.05\qt\include\Qt
-IC:\Qt\2010.05\qt\include\QtCore
-IC:\Qt\2010.05\qt\include\Qt
-IC:\Qt\2010.05\qt\include\QtGui
-c D:\Aditya\CodeBlocks\qt_test\main.cpp -o obj\Debug\main.o mingw32-g++.exe
-LC:\Qt\2010.05\qt\lib -o bin\Debug\qt_test.exe obj\Debug\main.o -lQtCore4 -lQtGui4
Output size is 180.75 KB
Process terminated with status 0 (0 minutes, 1 seconds)
0 errors, 0 warnings
But i get a couple of redirection in between when i try to open a header file. in the sense it wont open directly but opens 2 in between files to finally get to the header file..
#include <QThread>
a file QThread opens up containing
#include "qthread.h"
and i click qthread.h again here i get a file qthread.h opening up
containing
#include "../../src/corelib/thread/qthread.h"
finally clicking qthread.h here opens up the required header file
#ifndef QTHREAD_H
#define QTHREAD_H
#include <QtCore/qobject.h>
#include <limits.h>
QT_BEGIN_HEADER
// .......
(http://www.fileden.com/files/2009/12/29/2706571/My%20Documents/qthread.JPG)
Quote from: adityagameprogrammer on February 23, 2011, 11:17:01 AM
But i get a couple of redirection in between when i try to open a header file. in the sense it wont open directly but opens 2 in between files to finally get to the header file..
This is QT thing, no C::B problem...
Thanks
is that the way it usually works? I had assumed it is to do with again with linking .. or some setting in C::B.
It depends on the way the library is build and structured.
The QT guys have their reasons to use 3 headers ...