compiling using borland or djgpp

hi to all
how could i compile more than one file using borland or
djgpp compiler for c++.
thanks in advance
egy1Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GloomyFriarCommented:
Add them to a project.
0
GloomyFriarCommented:
In bc31 'Project->Open Project'
0
bcladdCommented:
On the command line (using Borland 5.5 compiler) you can simply list all of the source files you want compiled and linked together:

    bcc32 myMain myDataStructure myPolynomialSolutionToTravellingSalesman

The resulting executable will have the name of the first source file (myMain.exe) or that set with the -o switch.

Alternatively, if you want to do smart recompiles (only make the files that are actually out of date) you can learn to use the make utility (I would urge you to look into getting a port of GNU make as it is powerful, fairly well documented, and free). A makefile is similar to a project file in an IDE.

Hope this helps, -bcl
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

egy1Author Commented:
thanks for replay
i'm a bigginer in compiling i know how to compile one file here is the command line
bcc32 -ic:borland\bcc55\ include -Lc:\borland\bcc55\lib file.cpp
but when i download a source code for a program i got many files some files have the .cpp and some other have .h extension
and other extension    .dsp     .dsw    .vbp all these file extension in the same package of the program source code so what is the command line i use to compile such a program.
thanks
0
bcladdCommented:
It looks like you have a MS VC.Net (or VC6) project. _IF_ it compiles with bcc, you'll want to list all of the .cpp files on the command-line.

    bcc32 -ic:borland\bcc55\ include -Lc:\borland\bcc55\lib firstFile.cpp secondFile.cpp thirdFile.cpp

There is one exception: If your project uses templates, some programmers put implementation for templated funcitons into a .cpp file and then #include the .cpp file back into the header file. You do NOT want such .cpp files compiled separately.

Note that since this is a MS project, there may be additional build steps that are not accomplished by a simple call to bcc32 ( resource file compilation comes to mind). Porting a package to/from the MS IDE can be a real challenge. Since you downloaded the package, you might want to see if the homepage for the package has any guidance (or already ported versions) available.

-bcl
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bcladdCommented:
I am sorry but all of the answers from experts were, at least potentially, correct. If the original poster has solved the problem in another way then it would be wonderful to see their solution (so that others could benefit by searching the PAQ database with this question in it). I would also be interested in which "expert's" comment pointed toward the solution (or none if there is another answer).  With that solution it would make sense to refund the points; without that solution it looks like the poster wanted to pick some brains and then not pay for the advice.

-bcl
0
egy1Author Commented:
i made my request before i got any comment but now there is no need for deleting this question.

0
egy1Author Commented:
u r so helpfull  bcladd
but the file with .h extension i think the compiler may need it in the code should i copy and past it in the library?
 in this case is the command line will be change?
0
bcladdCommented:
I am sure the .h file is important but it should NOT appear on the command line. If you downloaded a package the .h files may be in another directory. You will want to add that directory to the command-line using the -i parameter. So, if the package includes a /Src directory and a /Inc directory (could be /src and /include; you'll have to figure some of this out on your machine) and we are compiling in the Src directory (and the .h files are all in the Inc directory), the command-line above would change to

    bcc32 -ic:borland\bcc55\ include -i..\Inc -Lc:\borland\bcc55\lib firstFile.cpp secondFile.cpp thirdFile.cpp

There may be a required order for the source files (you probably want main() first and then the highest-level routines down to the lowest-level routines) so the linker can find the required functions.

Hope this helps, -bcl

PS - Sorry for being snippy when the request for deletion was processed. I am just annoyed with some people who do what I said above. My apologies for impuning your character.
0
egy1Author Commented:
many thanks again for your help
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.