<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hello everybody.<br><br>Ok, i jump...<br><br>I decide to begin the conversion of a unit (wrapper to other libraries + lot of functions who link those libraries) into a universal fp library.<br><br>After Googling a while (and finding very poor doc, only few for Delphi, with always the hypra-simple same example...), i do not find how to do with classes...<br><br>Here a test (who gives me error)...<br>__________________________________________<br>library libtest;<br><br>uses<br> Classes, ctypes, Math, SysUtils; <br><br>type<br> TMyClass = class(TThread)<br> public<br> enabled1: boolean;<br> int1, int2: shortint; <br> function function1(): integer; cdecl; <br> end;<br><br>function TMyClass.function1(): integer; cdecl; <br>begin<br>if enabled1 then<br>result := int1 + int2 else result := -1;<br>end; <br><br>exports<br> TMyClass.function1(); <br><br>end.<br>_______________________________________________________<br><br>Stop compil showing error at dot of function TMyClass.<br><br>=> libtest.pas(14,18) Fatal: Syntax error, ":" expected but "." found<br><br>PS : I promise, if i can do the conversion, to create a nice wiki, for dummies like me : "How to create a universal (complicated) library with fpc"...<br> </div></body>
</html>