[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Problem porting linux shared library to windows using cygwin and libtool
From: |
Thomas Leitner |
Subject: |
Problem porting linux shared library to windows using cygwin and libtool |
Date: |
Tue, 9 Dec 2003 20:05:24 +1300 |
Hi!
I have been using libtool for one of my projects under linux and now I am in
the progress of porting this project to windows using Cygwin.
Fortunately, all the configuration stuff worked fine, but when it came to the
compilation part, some things went wrong.
I have native Windows DLLs and the approriate .def files which I converted to
import libraries using dlltool.
dlltool --def /cygdrive/c/MATLAB6p5/extern/include/libmat.def --dllname
libmat.dll --output-lib libmat.a
The same for the other libraries.
Three C++ files are compiled and then linked together to create a shared
library but that shared library depends on the former mentioned Windows DLLs.
Every time libtool wants to link all compiled files together it gives the
following warning:
*** Warning: linker path does not have real file for library -lmex.
*** I have the capability to make that library automatically link in when
*** you link to this library. But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libmex and none of the candidates passed a file format test
*** using a file magic. Last file checked: /cygdrive/c/matlab6p5/bin/win32/libme
x.dll
The same warning comes for -lmat and -lmx (the shared library should link
against the Matlab MEX interface).
After that libtool only creates a static version of the library. This would
normally be okay but I cannot link to my library. I have some C++ files that
use my library but when they should be created the compiler/linker only
produces 'undefined reference to ...' errors.
The strange thing is that I can compile everything manually and link everything
together without using libtool. This works fine.
So, to sum up:
* I have three files which should become one shared library referencing three
other libraries for which I have created the import libs.
* I have some C++ source files which reference the created library and
themselves should be come shared libraries.
I have searched on the Internet for information about this or similar problems
but found nothing useful.
Thomas
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Problem porting linux shared library to windows using cygwin and libtool,
Thomas Leitner <=