Am running QTCreator and Ubuntu developer. How to ??

Asked by harrison

I need C++11 support from the g++ but can't find where to add the -std c++11 command. The Ubuntu system is fairly sophisticated and the make file is very evident. That doesn't help me address the compiler to get it to support C++11.
I regularly use code""blocks and am familiar with the C++11 requirements. All I need to know is how to enable the compiler to follow the c++11 guide.

Thanks for previous recommendations on QT 4 and 5. Looks like I can do it with the Ubuntu developer and QT Creator,

Best

Captain Harry

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Rusty Shackleford
Solved:
Last query:
Last reply:
Revision history for this message
Rusty Shackleford (shackleford071250) said :
#1

It should just take inclusion of -std=gnu++11 when you invoke the compiler. For example:
g++ -std=gnu++11 MyCode.cpp -o MyApp

Revision history for this message
harrison (kapthari) said :
#2

Thanks Rusty, I'll try it.

Best

Capt Harry

On Sat, May 9, 2015 at 10:16 PM, Rusty Shackleford <
<email address hidden>> wrote:

> Your question #266718 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/266718
>
> Status: Open => Answered
>
> Rusty Shackleford proposed the following answer:
> It should just take inclusion of -std=gnu++11 when you invoke the
> compiler. For example:
> g++ -std=gnu++11 MyCode.cpp -o MyApp
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
> https://answers.launchpad.net/ubuntu/+question/266718/+confirm?answer_id=0
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/ubuntu/+question/266718
>
> You received this question notification because you asked the question.
>

Revision history for this message
harrison (kapthari) said :
#3

[image: Inline image 1]
Thanks again. Here is the working pro file for Creator C++

Best
Capt Harry

On Sun, May 10, 2015 at 10:51 AM, harrison <
<email address hidden>> wrote:

> Your question #266718 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/266718
>
> Status: Answered => Open
>
> You are still having a problem:
> Thanks Rusty, I'll try it.
>
> Best
>
> Capt Harry
>
>
> On Sat, May 9, 2015 at 10:16 PM, Rusty Shackleford <
> <email address hidden>> wrote:
>
> > Your question #266718 on Ubuntu changed:
> > https://answers.launchpad.net/ubuntu/+question/266718
> >
> > Status: Open => Answered
> >
> > Rusty Shackleford proposed the following answer:
> > It should just take inclusion of -std=gnu++11 when you invoke the
> > compiler. For example:
> > g++ -std=gnu++11 MyCode.cpp -o MyApp
> >
> > --
> > If this answers your question, please go to the following page to let us
> > know that it is solved:
> >
> https://answers.launchpad.net/ubuntu/+question/266718/+confirm?answer_id=0
> >
> > If you still need help, you can reply to this email or go to the
> > following page to enter your feedback:
> > https://answers.launchpad.net/ubuntu/+question/266718
> >
> > You received this question notification because you asked the question.
> >
>
> --
> You received this question notification because you asked the question.
>

Revision history for this message
Rusty Shackleford (shackleford071250) said :
#4

My previous answer was for direct invocation of g++ in a make file.

I'm not able to see the pro file you reference.

Check out this link:
http://stackoverflow.com/questions/16948382/how-to-enable-c11-in-qt-creator

It suggest two possible solutions to enabling c++11 support in a .pro file:
CONFIG += c++11
for Qt 5

or
QMAKE_CXXFLAGS += -std=c++11 (or QMAKE_CXXFLAGS += -std=c++0x
for Qt 4.8 and gcc/clang.

Revision history for this message
harrison (kapthari) said :
#5

Sok it works fine! The 'pro' file is the main project file for the project.
Thanks again.

On Sun, May 10, 2015 at 2:26 PM, Rusty Shackleford <
<email address hidden>> wrote:

> Your question #266718 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/266718
>
> Status: Open => Answered
>
> Rusty Shackleford proposed the following answer:
> My previous answer was for direct invocation of g++ in a make file.
>
> I'm not able to see the pro file you reference.
>
> Check out this link:
> http://stackoverflow.com/questions/16948382/how-to-enable-c11-in-qt-creator
>
> It suggest two possible solutions to enabling c++11 support in a .pro file:
> CONFIG += c++11
> for Qt 5
>
> or
> QMAKE_CXXFLAGS += -std=c++11 (or QMAKE_CXXFLAGS += -std=c++0x
> for Qt 4.8 and gcc/clang.
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
> https://answers.launchpad.net/ubuntu/+question/266718/+confirm?answer_id=3
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/ubuntu/+question/266718
>
> You received this question notification because you asked the question.
>

Revision history for this message
Best Rusty Shackleford (shackleford071250) said :
#6

Glad I could help.
Pleased mark this question as solved by clicking the link given for confirming the answer.

Revision history for this message
harrison (kapthari) said :
#7

Thanks Rusty Shackleford, that solved my question.