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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:41:09+00:00 2026-05-25T11:41:09+00:00

Some of the C code do not compile with C++ compiler if compiled as

  • 0

Some of the C code do not compile with C++ compiler if compiled as C++ files, due to the stricter type safety of C++. Is there any tool which takes the C code and generates a valid C++ code out of it. In other words, it adds to the C code what is required to make that code compile with a C++ compiler.

Note that I know that C and C++ code can be linked, but here I’m specifically talking about taking a C code and compiling it with a C++ compiler treating them as C++ code files.

  • 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-25T11:41:09+00:00Added an answer on May 25, 2026 at 11:41 am

    Try compiling with additional flags to make it less strict and/or a different compiler.

    Edit #1: I can’t add comments. I’m just throwing around ideas, I haven’t first-hand executed these. After a bit of digging around, you might be SOL depending on if the C code is written in part of the set that isn’t a subset of C++.

    If it’s just non-ansi C standard issues, you might be able to finagle it. If you’re using gcc, maybe try using Microsoft Visual C++ or OpenWatcom.

    As for the flags, I thought you could do leniency, but I could be wrong. The flags will depend on the compiler, I think I’ve used -std=isoC99, -compat, -feat=features.

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

Sidebar

Related Questions

I have some code that compiles and runs on MSVC++ but will not compile
I have some code which I did not originally create that uses _beginthreadex and
I've got some code which works fine in IE but unfortunately not in Google
I have some code here which works perfectly in firefox but not in chrome
I'm working with some code (not mine I hasten to add, I don't trust
Got some code that is not mine and its producing this warning atm: iehtmlwin.cpp(264)
Here is some code I could not get to format properly in markdown, this
I have some code that works fine in FF but not in IE. I
I have some not understanding actions from gnu clisp Suppose, I have some code
Lately I had to change some code on older systems where not all of

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.