Click to See Complete Forum and Search --> : Gcc


Rainier
06-09-2006, 03:55 AM
Hello,
This is a very difficult problem to narrow down but still, here goes. The thing is I keep getting an error when I run a C program I compiled with gcc 4.0. The error is "segmentation fault". The thing is this very same program works without problems in Turbo C in Windows. I also tried compliling with tcc, g++ and gcc 3.4 but the same thing happens. Oh, I use kubuntu dapper!
Any help is appreciated.

Headfuzz
06-09-2006, 06:58 AM
I'm no code monkey but I can tell you a seg fault occurs when a program attempts to access restricted memory, so the problem lies in the initial source code I expect, which would explain why the program seg faults using several compilers.

I'm guessing your program is attempting to reference a memory address in use by Linux, which is not occupied when Windows is loaded.

The following might help:

http://en.wikipedia.org/wiki/Segmentation_fault

http://en.wikipedia.org/wiki/Gdb

Anyone feel free to correct me, I'm stumbling and as we all know, a little knowledge can be a dangerous thing... ;)

Rainier
06-09-2006, 01:24 PM
thoght it was a software problem...ok, thanks i'll look into it!