Re: [fpc-pascal] bridging an C++ shared library statically

2013-09-23 Thread Sven Barth
Am 23.09.2013 10:53, schrieb Michael Schnell: On 09/21/2013 04:04 PM, Xiangrong Fang wrote: Hi All, I need to use a C++ so file in FreePascal AFAIK, you only can use C++ libraries in Pascal, if the functions for the mutual interface are "flat" C function (i. e. ANSI C functions not using an

Re: [fpc-pascal] bridging an C++ shared library statically

2013-09-23 Thread Michael Schnell
On 09/21/2013 04:04 PM, Xiangrong Fang wrote: Hi All, I need to use a C++ so file in FreePascal AFAIK, you only can use C++ libraries in Pascal, if the functions for the mutual interface are "flat" C function (i. e. ANSI C functions not using any C++ classes). Of course, on top of this in bo

Re: [fpc-pascal] bridging an C++ shared library statically

2013-09-22 Thread Xiangrong Fang
> > Have you tried to pass options to the linker using -k? > That worked, thanks. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] bridging an C++ shared library statically

2013-09-22 Thread Mattias Gaertner
On Sun, 22 Sep 2013 10:01:40 +0800 Xiangrong Fang wrote: >[...] > {$linklib :thostmduserapi.so} >[...] > How to let ld look for library WITHOUT lib prefix? Have you tried to pass options to the linker using -k? Mattias ___ fpc-pascal maillist - fpc-

Re: [fpc-pascal] bridging an C++ shared library statically

2013-09-21 Thread Xiangrong Fang
> > > 1) Did you give the correct name ? 2) Is the current dir in the linker > search path ? AFAIK the current dir is by default not in the linker search > path. > I am sure the name is correct. No matter I supply the linker path (-Fl.) or not, it does not work (i.e. ld reported cannot find -ltho

Re: [fpc-pascal] bridging an C++ shared library statically

2013-09-21 Thread Michael Van Canneyt
On Sat, 21 Sep 2013, Xiangrong Fang wrote: Ok, but when I added these: implementation {$linklib libthostintf.a} {$linklib thostmduserapi.so} end. I got: /usr/bin/ld: cannot find -lthostmduserapi All the required .so and .a file are in CURRENT dir. 1) Did you give the correct name ? 2)

Re: [fpc-pascal] bridging an C++ shared library statically

2013-09-21 Thread Xiangrong Fang
Ok, but when I added these: implementation {$linklib libthostintf.a} {$linklib thostmduserapi.so} end. I got: /usr/bin/ld: cannot find -lthostmduserapi All the required .so and .a file are in CURRENT dir. 2013/9/21 Michael Van Canneyt > > > On Sat, 21 Sep 2013, Xiangrong Fang wrote: > >

Re: [fpc-pascal] bridging an C++ shared library statically

2013-09-21 Thread Michael Van Canneyt
On Sat, 21 Sep 2013, Xiangrong Fang wrote: Hi All, I need to use a C++ so file in FreePascal.   I have written a C wrapper for it, which successfully connected to Pascal. Now my question is, can I use the $linklib directive to link the C-Wrapper STATICALLY, which in-turn use the shared so

[fpc-pascal] bridging an C++ shared library statically

2013-09-21 Thread Xiangrong Fang
Hi All, I need to use a C++ so file in FreePascal. I have written a C wrapper for it, which successfully connected to Pascal. Now my question is, can I use the $linklib directive to link the C-Wrapper STATICALLY, which in-turn use the shared so file? I tried to do this but it complained a lot