This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]