Segmentation fault

When I run a simple ray tracing program under Mandrake 9.2, I got an error message saying “Segmentation fault”. This program runs perfectly with VC++.
Could anyone point out what might be the cause?
Thanks in advance

Segmentation faults are usually caused by the same thing that page faults are caused by in Windows. Touching memory in some way that you have no right to be touching it. (e.g. going beyond the bounds of an array, accessing a dangling pointer, writing to memory that only has read access, etc.)

Technically speaking Deiussum is right, but it could also be that you call a function with wrong parameters…

Try to run the program in a debugger to find out where the segfault is happening.

Originally posted by kmn2446:
When I run a simple ray tracing program under Mandrake 9.2, I got an error message saying “Segmentation fault”. This program runs perfectly with VC++.
Could anyone point out what might be the cause?
Thanks in advance

Somehow windows programs don’t run under linux and vice-versa. It’s generally a programmer’s fault.

Hope this helps.

Originally posted by jide:
[b] Somehow windows programs don’t run under linux and vice-versa. It’s generally a programmer’s fault.

Hope this helps.[/b]

Since he mentions VC++, I would assume he has source code and is compiling it separately for each OS and not trying to use the same binary for both.

Although, if he’s only compiling it with VC++ and expecting the .exe to run in Linux, you could be right here…

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.