[Qt-creator] Adding header files
Alex T.
dioxinu at gmail.com
Fri Jul 23 13:49:42 CEST 2010
You need to learn how the compiler looks for headers. In you case, you
specified -IC:\boost, now when you do #include <some_header.h> the compiler
will look for it in all directories passed to it via -I switch. If you
#include <view.hpp> it will not find it, because view.hpp is in
C:\boos\multi_array. So, you need to write
#include <multi_array/view.hpp>
On 23 July 2010 14:45, Jothy <jothybasu at gmail.com> wrote:
> I simply added INCLUDEPATH += -I C:\boost
>
> Now its able to find all the header files except file path starting with
> boost/
>
> Should I add C:\boost to system path?
>
> Thanks,
>
> Jothy
>
>
>
> On Fri, Jul 23, 2010 at 12:39 PM, André Pönitz <andre.poenitz at nokia.com>wrote:
>
>> On Friday 23 July 2010 11:53:31 ext Jothy wrote:
>> > Hi Guys,
>> >
>> > I am trying to use boost header files with a simple Qt project in Qt
>> creator. By right clicking "Add existing files" in the headers (in the
>> project files view), I added few boost headers.
>> >
>> > And the pro file look like this
>> >
>> > QT += core gui
>> >
>> > TARGET = untitled8
>> >
>> > TEMPLATE = app
>> >
>> > SOURCES += main.cpp\
>> >
>> > widget.cpp
>> >
>> >
>> > HEADERS += widget.h \
>> >
>> > ../../Boost/multi_array/view.hpp \
>> > [..]
>> > FORMS += widget.ui
>> >
>> >
>> > Now, how should I add in the widget.cpp file. It does not show any of
>> the hpp files after typing #include<, I even tried #include<Boost/
>>
>> You should not list the boost headers in HEADERS, but add a suitable path
>> to INCLUDEPATH, like
>>
>> INCLUDEPATH += $$PWD/../../Boost
>>
>> or
>> INCLUDEPATH += $$PWD/../..
>>
>> Andre'
>> _______________________________________________
>> Qt-creator mailing list
>> Qt-creator at trolltech.com
>> http://lists.trolltech.com/mailman/listinfo/qt-creator
>>
>
>
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-creator
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-creator-old/attachments/20100723/7e57711b/attachment.html
More information about the Qt-creator-old
mailing list