[TriLUG] newbie question about g++

Ed Hill ed at eh3.com
Sat Dec 14 23:39:01 EST 2002


On Sat, 2002-12-14 at 20:51, ray bordt wrote:
> i have three files: dive.h, dive.cpp, and divemain.cpp
> i tried g++ -o divemain.o divemain.cpp and receive errors.
> dive.h is included in divemain.cpp and  dive.cpp.
> how can i compile dive.cpp and divemain.cpp at the same time?

Try:

  g++ -c -o dive.o dive.cpp
  g++ -c -o divemain.o divemain.cpp
  g++ -o diveprog  divemain.o dive.o 

and, assuming you don't need to link against anything else, that should
do it.

good luck,
Ed


-- 
Edward H. Hill III, PhD 
Post-Doctoral Researcher   |  Email:  ed at eh3.com,  ehill at mines.edu
Division of ESE            |  URLs:   http://www.eh3.com
Colorado School of Mines   |    http://cesep.mines.edu/people/hill.htm
Golden, CO  80401          |  Phones:  303-384-2094, 303-273-3483
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://www.trilug.org/pipermail/trilug/attachments/20021214/9ebe27da/attachment.pgp>


More information about the TriLUG mailing list