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
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
your file1.cpp should have an #include "file3.h" and #include "file2.cpp" at the top.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks a bunch, just what i needed.