[Qt-interest] Problem with linking external libraries (Win32)
John McClurkin
jwm at nei.nih.gov
Thu Jan 14 17:08:45 CET 2010
Markus Straub wrote:
> Dear list,
>
> I recently bumped into a problem when trying to compile and run a
> project on Win32 which was developed on Linux and fail to solve it.
>
> I seem to be unable to use the DLL provided by InterSense (isense.dll)
> under Win32, whereas I have no problems with libisense.so under Linux.
>
> In both OSes I copied the shared library to the common path,
> /usr/local/lib and c:\windows\system32 respectively. Compiling and
> linking the same code within QtCreator also works fine on both, even
> without the LIBS directive in the .pro file
> (win32:LIBS += c:\windows\system32\isense.dll). All required headers are
> included as well.
>
> The problem arises when running the program: on Windows I only get the
> message "Could not load isense", on Linux it just works.
>
>
> Now I am wondering what I am missing, why is my program not able to find
> the dll at runtime (if that is what the error message means).
> A small testprogram compiled with Visual Studio 6 could successfully use
> isense.dll, so I guess the problem is caused by my project configuration.
>
>
> Any hints would be appreciated.
>
> Best regards,
> Markus Straub
This is probably a compiler issue. On Linux, the InterSense library was
undoubtedly compiled with gcc, the same compiler used for Qt. For
Windows, the InterSense libraries were probably compiled with Visual
Studio. You describe your windows project as a Win32 project, so I'm
assuming you are using MinGW. You can't link libraries compiled with
Visual Studio (or Borland for that matter) with programs compiled with
MinGW.
More information about the Qt-interest-old
mailing list