<div dir="ltr"><div><span style="font-family:courier new,monospace">Hi All,<br><br>I am writing pascal wrapper for a C library called "CTP", which is used in future trading. My project is here:<br><br><a href="https://github.com/xrfang/CTPas">https://github.com/xrfang/CTPas</a><br>
<br></span></div><span style="font-family:courier new,monospace">Compiling the interface file along is successful. While linking, fpc complains:<br><br></span><span style="font-family:courier new,monospace">./thostmduserapi.so, needed by ./libthost.so, not found (try using -rpath or -rpath-link)</span><div>
<span style="font-family:courier new,monospace"><br></span></div><div><span style="font-family:courier new,monospace">while libthost.so is my wrapper writting in C, which uses thostmduserapi.so, provided by the vendor (no source code).<br>
<br></span></div><div><span style="font-family:courier new,monospace">Full error output is:<br></span></div><div><span style="font-family:courier new,monospace"><br>Free Pascal Compiler version 2.6.2 [2013/03/17] for x86_64<br>
Copyright (c) 1993-2012 by Florian Klaempfl and others<br>Target OS: Linux for x86-64<br>Compiling demo.pas<br>Linking demo<br>/usr/bin/ld: warning: link.res contains output sections; did you forget -T?<br>/usr/bin/ld: warning: ./thostmduserapi.so, needed by ./libthost.so, not found (try using -rpath or -rpath-link)<br>
./libthost.so: undefined reference to `CThostFtdcMdApi::CreateFtdcMdApi(char const*, bool, bool)'<br>demo.pas(4,1) Error: Error while linking<br>demo.pas(4,1) Fatal: There were 1 errors compiling module, stopping<br>
Fatal: Compilation aborted<br>
Error: /usr/bin/ppcx64 returned an error exitcode (normal if you did not specify a source file to be compiled)</span><br><br></div><div>Could you please explain how to solve this problem?<br><br></div><div>Thanks!<br></div>
<div>Xiangrong<br></div></div>