I wrote a rather simple program named main.cpp, which is like the
follows:

int main()
{
    return 0;



}


And its Makefile is like the follows:

CCC=/opt/SUNWspro/bin/CC


DEBUG= -g


CFLAGS=$(DEBUG)


main  : main.o
        $(CCC) $(CFLAGS) $^ -o $@
main.o: main.cpp
        $(CCC) -c $(CFLAGS) -o $@ $?
clean:
        rm -f *.o
        rm main


After I type "make" on the screen, I got its executable file named
main.


But when I type "gdb main", I got:


GNU gdb 5.0
Copyright 2000 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 "sparc-sun-solaris2.6"...(no debugging
symbols found)...


So I cannot debug normally. But if I change CCC to g++, gdb can work
normally. So is the version of the compiler is crucial for gdb? And how

can I make gdb work normally? 


Thanks!

_______________________________________________
Help-gplusplus mailing list
Help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to