Compilation

mikeshn

Senior member
Oct 9, 2001
367
0
0
I have two files. List.cxx and List.h. I really don't know how to compile it correct.

First of all I do g++ List.h and see the message that compilation of header file is complete. Than I write g++ List.cxx ? Does this statement is correct?

Can someone give me an advice?
Thanks a lot
 

stndn

Golden Member
Mar 10, 2001
1,886
0
0
*.h files are just header files --- they don't usually need to be compiled
*.cxx (i'm assuming it's c++ ?) are the ones that needs to be compiled

if you want List.h to be included in List.h, you will need this line somewhere on top of List.cxx:
#include "List.h"

that way, when you compile the file List.cxx, it will know to "read in" the definitions and contents of List.h, and will use them as necessary when you compile List.cxx

then just compile List.cxx using g++ List.cxx

good luck :)
-987-