[Qt-creator] Problem with file including
Ziller Eike
Eike.Ziller at theqtcompany.com
Mon Aug 3 14:09:58 CEST 2015
> On Jul 14, 2015, at 7:01 AM, André Hartmann <andre.hartmann at iseg-hv.de> wrote:
>
> Hi Pawel,
>
> Don't ask why, adding the current directory to project.includes helps :)
>
> project.includes:
>
> .
> common
>
>
> Anyway, don't know if this is worth a bug report.
The paths in there are relative to the _project_ directory, so ‘.’ resolves to 'project/.’
You have to explicitly add that to the project.includes like any other path, if you want it to be used as a include search path.
Br, Eike
> Best regards,
> André
>
>
> Am 13.07.2015 um 21:09 schrieb Pawel:
>> Hello,
>>
>> I want to reheat a problem which was issued some time ago but still
>> isn't fully solved. Maybe this is because on Linux this works correctly
>> and problem is on Windows.
>>
>> The problem is that QtCreator is not able to file included files when it
>> should. Below is simplest case which illustrates this.
>>
>> We have two source files:
>>
>> *main.cpp:*/
>> #include <common/header.h>
>>
>> int main()
>> {
>> A a;
>> a.fun();
>> }/
>> *
>> *
>> *header.h:*
>> /#ifndef HEADER_A_H
>> #define HEADER_A_H
>>
>> class A
>> {
>> public:
>> void fun()
>> {
>> }
>> };
>>
>> #endif/*
>> *
>> *
>> *
>> *
>> *
>> The directory structure looks like this:*
>> *
>> *D:*
>> *├───* *project
>> ├───**───* *common
>> │ header.h
>> * *├───**───* *src
>> main.cpp
>> *
>> *
>> *
>> From this I create the project using "Import Existing Project" and the
>> content of project files is as following:*
>> *
>> *
>> *
>> *project.config**
>> *
>> /// Add predefined macros for your project here. For example:
>> // #define THE_ANSWER 42/*
>>
>> *
>> *project.creator:
>> *
>> /[General]/
>> *
>> *
>> *project.files:
>> *
>> /common/header.h
>> src/main.cpp/*
>> *
>> *
>> *
>> *project.includes:
>> *
>> /common/*
>> *
>> *
>> *
>> *
>> *
>> So from this I would expect that QtCreator will searching the /common/
>> directory for include files (and this happens on Linux) but it doesn't.
>> Instead it just says: "'common/header.h' file not found".*
>> *
>>
>> I will be very thankful for any advise for to fix this.
>>
>> best regards
>> Pawel
>>
>>
>>
>> --
>> Using Opera's mail client: http://www.opera.com/mail/
>>
>>
>> ------------------------------------------------------------------------
>> Avast logo <http://www.avast.com/>
>>
>> This email has been checked for viruses by Avast antivirus software.
>> www.avast.com <http://www.avast.com/>
>>
>>
>>
>>
>> _______________________________________________
>> Qt-creator mailing list
>> Qt-creator at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/qt-creator
>>
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/qt-creator
--
Eike Ziller, Senior Software Engineer - The Qt Company GmbH
The Qt Company GmbH, Rudower Chaussee 13, D-12489 Berlin
Geschäftsführer: Mika Pälsi, Juha Varelius, Tuula Haataja
Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B
More information about the Qt-creator
mailing list