c++

what is the use of "make file" and gdb.how can put all my code into the gdb after compiling all my file with "make file".I am just confuse how to compile both with gdb option.
makefile is a automatic build system . Suppose that you are working in a big project
and everytime you make a change to your project have to recompile your sources ...
then what will happen if you have to compile them manually ? that is why you have a
makefile tool for this .but No matter you can compile the source using manually.

gdb is a debugger that you can debug your C++ source . But if you want to debug you should
include the -g when you compiling and linking.

just write a first program that prints helloworld and manually compile and link with the -g , and
just debug and see ....

to compile and link with the gdb option , use like this

#g++ -g -o first first.C

and then you can use the debugger gdb
#gdb ./first
GNU gdb 19990928

Copyright 1998 Free Software Foundation, Inc.

GDB is free software, covered by the GNU General Public License, and you are

welcome to change it and/or distribute copies of it under certain conditions.

Type "show copying" to see the conditions.

There is absolutely no warranty for GDB. Type "show warranty" for details.

This GDB was configured as "i686-pc-linux-gnu"...

(gdb)

and you will see this GDB prompt , there you can start debugging.
Thanx a lot sanzilla,,,,,,,but can you tell me if we use makefile then how to do.
Topic archived. No new replies allowed.