[Development] QtCreator, non-Qt project, GCC and C++11 - Apologies for sending to wrong list

William Hallatt goblincoding at gmail.com
Tue Jun 3 09:24:09 CEST 2014


Morning everybody,

Yesterday was obviously not my day, apologies for sending the below to this
list.




On 2 June 2014 16:13, William Hallatt <goblincoding at gmail.com> wrote:

> Sorry, just realised that something went really wobbly in that loop copy
> and paste of mine, should be:
>
> int x[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
>
> for( auto i : x )
> {
>    int bob = 0;
> }
>
>
> On 2 June 2014 13:27, William Hallatt <goblincoding at gmail.com> wrote:
>
>> Hi everybody,
>>
>> Trying to set up a non-Qt project compatible with C++11 and using GCC,
>> but QtCreator keeps highlighting C++11 syntax with messages such as "auto'
>> is a C++11 extension".
>>
>> I am confident that my kits are set up correctly (building Qt
>> applications that use C++11 works fine). For the non-Qt project I am
>> trying, I have tried various combinations of adding
>>
>> CONFIG += c++11
>>
>> and/or
>>
>> QMAKE_CXXFLAGS += -std=c++11
>>
>> but no luck.
>>
>> GCC 4.7.3, Ubuntu 12.04, Qt 5.3, QtCreator 3.1.1 (for Linux 64 bit).
>>
>> FYI, I literally only created a new, non-Qt C++ project and have not
>> added any files, nor changed the .pro other than in the above manner.  The
>> only code I added to the generated main.cpp is
>>
>> for( auto x : 10 )
>> {
>>    int bob = 0;
>> }
>>
>> Your help would be greatly appreciated.
>> William.
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20140603/c9d3e54d/attachment.html>


More information about the Development mailing list