LINK1140 error with the vcpkg UMFPACK



  • Hello friends,

    I'm trying to add an external library a desktop QT project I'm working on. I installed the UMFPACK package using the cmd after pulling the vcpkg from git. I added the library via the library manager the following code was added to the .pro file

    win32:CONFIG(release, debug|release): LIBS += -LC:/vcpkg-master/installed/x64-windows/lib/ -llibumfpack
    else:win32:CONFIG(debug, debug|release): LIBS += -LC:/vcpkg-master/installed/x64-windows/lib/ -llibumfpackd
    else:unix: LIBS += -LC:/vcpkg-master/installed/x64-windows/lib/ -llibumfpack
    
    INCLUDEPATH += C:/vcpkg-master/installed/x64-windows/include/suitesparse
    DEPENDPATH += C:/vcpkg-master/installed/x64-windows/include/suitesparse
    

    After cleaning the project and run qmake and then build the following error is displayed :

    :-1: error: LNK1104: cannot open file 'libumfpackd.lib'
    

    I'm using the following compiler settings Image settings - follow link

    what would be causing this error ?



  • Can you display the whole .pro?

    Had you tried with LIBS?



  • This is the whole .pro file , no i didn't try LIBS? what do you mean with LIBS? trying to simulate the libraries outside QT ?

    #-------------------------------------------------
    #
    # Project created by QtCreator 2017-09-17T12:47:31
    #
    #-------------------------------------------------
    
    QT       += core gui
    
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport
    
    TARGET = GUIv1-1
    TEMPLATE = app
    
    # The following define makes your compiler emit warnings if you use
    # any feature of Qt which has been marked as deprecated (the exact warnings
    # depend on your compiler). Please consult the documentation of the
    # deprecated API in order to know how to port your code away from it.
    DEFINES += QT_DEPRECATED_WARNINGS
    
    # You can also make your code fail to compile if you use deprecated APIs.
    # In order to do so, uncomment the following line.
    # You can also select to disable deprecated APIs only up to a certain version of Qt.
    #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
    
    
    SOURCES += \
            main.cpp \
            mainwindow.cpp \
            qcustomplot.cpp \
        savesettings.cpp \
        functions_solver.cpp \
        mesh.cpp \
        util.cpp \
        borderlayout.cpp
    
    
    HEADERS += \
            mainwindow.h \
        qcustomplot.h \
        savesettings.h \
        functions_solver.h \
        mesh.h \
        util.h \
        borderlayout.h
    
    
    FORMS += \
            mainwindow.ui \
        temp.ui
    
    
    
    
    win32:CONFIG(release, debug|release): LIBS += -LC:/vcpkg-master/installed/x64-windows/lib/ -llibumfpack
    else:win32:CONFIG(debug, debug|release): LIBS += -LC:/vcpkg-master/installed/x64-windows/lib/ -llibumfpackd
    else:unix: LIBS += -LC:/vcpkg-master/installed/x64-windows/lib/ -llibumfpack
    
    INCLUDEPATH += C:/vcpkg-master/installed/x64-windows/include/suitesparse
    DEPENDPATH += C:/vcpkg-master/installed/x64-windows/include/suitesparse
    


  • Which one is your platform?


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Do you really have a file named libumfpack.lib in the folder you are indicating ?



  • @SGaist Hello , yes i'm sure that the file exist in the directory i pointed to.



  • @Charlie_Hdz I have a 64bit machine, however, I was checking now on the QT version installed and I noticed that my qt creator is "Based on Qt 5.9.1 (MSVC 2015, 32 bit)" based on 32bot MSVC and the library I was trying to link to was built for 64bit. however, inside QT I had MSVC2015 64bit compiler. can this be the problem ? should QT be 64bit also?


  • Moderators

    @husseinahazime It doesn't matter whether QtCreator is 32bit or 64bit. What matters is whether you're building a 32bit or 64bit application. What exact Qt version did you install? Also remove lib prefix from

    -llibumfpack
    

    should be

    -lumfpack
    


  • @jsulm I am using Qt 5.9.1 (MSVC 2015, 32 bit).

    i reviewed the library name and it says libumfpack.lib therefore I used
    -llibumfpack.

    do you have any idea why I'm facing such a problem?


  • Lifetime Qt Champion

    The lib prefix should be dropped like @jsulm suggested.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.