Segmentation fault

Lim Jiunn Bin jblim@psl.com.sg
Fri Aug 16 23:39:00 GMT 2002


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



More information about the Gcc-help mailing list