Link to home
Start Free TrialLog in
Avatar of Richard_Eustace
Richard_Eustace

asked on

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?
Avatar of kishk91
kishk91

If you using MS VC compiler then you must put befor every C function extern "C"

hope this helps..
kishk91
ASKER CERTIFIED SOLUTION
Avatar of nietod
nietod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Richard_Eustace

ASKER

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.
To kishk91. Do I type extern "C" or extern "C";
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

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

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.)