<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Am 13.02.2014 17:04, schrieb Fred van
Stappen:<br>
</div>
<blockquote cite="mid:DUB110-W54462C0C0514AFCC9312E3B89D0@phx.gbl"
type="cite">
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style>
<div dir="ltr">> Please provide a simple, self contained
example that shows this problem.<br>
<div> >Regards,<br>
>Sven<br>
<br>
Hello.<br>
<br>
Hum, i have done a simple library, with a thread and a simple
program calling this library.<br>
<br>
Not usefully to show it because, both using cmem are working
perfectly... ;-)<br>
<br>
So the problem is somewhere else.<br>
<br>
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):<br>
<br>
Program received signal SIGSEGV, Segmentation fault.<br>
[Switching to Thread 0x7fffe859c700 (LWP 3289)]<br>
0x00007fffefe08944 in ?? ()<br>
from
/home/fred/uoslib/examples/lib/Linux/64bit/libuos-64.so <br>
<br>
I have then try to compile uos library with that parameters
with debug :<br>
-MObjFPC -Scghi -O1 -gw2 -godwarfsets -gl -gv -Xg -gt -pg
-vewnhi <br>
<br>
and with cmem in uses section.<br>
<br>
And now, fpc refuse to compile, focusing at cmem in uses
section ! <br>
<br>
>> simpleplayer.lpr(7,8) Error: Duplicate identifier
"cmem"<br>
</div>
</div>
</blockquote>
-gv which enables valgrind profiling needs cmem, so the compiler
will include cmem and you did include cmem. Maybe this should be
checked somehow... I suggest you not to use -gv and -pg except for
profiling of performance or other things where you might need
profiling.<br>
<blockquote cite="mid:DUB110-W54462C0C0514AFCC9312E3B89D0@phx.gbl"
type="cite">
<div dir="ltr">
<div>I do not understand, i never declare cmem <span
id="result_box" class="short_text" lang="en"><span
class="hps">somewhere else</span></span>, why does the
debugger say me that ?<br>
</div>
</div>
</blockquote>
compiler, not debugger<br>
<blockquote cite="mid:DUB110-W54462C0C0514AFCC9312E3B89D0@phx.gbl"
type="cite">
<div dir="ltr">
<div>(and sure, that is the problem=>solution).<br>
<br>
Here the uses section :<br>
uses<br>
{$IFDEF UNIX}<br>
cthreads,<br>
cwstring, {$ENDIF}<br>
cmem, // => debugger focus here, saying "Error:
Duplicate identifier "cmem" ??<br>
</div>
</div>
</blockquote>
compiler, not debugger<br>
<blockquote cite="mid:DUB110-W54462C0C0514AFCC9312E3B89D0@phx.gbl"
type="cite">
<div dir="ltr">
<div> ctypes, uos; <br>
</div>
</div>
</blockquote>
<br>
Put cmem at the first location of the library's uses clause (before
the ifdef).<br>
<br>
Regards,<br>
Sven<br>
</body>
</html>