News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Problem including header files in codeblocks QT4 Windows xp [Screenies Posted]

Started by adityagameprogrammer, February 23, 2011, 07:52:46 AM

Previous topic - Next topic

adityagameprogrammer

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

adityagameprogrammer

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....

oBFusCATed

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
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

adityagameprogrammer

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

search directory settings

global variable settings

header file open error

oBFusCATed

(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

adityagameprogrammer

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
// .......



oBFusCATed

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...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

adityagameprogrammer

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.

oBFusCATed

It depends on the way the library is build and structured.
The QT guys have their reasons to use 3 headers ...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]