Link to home
Start Free TrialLog in
Avatar of killer455
killer455

asked on

Compiling a class... command to do so.

I am compiling a class.

The files are as follows.
file1.cpp   // PROGRAM
file2.cpp   // class/methods  
file3.h     // .h file

Using the g++ compile what command would I use at the linux prompt to correctly compile this program.
g++ -o program file1.cpp file2.cpp file3.h     <---- ??

Or do I need to link them (-L) somehow?

Thanks for the help.

Ben
Avatar of DarthNemesis
DarthNemesis

your file1.cpp should have an #include "file3.h" and #include "file2.cpp" at the top.
ASKER CERTIFIED SOLUTION
Avatar of Kashra
Kashra

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of killer455

ASKER

Thanks a bunch, just what i needed.