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

  • Home
  • SEARCH
  • 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 8048727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:34:11+00:00 2026-06-05T06:34:11+00:00

I’m using a specific toolchain (the one that comes with the BlackBerry Playbook NDK).

  • 0

I’m using a specific toolchain (the one that comes with the BlackBerry Playbook NDK). I think it’s based on GCC 4.4.2. When I try compiling certain libraries with this toolchain, I run into strange issues with what I think is c++ global namespace stuff. For example, I’ll get errors like:

'::sprintf' has not been declared

I never get these errors when linking against the GNU c++ standard library. However, the Playbook NDK uses the Dinkumware C++ libs by default and I always have to go through each error and usually add in the C equivalent (stdio.h in this case). For reasons beyond my control, I can’t link to the GNU c++ standard library, which doesn’t exhibit any of these problems.

If I’m trying to compile a bigger project, I can get hundreds of these errors. Is there a workaround that doesn’t involve editing the source? In the above example, the file would usually include “cstdio” as a header, but that declares sprintf under the ‘std’ namespace. So the only options I have are to include the C header or add the std namespace.

  • 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-05T06:34:13+00:00Added an answer on June 5, 2026 at 6:34 am

    Actually, the C++ standard mandates that all symbols declared in the Standard Library (which include the C Library in the <c....> headers) be accessible in the std:: namespace. It does not forbid them to also appear in the global namespace, and some implementations of the C++ Standard Library such as libstdc++ have chosen to let them there for backward compatibility reasons.

    You have several possibilities:

    • you can continue to include the C headers directly (like <stdio.h>) however it is generally discouraged as they may not be C++ aware and might create clashes (1)
    • you can prefix each call, though it may be impractical
    • you can cherry pick the symbols you use: using std::printf; either at the top of the file or within each function
    • you can bluntly put a using namespace std; directive. However you’ll be pulling a lot of stuff…

    My personal recommendation is to either prefix the call or cherry-pick the most used functions and import them in the global or current namespace.

    In terms of a migration, one blunt possibility is to actually “wrap” the standard headers:

    // cstdio.hpp
    
    #include <cstdio>
    
    #if defined(_DIRKUMWARE_) // note: you'll have to research the symbol to check
    namespace yournamespace {
        using std::printf;
        using std::vptrinf;
    } // namespace yournamespace
    #endif // defined(_DIRKUMWARE_)
    

    And then have a script replace all occurrences of <stdio.h> and <cstdio> in the code base by <cstdio.hpp> (apart in this file, obviously). This way you can tune this file for each implementation of the standard library, instead of repeating the work arounds in each and every file that includes those functions.

    Note (1): the C Standard does not mandate whether the functionality be provided by a function or a macro. Typically, min and max might be macros. The C++ Standard mandates functions, which is why using the C++ headers is normally safer.

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

Sidebar

Related Questions

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
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm making a simple page using Google Maps API 3. My first. One marker
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am doing a simple coin flipping experiment for class that involves flipping a

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.