LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-13-2012, 11:52 AM   #1
esgol
Member
 
Registered: Jul 2012
Posts: 106
Blog Entries: 1

Rep: Reputation: Disabled
Question c++11 std on g++4.7: gnu++11 vs c++11 - is there a difference?


In compiling concurent code from C++ 11 with g++ 4.7 [FINALLYY!!! <3 <3 <3 ] Debian Sweezzy gives me option for the std compiler beetween gnu+11 or c++11

Is there a difference or are they the same?

Any example code from my C++ concurency book compiles teh same without hits, including example that had problems previously with 4.4, and even 4.6.4

ALSO

in previous versions (g++4.4) i had to include in the command after std
-lpthread

Quote:
For forum's SE optimization
To compile a C++ 11 code in linux with g++ 4.4.5 type
g++ -std=gnu++0x -lpthread code.cpp -o runfile
what was that lpthread? i can stil put it with no effect. compile the same

Last edited by esgol; 07-13-2012 at 11:54 AM.
 
Old 07-13-2012, 03:36 PM   #2
serafean
Member
 
Registered: Mar 2006
Location: Czech Republic
Distribution: Gentoo, Chakra
Posts: 905
Blog Entries: 13

Rep: Reputation: 122Reputation: 122
Hi, from man gcc :
Quote:
c++11
The 2011 ISO C++ standard plus amendments. Support for C++11 is still experimental, and may change in incompatible ways in future releases.

gnu++11
GNU dialect of -std=c++11. Support for C++11 is still experimental, and may change in incompatible ways in future releases.
gnu++11 might allow some gnuisms. c++11 won't.

-lpthread must be used if you use the pthread (POSIX threads) specification for threading. Knowing that C++11 supports synchronization primitives, and that you're looking at using it, for portability I'd use std::thread. I'll admit not knowing the status of these new features in their GNU implementation, so proceed with care.

Serafean
 
1 members found this post helpful.
Old 07-14-2012, 03:56 AM   #3
esgol
Member
 
Registered: Jul 2012
Posts: 106
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
what are or could be gnuisms?
 
Old 07-14-2012, 05:36 AM   #4
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
See chapters 5 and 6 in the documentation (this link is for 4.7.1).
 
  


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
Template algorithm for std::vector and std::string CartmanYO Programming 4 09-08-2010 10:56 AM
License issue difference between The GNU Lesser General Public License and GNU tkmsr Linux - General 2 06-18-2010 02:21 PM
What's the difference between PMake and GNU Make? meili100 Programming 2 02-29-2008 10:31 AM
Could Someone Please Explain the Difference Between GNU and Linux? ECRocker General 20 05-25-2007 06:55 PM
What is the difference between Linux and GNU/Linux ? jalalmn Linux - General 9 03-11-2005 05:37 PM


All times are GMT -5. The time now is 11:19 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration