Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] Remove linker error for a library that is not being used anymore

[Solved] Remove linker error for a library that is not being used anymore

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.9k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Ghost
    wrote on last edited by
    #1

    I picked up some code related to implementing OAuth2 for Facebook. It uses QJson library to convert Facebook responses into JSON document (and then QVariantMap). However, as I am using Qt5, I decided to replace QJson with QJsonDocument.

    After removing the references to QJson in the code, I also removed its reference from the LIBS attribute in project.pro file.

    Here is the .pro file:

    @##### Autogenerated starts here! ######

    Add more folders to ship with the application, here

    folder_01.source = qml/facebookauth
    folder_01.target = qml
    DEPLOYMENTFOLDERS = folder_01

    Additional import path used to resolve QML modules in Creator's code model

    QML_IMPORT_PATH =

    The .cpp file which was generated for your project. Feel free to hack it.

    SOURCES += main.cpp
    oauth2authorizer.cpp
    facebookmanager.cpp
    facebookstatusdata.cpp

    Please do not modify the following two lines. Required for deployment.

    include(qmlapplicationviewer/qmlapplicationviewer.pri)
    qtcAddDeployment()

    Autogenerated ends here!

    TARGET = facebookauth
    TEMPLATE = app
    QT += webkit network widgets

    macx {
    CONFIG -= app_bundle
    QMAKE_POST_LINK += install_name_tool -change kqoauth.framework/Versions/0/kqoauth
    ../../lib/kqoauth.framework/Versions/0/kqoauth $${TARGET}
    }
    else:unix {

    the second argument (after colon) is for

    being able to run make check from the root source directory

    LIBS += -L../../lib:lib
    } else:windows {
    LIBS += -L../../lib -lkqoauth0
    }

    LIBS += -Lqjson/lib -lqjson0

    INCLUDEPATH += qjson/src

    HEADERS +=
    oauth2authorizer.h
    facebookmanager.h
    facebookstatusdata.h
    @

    However, compiling the project gives me the following error:

    @:-1: error: LNK1104: cannot open file 'qjson0.lib'@

    As per my understanding, compiler/linker shouldn't be bothered by that lib anymore as I have removed its reference from my project.

    Can anyone guide me to a solution?

    Bhoot

    1 Reply Last reply
    0
    • mrdebugM Offline
      mrdebugM Offline
      mrdebug
      wrote on last edited by
      #2

      Have you run qmake?

      Need programmers to hire?
      www.labcsp.com
      www.denisgottardello.it
      GMT+1
      Skype: mrdebug

      1 Reply Last reply
      0
      • G Offline
        G Offline
        Ghost
        wrote on last edited by
        #3

        Well, I am using Qt Creator. I ran "clean" and then "rebuild". Is there anything more required?
        I could go command line if you think it is required.

        Bhoot

        1 Reply Last reply
        0
        • G Offline
          G Offline
          Ghost
          wrote on last edited by
          #4

          [quote author="mrdebug" date="1374766280"]Have you run qmake?[/quote]

          Alright. After you posted this, I thought of deleting the build folder of the project, and then rebuilding it. And it worked!

          I had assumed that clean and rebuild should have done this for me.

          Out of curiosity, what exactly do they do, if not cleaning up the non-existent library links?

          Bhoot

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved