Hi. I was trying to compile C codes for Gumstix, and after I made it and tempted to run it on a Linux machine first for testing, it gives me the 'segmentation fault (core dump)' error, also warns me about 'gets' when I was making the file.
There's two possibilities in my code that could have generated this. The first is the linked list I wrote, which creates structures in memory, and the second is another structure I made to get the current time. Whenever the linked list is at a certain capacity, I will NULL the upcoming linked list, have my pointers go back to start, and have a while to loop until I see a NULL linked list.
The code works fine when compiled and run in Windows, compiles in Linux and gives me the 'don't use gets' warning, but will not run at all in Linux. I'm just wondering about where I did wrong and how should I chato nge it to fix the problem.
If anyone wants more detailed codes, please either send me an email, or mention it when answering the question.
All new Yahoo! Mail
Get news delivered. Enjoy RSS feeds right on your Mail page.
From: Dave Hylands <dhylands@gm...> - 2007-04-05 06:40:14
HI Yu-Chen Shih,
On 4/4/07, Yu-Chen Shih <yuchen_shih@...> wrote:
> Hi. I was trying to compile C codes for Gumstix, and after I made it and
> tempted to run it on a Linux machine first for testing, it gives me the
> 'segmentation fault (core dump)' error, also warns me about 'gets' when I
> was making the file.
If you compiled it using the cross compiler then you can only run in
on the processor it was compiled for. You linux pc is probably an
Intel x86 based machine. You can't run programs compiled for the ARM
to run on the PC.
If you compiled it using gcc (native compiler) and you're trying to
run it on your desktop linux, then you probably have a bug in the
You'd need to show us the code.
Vancouver, BC, Canada