This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Segmentation fault
- From: Lim Jiunn Bin <jblim at psl dot com dot sg>
- To: gcc-help at gcc dot gnu dot org
- Date: Sat, 17 Aug 2002 14:37:02 +0800
- Subject: Segmentation fault
Hi all,
I had compiled a C program under Soloris using gcc. But when I add a new
source file, test.c, i will get a segmentation fault error.
The source code can compile with gcc, "gcc -o test.o test.c" without any
problem. But if add the test.c to my Makefile, SSRCS variable and I
compile my program with make. I will get a segmentation fault error
after make try to link all object files. I had tried to debug the object
file which is generate by the make command. I cannot access to a
function in this object file (test.o) when i type "break function_name"
in gdb. I get a message from gdb, " Cannot access memory at 0x8". Why
this situation happen?
If a the my new function to a existing file, then there will have no
problem. Could anyone help me to solve this problem?
JB