Compiling C using C++ Builder

I have a C program which I want to create a GUI for it, I have tried to compile it using C++ bulider but I dont know what i am doing.  It will compile in Borland C++ 4.5, can I open the project straight into C++ builder or do I have to change it.  Could someone tell me how to Compile C using C++ builder?
LVL 1
Richard_EustaceAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
nietodConnect With a Mentor Commented:
>> If you using MS VC compiler
????
"Compile C using C++ builder?"

The BC 4.5 _project_ is not compatible with the BCB _projects_.  But the source code will be compatible.  So you can't open the old project in Builder, but you can create a new project in builder and then copy in the source code file(s).

What type of program are you creating?  Is this an ordinary windows API program?  (i.e. it doesn't use MFC, VCL, OWL etc.)
0
 
kishk91Commented:
If you using MS VC compiler then you must put befor every C function extern "C"

hope this helps..
kishk91
0
 
Richard_EustaceAuthor Commented:
Do i start a new console project and add the .C files to it and compile it.  I have tried this and I get Lots of errors saying that a variable is assigned a value that is never used.  What am I doing wrong.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
Richard_EustaceAuthor Commented:
To kishk91. Do I type extern "C" or extern "C";
0
 
kishk91Commented:
Hi.. nonon you type extern "C" without ;

for example:
this is the declaration
extern "C" HWND Function() ;

and

extern "C" HWND Function()
{


}


thats it..
regards
kishk91

0
 
kishk91Commented:
Hi.. nonon you type extern "C" without ;

for example:
this is the declaration
extern "C" HWND Function() ;

and

extern "C" HWND Function()
{


}


thats it..
regards
kishk91

0
 
nietodCommented:
Sorry, I did not respond sooner.  I had computer problems and lost access to the net for over a week.  To make things worse I am leaving tomorrow for a week.  I will return Jan 2nd.

>> I have tried this and I get Lots of errors saying that
>> a variable is assigned a value that is never used.  
>> What am I doing wrong.
Often this is not an "error", it is simply a harmless mistake.  However, if you get a lot of them, it suggests that something is wrong.  Can you post some of the code that produces the error?  (I can't respond until the 2nd though.)
0
All Courses

From novice to tech pro — start learning today.