7 | | {{{ |
8 | | "But then I faced a tougher problem: I was getting a persistent segmentation fault when I ran it. gdb wasn't turning up the problem, either. |
9 | | |
10 | | The clue was in the compiler warnings: xgraph plays fast and loose with casting between addresses and integers. Sometimes that works, sometimes... So in desperation I checked the gcc man page and started reading, looking for an option which treated all integers as longs. I didn't think this would work, because external libraries might not cooperate. |
11 | | |
12 | | I didn't find it. But what I found instead was the "-m32" option to compile the code in 32-bit mode even on a 64-bit machine. Hmm... seemed promising. I added this to the head of the "CFLAGS" definition in Makefile (Makefile having been generated with "configure", so this isn't the best approach). I tried it and, ding-ding-ding-ding, the code ran. My little victory shout was probably out of place, since I was on Caltrain at the time... |
13 | | |
14 | | So now it works." |
15 | | }}} |
16 | | |
| 8 | > But then I faced a tougher problem: I was getting a persistent segmentation fault when I ran it. gdb wasn't turning up the problem, either. [[br]] |
| 9 | > [[br]] |
| 10 | > The clue was in the compiler warnings: xgraph plays fast and loose with casting between addresses and integers. Sometimes that works, sometimes... So in desperation I checked the gcc man page and started reading, looking for an option which treated all integers as longs. I didn't think this would work, because external libraries might not cooperate. [[br]] |
| 11 | > [[br]] |
| 12 | > I didn't find it. But what I found instead was the "-m32" option to compile the code in 32-bit mode even on a 64-bit machine. Hmm... seemed promising. I added this to the head of the "CFLAGS" definition in Makefile (Makefile having been generated with "configure", so this isn't the best approach). I tried it and, ding-ding-ding-ding, the code ran. My little victory shout was probably out of place, since I was on Caltrain at the time... [[br]] |
| 13 | > [[br]] |
| 14 | > So now it works. |