LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-24-2016, 04:12 PM   #1
pusrob
Member
 
Registered: Jan 2006
Distribution: Gentoo
Posts: 498

Rep: Reputation: 35
How to set C++11 as default in KDevelop 5?


Hi.

I have a rather irritating problem now, which I can't solve. The problem is, that I don't seem to find where to set the C++ standard to be used in KDevelop 5.

Upon the creation of the project, there is a window to make a build directory, where extra arguments can be passed. I added this to the extra arguments section: -std=c++11. It did not have any effect.

I also checked the project configuration window, where there is a language support section with a C/C++ parser tab. I have C++11 set as C++ Profile, but still no effect. When I try to build some source using C++11 features, I just get a message like this:
Code:
../main.cpp:10:57: error: in C++98 ‘usr_vec’ must be initialized by constructor, not by ‘{...}’
(I was trying to initialize a vector with some string values: vector<string> usr_vec = {"broccoli","eggplant","fish"})
So please could you tell me how to set KDevelop 5 to use >=C++11 as default? I would really appreciate that.

Thanks.

Last edited by pusrob; 10-24-2016 at 04:15 PM.
 
Old 10-26-2016, 05:41 AM   #2
a4z
Senior Member
 
Registered: Feb 2009
Posts: 1,727

Rep: Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742
what I remember kdevelop works only with cmake projects, so you need to configure your cmake project

either by passing CMAKE_CXX_FLAGS='-std=c++11' to the cmake call
or go into the build directory in a console and write
make edit_cache

toggle to advanced, by pressing t
than edit the CMAKE_CXX_FLAGS and add -std=c++11
 
Old 10-27-2016, 10:12 AM   #3
pusrob
Member
 
Registered: Jan 2006
Distribution: Gentoo
Posts: 498

Original Poster
Rep: Reputation: 35
Thanks a4z,

Adding -std=c++11 to CMAKE_CXX_FLAGS in the advanced configuration window really does seem to work. Nice...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
kdevelop, debugging - how to set a valid condition for a watchpoint? onufry Programming 4 07-17-2009 01:32 PM
grub-set-default ... get-default? RaduH Linux - General 1 11-21-2007 01:05 PM
link non-default libraries in KDevelop?? TLV Programming 3 12-14-2004 11:25 AM
Kdevelop: Changing my programs default "make install" dir DeTHZiT Programming 0 09-26-2004 01:06 PM
How to set the default WM beajedi Linux - General 6 02-20-2004 02:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration