It depends on how much ++ they used. Sometimes, it is simply a matter of annoying name mangling[*]. In one situation, I had success dumping the exported names and pasting the obvious into the FFI methods. An example: getErrorText:errorCode pBuffer:pBuffer bufferSize:bufferSize type:type "int GetErrorText(int errorCode, char* pBuffer, int bufferSize, enum MESSAGE_TYPE type)" < apicall: long '?GetErrorText@@YAHHPADHW4MESSAGE_TYPE@@@Z' ( long char* long long ) > ^self invalidCall. I was not happy with the vendor. All it takes is extern "C" to avoid the hassle. Bill [*] Yes, I know they call it "decoration" now, but there was a time when men were men, and they wrote compilers that MANGLED names :) ________________________________________ From: pharo-project-bounces@lists.gforge.inria.fr [pharo-project-bounces@lists.gforge.inria.fr] on behalf of Igor Stasenko [siguctua@gmail.com] Sent: Wednesday, November 23, 2011 9:23 PM To: Pharo-project@lists.gforge.inria.fr Subject: Re: [Pharo-project] Building 32-bit Cairo library on Macs On 24 November 2011 02:50, Serge Stinckwich <serge.stinckwich@gmail.com> wrote:
On Thu, Nov 24, 2011 at 1:30 AM, Luc Fabresse <luc.fabresse@gmail.com> wrote:
2011/11/23 Stefan Marr <pharo@stefan-marr.de>
Hi:
On 23 Nov 2011, at 16:50, Igor Stasenko wrote:
build_arch to "i386"
There used to be the +universal flag that made sure that all universal_archs where build, and then universal_archs was "x86_64 i386".
Not sure what the easiest way is to get macports to rebuild all the dependencies, but when I update with the force option, I think it is doing that.
Best regards Stefan
I had the same problem with the OpenCV and the mysqlclient libraries that I used through FFI. For OpenCV I found a 32bits precompiled framework on the Web. For mysqlclient, I did exactly what Stefan said i.e. configure universal flavour for both i386 and x86_64 architectures and install (recompile all dependencies) using the universal flag.
Did you success on using OpenCV through FFI ? I was interested but i bit afraid by the amount of work to have a working prototype.
it says that 2.1 version is implemented in C++... making calls to C++ through FFI is completely different story, and unfortunately there is no common standard for C++ dynamic libs. Unless it having C API wrapper.
Regards, -- Serge Stinckwich UMI UMMISCO 209 (IRD/UPMC), Hanoi, Vietnam Matsuno Laboratory, Kyoto University, Japan (until 12/2011) http://www.mechatronics.me.kyoto-u.ac.jp/ Every DSL ends up being Smalltalk http://doesnotunderstand.org/
-- Best regards, Igor Stasenko.