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 3622758
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T23:17:57+00:00 2026-05-18T23:17:57+00:00

I have C headers which forward declare enums. Apparently, this is not possible in

  • 0

I have C headers which forward declare enums. Apparently, this is not possible in C++, so all of the pre-processor wraps of the form

extern "C" {
  #include <header.h>
}

are not going to help. Is there any way to include these headers in a C++ translation unit without requiring me to edit the C headers? Fortunately, modifying the C headers to avoid the forward declaration in this case is relatively painless, but this strikes me as being a pretty significant problem. In general, I had thought it was always possible to link against a C library from C++, but the inability to include the header seems to make that impractical in some cases.

Somewhat related questions:
71416
681243

  • 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-05-18T23:17:58+00:00Added an answer on May 18, 2026 at 11:17 pm

    Forward declared enums are available in C++0x. If your compiler doens’t support it yet, then wrapping enums in namespaces will avoid violation of ODR.

    P.S. a good explanation: http://www.devx.com/cplus/Article/42478/1954?pf=true

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

Sidebar

Related Questions

I am currently using the apaches mod_proxy/mod_proxy_http/mod_headers as a forward proxy to add (overwrite)
I put together some VBA code for Outlook 2007 which has been working predominantly
I have a tab control and when there are too many itmes, I get
I have some images without extension in their name. Now, when I want to
I have a table called Foo and I have two columns: Lorem and Ipsum,
I have been using Wireshark and I noticed that my plugin seem to track
I have an existing iPhone application, and I just wanted to make a static
Whenever a user clicks the row header, which selects the whole row (and highlights
I'm trying to do what craigslist's anonymous email does, but with Rails, also on
I'm helping put together a site that's going to host content for different regions

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.