Connecting Tech Pros Worldwide Forums | Help | Site Map

problem with creating .exe file with multiple cpp files

Newbie
 
Join Date: Sep 2007
Posts: 6
#1: Jun 9 '09
hi all,

i am relatively new to C++ programming.

i downloaded a program from sourceforge and edited some of its cpp files, i was told that by changing the Makefile i will be able to create a .exe file with the combination of multiple .cpp, .h and .o files.

may i know how to go about changing the values of the Makefile?

please find attached documents as the Makefile of the program i downloaded.

please help and advise
Attached Files
File Type: zip Makefile.in.zip (9.3 KB, 13 views)

JosAH's Avatar
Expert
 
Join Date: Mar 2007
Posts: 10,611
#2: Jun 9 '09

re: problem with creating .exe file with multiple cpp files


Quote:

Originally Posted by calvinLYP View Post

hi all,

i am relatively new to C++ programming.

i downloaded a program from sourceforge and edited some of its cpp files, i was told that by changing the Makefile i will be able to create a .exe file with the combination of multiple .cpp, .h and .o files.

may i know how to go about changing the values of the Makefile?

please find attached documents as the Makefile of the program i downloaded.

please help and advise

That's a linker job: a compiler compiles source files and generates object files. A linker reads a bunch of object files (and libraries), links them and generates an executable file. There are no source file or header files in that executable file.

Header files tell the compiler what functions and data are stored in other object files. Those object files were once compiled (and most likely put in a library, ready to be linked by the linker).

The 'make' program (or whatever its name is) reads a makefile and automates the entire process of compilation and linkage.

kind regards,

Jos
Newbie
 
Join Date: Sep 2007
Posts: 6
#3: Jun 9 '09

re: problem with creating .exe file with multiple cpp files


Quote:

Originally Posted by JosAH View Post

That's a linker job: a compiler compiles source files and generates object files. A linker reads a bunch of object files (and libraries), links them and generates an executable file. There are no source file or header files in that executable file.

The 'make' program (or whatever its name is) reads a makefile and automates the entire process of compilation and linkage.

kind regards,

Jos

hi Jos,

is it to say that once i re-make the package again it will regenerate the new .exe file?

as in
1. /configure'

2. `make'

3. Type `make install' to install the programs and any data files and
documentation.

is it?
Reply