Главная страница | назад





Article #18809: Creating "C" programs with Builder?

 Question and Answer Database

FAQ3809C.txt   Creating "C" programs with Builder?
Category   :IDE
Platform    :Win95/NT
Product    :   C++Builder1.0   C++Builder3.x

Question:
How do I create a staright C program with CBuilder?

Answer:
BCB has a unique means of managing projects in that it uses
two text files; a .BPR ( a makefile ) and a .CPP, to hold settings,
flags, and files that you add to your project. The IDE is constantly
reading and writing these two project text files ( this is part of the
means of implementing RAD ).  One of the things the IDE expects
to find in the .CPP portion of the project is the word "main" and
it also expects/needs to find it in a file with a .CPP extension.

So, for you, to get a real "C" compile of your program that contains
main, just create a new console app ( no VCL ) and edit the .CPP to
look like the following:

#include 
#define main

( You want to define main before removing  the function main()
because, again, the IDE is reading this file constantly ).

Then do "Project | Add to Project" and select your .C file that has main
Now the BCB project source looks like the following and you can
edit your C code, compile, run and debug in the IDE.

#include 
USEUNIT("mymain.c");
#define main

12/30/99
 

Last Modified: 01-SEP-99