1

I having been struggling with an error for several days now but with no luck to find the correct solution. I'm trying to use the UMFPack library installed with cygwin on windows in a c++ application I'm developing on QT Creator.

I added the library by going to my project-> right click -> Add Library... Library Adding Forum

In the Library File I pointed to : /cygwin/lib/libumfpack.dll.a

In Include Path I pointed to : /cygwin/usr/include/suitesparse

Linkage type : Dynamic

The QTCreator added the link automatically as follows :

win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../cygwin64/lib/ -llibumfpack.dll
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../cygwin64/lib/ -llibumfpack.dlld
else:unix: LIBS += -L$$PWD/../../../../cygwin64/lib/ -llibumfpack.dll

INCLUDEPATH += $$PWD/../../../../cygwin64/usr/include/suitesparse
DEPENDPATH += $$PWD/../../../../cygwin64/usr/include/suitesparse

However, when I build the project the following error is displayed:

**:-1: error: LNK1104: cannot open file 'libumfpack.dlld.lib'**

Can anyone point me to the correct direction?

1 Answers1

1

You are mixing MSVC and gcc.

You are using MSVC which expects import libraries to end in ".lib". While the library was generated by gcc (MinGW or Cygwin) which expects import libraries to end in ".a".

But just renaming will not solve your problem as the format is not the same. At least you need to generate a ".lib" from your the ".dll". However this will only work if the library API is in pure C, as C++ name mangling will prevent you to use C++ symbols across 2 binaries built with different compilers.

If the API is C++ you need to either find a library built with MSVC or change your compiler to use the same the library was built with.

Benjamin T
  • 8,120
  • 20
  • 37
  • Thank you for replying, so changing the compiler from MSVC to GCC would solve the problem?? – Hussein Hazime Oct 29 '17 at 22:17
  • 1
    @HusseinHazime Yes. As I said you have to use the same compiler that was used to build the library, as you are using cygwin, the gcc version provided by cygwin should be good. – Benjamin T Oct 29 '17 at 23:10