Teen Programmers Unite  
 

 

Return to forum top

compiling multiple files with TC++

Posted by ra_apollo [send private reply] at May 03, 2002, 07:58:29 PM

i have a small piece of code for OOP, the class definition is saved in a .h(name.h) file and the complete function bodies are in a separate file and the main is also in a separate file. both are .cpp files. both have "name.h" included now i want to know how to compile the .cpp with function bodies and the main() .cpp together.

Posted by AREM [send private reply] at May 03, 2002, 09:45:54 PM

You can probably just compile the .cpp and include the header file like this. #include "header.h". If this doesn't work then you need to make a "make" file, or see if there's a way to add files to a project or something.

Posted by Psion [send private reply] at May 03, 2002, 10:02:43 PM

I can't say anyone respectable uses TC++ anymore. ;-) With something like gcc, you can either specify multiple .cpp source files at the command line, or you can compile them separately to .o files and link those.

Posted by RedX [send private reply] at May 04, 2002, 05:18:43 AM

If you use an IDE, put them in a project. then use the "build" command. How you do this exactly depends on the IDE you use.

RedX

Posted by ra_apollo [send private reply] at May 06, 2002, 05:15:20 AM

thanx ppl for yr response. i would like to know some lightweight new c++ compiler which can run preferably in DOS environment. currently i am working on turbo c++ ver3.0 by borland corp. 1990-92 edition, mainly because of my academic course. but i would love to shift to a more powerful platform for c++ development.

Posted by metamorphic [send private reply] at May 06, 2002, 05:57:31 AM

look in the thread about needing help with a c compiler. I posted a responce there

http://www.delorie.com/djgpp/

Posted by unknown_lamer [send private reply] at May 06, 2002, 08:08:09 AM

Why use djgpp when you have stuff like mingw and cygwin?

Posted by metamorphic [send private reply] at May 06, 2002, 09:29:56 AM

he asked for DOS

Posted by unknown_lamer [send private reply] at May 07, 2002, 08:07:02 AM

Cygwin operates in a terminal anyway, and should run better with XP.

You must be logged in to post messages and see which you have already read.

Log on
Username:
Password:
Save for later automatic logon

Register as a new user
 
Copyright TPU 2002. See the Credits and About TPU for more information.