I want to know how to create a makefile so that I dont have to type in the files I am linking together. Also is it possible to use a make file which will run two files.
I have a fraction.h file and fraction.cxx (implentation file)
I have a main.cpp file (which has the int main)
I have a main-1.cpp file which also uses (the header and implementation file)
Can the two main files be used to create one makefile
You can only have one entry point in a program and that's usually the main function. If you only define main once in both main.cpp and main-1.cpp then yes you can compile them together.
Here's a short tutorial http://www.cs.umd.edu/class/spring2002/cmsc214/Tutorial/makefile.html
gerard4143
Nearly a Posting Maven
2,272 posts since Jan 2008
Reputation Points: 512
Solved Threads: 387