On Thu, February 13, 2014 17:13, Sven Barth wrote: > Am 13.02.2014 17:04, schrieb Fred van Stappen: . . >> I resume: if i use cmem in uses section of uos library (without debug >> on) it compile but i get that error when a program call the library >> (at thread.terminate): >> >> Program received signal SIGSEGV, Segmentation fault. >> [Switching to Thread 0x7fffe859c700 (LWP 3289)] >> 0x00007fffefe08944 in ?? () >> from /home/fred/uoslib/examples/lib/Linux/64bit/libuos-64.so . . >> Here the uses section : >> uses >> {$IFDEF UNIX} >> cthreads, >> cwstring, {$ENDIF} >> cmem, // => debugger focus here, saying "Error: Duplicate >> identifier "cmem" ?? > compiler, not debugger >> ctypes, uos; > > Put cmem at the first location of the library's uses clause (before the > ifdef).
In addition, if that doesn't help, start your application with GDB ('gdb yourprogram'), 'run' it from there. After you get the SIGSEGV, request the backtrace (GDB command 'bt') to see the sequence leading to this situation. Observing the parameters may help in understanding what goes wrong (e.g. pointers containing a nil value where not expected or other senseless values not expected for real pointers, string parameters showing garbage, etc.). Tomas _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal