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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T09:50:30+00:00 2026-06-07T09:50:30+00:00

We have good code base in c. Now, we are moving to c++ for

  • 0

We have good code base in “c”. Now, we are moving to c++ for all new modules. I have a case to use few c++ classes in old c code base. Individually, both works i.e., c++ module and c module alone works and gives the desired o\p.

When, i mix them i.e., calling c++ classes in A.c, it throws tons of errors related to old code.

In our makefile.am, we earlier used to have an option cc=gcc, now we changed it to cc=g++ after it thrown few errors. The makefile.am with make at the end creates a lib, let us say libx.a. The makefile.am contains various earlier source files viz., A.c,x.c,y.c….

I fixed errors initially under A.c,x.c assuming that they are with new g++ compiler. Now,it started throwing errors under x.c, like this we have various source files.

Its very tedious to fix all of them. I believe iam missing some compiler flag options related to these errors. Now, majority of these errors are typecasting errors, where i converted them using static_cast etc. Apart from this, few misc errors. But, the code is a working code in c, its just mixing and changing makefile is throwing these errors.

Q:
1. How to get rid of those errors?
2. Is there any compiler flag which i need to use to continue working with minimal effort?
3. Is there some thing iam doing wrong in these process?
4. Any changes to makefile.am,you people suggest?

Any help on this is appreciated. If Q is not clear, please let me know.

Note: We run our app using autoreconf,configure and make.

Regards,
Santhosh

  • 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-07T09:50:32+00:00Added an answer on June 7, 2026 at 9:50 am

    make will use either $CC or $(CXX) depending on the extension of the files, and can use both at the same time. For example, files ending in *.cpp are compiled with $(CXX), files ending with *.c with $(CC). So you don’t have to set cc or CC globally to g++ unless your C code is suitably modified to be compiled as C++.

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

Sidebar

Related Questions

Can I have good example or code about how to use Ajax Datepicker in
We have a considerable code base with relatively high test coverage for pages/forms, all
I have this email sending code that does not show a chooser (good). How
I have the following piece of code (doesn't matter if it's a good method
We have quite a bit of reusable code at work (a good thing). Whenever
Good evening, I have been trying to wrap my head about this, below, code
I'm not good at t-sql, so I need help. I have this code I
Does gwt have (good) support for effects, moving around elements, and resizing them? Are
We have a large C code base that has been developed over several decades.
So we have a bunch of different processes setup in code right now. We

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.