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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T14:25:08+00:00 2026-06-05T14:25:08+00:00

I have a mix of C C++ code. All compiled with g++. Wherever I

  • 0

I have a mix of C C++ code. All compiled with g++. Wherever I have C headers I have the contents of the header file included inside

#if defined(__cplusplus)
extern "C" {
#endif

and

#if defined(__cplusplus)
    extern "C" {
    #endif

But in one C header file I get g++ compilation errors where I have accidentally used a parameter name as template , which obviously is incorrect and in conflict with c++ keyword template.

I know I can go and change this parameter name, but I am thinking why is this extern "C" declaration not working and why is the header file considered as C++ code and not C as I intended to.

g++ version 4.1.1 Linux Red Hat Enterprise.

  • 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-05T14:25:09+00:00Added an answer on June 5, 2026 at 2:25 pm

    The extern "C" only tells the compiler (actually, the linker) that C++ name mangling doesn’t apply to the functions declared in that scope. It has nothing to do with the syntax or keywords themselves.

    Your best solution is to rename the conflicting symbols.

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

Sidebar

Related Questions

I have a code that is a mix of HTML and js. I cannot
Hello all i have the code below which produces four wheels each with the
I have a fairly extensive Sitemap defined, using a mix of static and dynamic
I have a source directory that includes a mix of different languages and files.
I have a varchar(100) column in a table that contains a mix of integers
I have two strings in a java program, which I want to mix in
What was the best video/session at Mix 2010? The videos have been put up
Having a bit of difficulty finding out the proper way to mix in code
I posted a question before but I am yet limited to mix the code
I have a legacy code to maintain and while trying to understand the logic

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.