hi! What is makefile? How does it work? Is it done in the terminal? I am using Unix OS

>What is makefile?
Basically a list of instructions sent to the compiler/linker, including things such as the files to compile, paths, libraries, etc. You don't need one, but it sure beats typing out a long command everytime you want to compile your project.

>How does it work?
On *nix systems, you invoke the makefile with the [search]make[/search] command.

>Is it done in the terminal?
The file can be written in any text editor, but yes, you'll need a terminal to run make .

Here's some (rather a lot!) information on creating/using one:
http://www.mtsu.edu/~csdept/FacilitiesAndResources/make.htm

Additionally, if you decide to use an IDE such as [search]KDevelop[/search] or [search]Code::Blocks[/search], it will automatically generate a makefile for the project, saving you the trouble.

I am having trouble in compiling my c++ source codes.. Do you have any suggestions where I could find complete manuals in compiling c++ codes? thanks

>I am having trouble in compiling my c++ source codes
What are you trying to compile? Source code that you wrote? What errors came up?

>Do you have any suggestions where I could find complete manuals in compiling c++ codes?
You can always check out the Unix man pages of the varioius tools, such as gcc/g++, make, etc. Furthermore, if you can use an IDE, do it, because it saves you the trouble of dealing with makefiles (although it's still a good idea to learn both).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.