Just adding to my own comment, I've just remembered a problem I had with Oracle OCCI earlier this year and wondering why a (C++) program that used OCCI ran fine on CENTOS 6 would not run under Ubuntu 12.4 even though it compiled correctly. The build failed when the linker claimed it could not find the required entry point name.
The answer turned out to be an incompatible ABI change between gcc 4.4 (Centos 6) and gcc 4.6 (Ubuntu 12.4) and the Oracle supplied OCCI libraries were apparently compiled with the earlier version. In this case the problem was picked up by name mangling incompatibilities and which avoided a very long bug hunt. The new Firebird API is very similar to Oracle OCCI in concept except that the basic function "createEnvironment()" which in OCCI is used to kick the off the whole process is exported as C++ unlike fb_get_master_interface(), which is exported as extern 'C'. OCCI gives you more help when getting to typed data, but otherwise the concept is pretty similar for both APIs. On the other hand, as fb_get_master_interface() is exported as extern 'C', an incompatible ABI change will not be detected at build time. The moral is that if you are going to pass around pointers to C++ classes, it will only work reliably when the ABI of the library compiler and the application compiler are the same - but if you do this using extern 'C' functions you will not have any of the supporting checks that you get from name mangling. Is this really the basis of an API that should be complier neutral on the same platform? Tony Whyman MWA On 13/07/14 17:54, Tony Whyman wrote: > Well, I downloaded uibfblib.pas. and merged it into my test program. > Compiled it using FPC 2.6.4 under 64-bit Linux and the same problem. > Fails with a SIGSEGV. Again, I am not surprised as with this module does > is to create a class hierarchy in Pascal that mirrors the C++ hierarchy > and will only work if FPC has an identical vtable format to g++ - and > there's no guarantee of that. > > Looking at the code, the module is clearly written for Windows - loads > fbclient.dll etc and if it ever worked, worked because the Delphi > compiler does have an identical vtable to VCC or BCC (unverified). > > Is there a true platform, compiler and language independent means of > accessing the new API or is it limited to C++ and special cases where > the vtable is the same? > > Tony Whyman > MWA > > On 13/07/14 15:43, Dmitry Yemanov wrote: >> 13.07.2014 18:36, Dimitry Sibiryakov wrote: >> >>> http://sourceforge.net/projects/uib/ >> And the module he supposedly refers to is: >> https://sourceforge.net/p/uib/code/HEAD/tree/trunk/source/uibfblib.pas >> >> >> Dmitry >> >> >> ------------------------------------------------------------------------------ >> Firebird-Devel mailing list, web interface at >> https://lists.sourceforge.net/lists/listinfo/firebird-devel > > ------------------------------------------------------------------------------ > Firebird-Devel mailing list, web interface at > https://lists.sourceforge.net/lists/listinfo/firebird-devel ------------------------------------------------------------------------------ Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel