[fpc-pascal]use of c++ libraries

Michael.VanCanneyt at Wisa.be Michael.VanCanneyt at Wisa.be
Wed Feb 19 22:19:21 CET 2003


On 19 Feb 2003, Olaf Leidinger wrote:

> Hello everybody!
>
> Let's say I've written a nice library in c++ and I'd like to use it in
> Free Pascal. The list archive sais that linking c++ libs (e.g. from gnu
> c++) isn't possible, yet - and using dynamic c++ libs isn't possible
> either.

This is correct. It isn't supported, and it is not likely to be supported in
the near future. It's a complicated issue, as there are no standards for
name mangling in C++, which makes linking to it dependent on the C compiler
version used to create the lib.

>   How far is this support by now? Does the cvs version have this feature
> (if yes when will be the release of a stable version )? Or are there any
> alternatives (instead of re-implenting this lib in pascal)?

Write a small C wrapper which you then call from Pascal. This is what e.g.
Kylix does to access Qt.

Michael.




More information about the fpc-pascal mailing list