[MonoDevelop] Loading unmanaged shared library
karen at desertdakini.com
Sat Jun 5 01:55:58 EDT 2010
OK, I'll try to be more specific. ;)
The shared library on Linux, is a derived from a Windows DLL. Apparently the
Linux version was (that I can gleam from the release notes) written in C,
compiled on Linux on GCC 3.3.1. I have real little information on its
construction, aside from that, the header files, and the documentation for
the APIs. Calling method is still specified as WINAPI (i.e., stdcall).
It in turn provides an API to access a USB driver. I have it installed, as I
said in /usr/local/lib, also /usr/lib. I have no trouble accessing it using
natively compiled C code. The problem is in it being located by my managed
wrapper, written in C# and compiled with the MonoDevelop compiler. Written
originally on Windows, .Net 3.5, where it runs fine. The problem is in
porting it to Linux, with Mono 2.6.
Functions are declared as:
static extern FT_STATUS FT_Open(UInt32 uiPort, ref FT_HANDLE ftHandle);
Following http://www.mono-project.com/Interop_with_Native_Libraries, I
created a .config file (in the same directory as the wrappers assembly to
map the original DLL name to the Linux library name:
<dllmap dll="FTD2XX.dll" target="libftd2xx.so" />
With no avail. I tried with the full version library name as well,
I also rewrote the function declarations to explicitly reference the Linux
specific library name. In each case the result is the same,
DllNotFoundException is thrown. In the attempt with the .config file
approach, the error message indicates FTD2XX.dll is not found; with the
revised function declarations, the error message indicates libftd2xx.so is
Some dots are not being connected. Perhaps some suggestions? What else needs
be done to allow it to access the Linux version of the library?
----- Original Message -----
From: <dbj at dbj.org>
To: <karen at desertdakini.com>
Sent: Friday, June 04, 2010 6:22 PM
Subject: RE: [MonoDevelop] Loading unmanaged shared library
How is this "Linux flavoured" "DLL" (?) developed ?
Which compiler, language, etc ...
From: karen karen at desertdakini.com
Date: Fri, 4 Jun 2010 16:37:30 -0600
To: monodevelop-list at lists.ximian.com
Subject: [MonoDevelop] Loading unmanaged shared library
Maybe some insight will arise from the collective here. I'm fairly new to
this (especially with Linux, as I have most exclusively developed for
Windows alone), and have often relied on the "smarter guy down the hall..."
as it were anyway. ;)
I have an unmanaged shared library, both in Windows and Linux flavors, and
am developing managed libraries for an application to run on both platforms
(possibly also on OSX 10 down the road, but that bridge will be crossed in
due course...). I am currently testing a CLI wrapper for the shared
library. On Windows with .NET 3.5, there is no problem, of course. Works as
designed (its a pretty thin wrapper). The plan is to then port it to Linux
I am testing it on Linux, using the OpenSUSE/Mono virtual machine. On Linux
the wrapper is unable to load the shared library. I've tried it with the
dll mapping through a .config file, as the interoperability documentation
on the Mono site describes, and have also built a Linux version of the
wrapper with the platform specific naming in the DLLIMPORTs, both with and
without the complete versioning.
The Linux version of the shared library is in /usr/local/lib, and also
/usr/lib. Should there be a different location for Mono to make the
connection? Other suggestions?
Thanks in advance ;)
mail2web.com - What can On Demand Business Solutions do for you?
More information about the Monodevelop-list