Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8833107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:41:59+00:00 2026-06-14T08:41:59+00:00

I’m using g++ 4.4 to compile a shared library on linux. I would like

  • 0

I’m using g++ 4.4 to compile a shared library on linux. I would like to use some C++11 features if I can in the library, but I cannot update the version of the compiler or require any special compiler switches for users of my library.

I have two questions and I’m having trouble finding a definitive answer.

  1. If I compile a shared library with -std=c++0x or -std=g++0x, am I guaranteed that a program that uses my library doesn’t need those switches (provided I have no c++0x features in the header files)? It seems to work, but I don’t want to be signing up for subtle problems down the road.

  2. The standard library for C++11 in g++ 4.4 is quite incomplete. Since much of the standard library is header-only and gnu’s header files are generally full of version ifdefs, I would think that there may be a way to use a more recent version of at least the header files in libstdc++. I can’t use a different .so for it, though. I’m sure I can kludge this together, but is it possible to do something like this correctly?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T08:42:00+00:00Added an answer on June 14, 2026 at 8:42 am

    1. If I compile a shared library with -std=c++0x or -std=g++0x, am I guaranteed that a program that uses my library doesn’t need those switches (provided I have no c++0x features in the header files)? It seems to work, but I don’t want to be signing up for subtle problems down the road.

    C++11 support was still experimental in GCC 4.x releases (it is no longer experimental from GCC 5 onwards). Although we tried to keep things working, the answer is no, you are not generally guaranteed that will work in all cases. There are a number of ABI changes caused by using -std=c++0x that could cause problems for programs that mix C++03 code and C++11 code, see http://gcc.gnu.org/wiki/Cxx11AbiCompatibility for more details. If your library doesn’t export any of the symbols described on that page then you should be fine.

    2. The standard library for C++11 in g++ 4.4 is quite incomplete. Since much of the standard library is header-only and gnu’s header files are generally full of version ifdefs, I would think that there may be a way to use a more recent version of at least the header files in libstdc++. I can’t use a different .so for it, though. I’m sure I can kludge this together, but is it possible to do something like this correctly?

    No, there is absolutely no chance whatsoever that will work. The headers from later versions use features not supported by 4.4, and even if you could use them you’d need to use the newer libstdc++.so. Just no.

    The headers are not full of version #ifdefs, almost the only ones you’ll find are checks for __GXX_EXPERIMENTAL_CXX0X__ which is defined by G++ when you use -std=c++0x but that doesn’t mean your 4.4 version supports lambdas, non-static data member initializers, proper rvalue reference semantics, default/deleted functions etc. that later headers make liberal use of. You must use libstdc++ headers with the same version of GCC they came with.

    In short, if you want proper C++11 support you need to use a newer compiler.

    If you can’t use a newer compiler you can’t get proper C++11 support.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
I would like to run a str_replace or preg_replace which looks for certain words
I would like to count the length of a string with PHP. The string
Seemingly simple, but I cannot find anything relevant on the web. What is the
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am reading a book about Javascript and jQuery and using one of the
link Im having trouble converting the html entites into html characters, (&# 8217;) i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.