Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    [solved]Errors when linking to a shared Qt library that I built.

    General and Desktop
    2
    4
    2896
    Loading More Posts
    • 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.
    • S
      SeedOfLife last edited by

      I have packaged a dialog required from my application to a shared library and build it as a dll in MSVC 2008. I build the applications also in the same IDE. The library gets built fine without errors. But in some instances my application fails to build with link errors. These link error

      1 Reply Last reply Reply Quote 0
      • K
        koahnig last edited by

        Are you using "vsaddin":http://developer.qt.nokia.com/wiki/QtVSAddin
        If not, installing it may solve your problems.

        Vote the answer(s) that helped you to solve your issue(s)

        1 Reply Last reply Reply Quote 0
        • S
          SeedOfLife last edited by

          Yes I am using vsaddin. I have successfully compiled GUI applications in Qt which do not use shared libraries (i.e. sole applications). This is the only instance that I wanted to package functionality in a shared library dll and have other GUIs built linking that.

          Although I mentioned the link problem only occurs when I make changes to the GUI aplpication using the dll in the post above, it so happens that similar link errors(with reagards to QMetaCall) popup even when I make changes to the dll project as well. I then have to toggle the MocDirectory to resolve these link errors.

          These are the link errors from the library "http://pastebin.com/eB3f8iTe":http://pastebin.com/eB3f8iTe

          And the errors from the tester app to test the library
          "http://pastebin.com/UsqPn1HP":http://pastebin.com/UsqPn1HP

          Can somebody explain to me what really happens when I toggle this MocDirectory setting. ?

          1 Reply Last reply Reply Quote 0
          • S
            SeedOfLife last edited by

            I found out the problem. Whnever the cpp files are changed the moc files listed under GeneratedFiles in Solution Explorer of MSVC, get Excluded from Build. Googling the cause for this led me to "this":http://stackoverflow.com/questions/1200268/qt4-in-visual-studio-2008-moc-ed-files-get-excluded-from-build.

            According to that I set my MocDirectory in Qt Project Settings of the project to .\GeneratedFiles$(ConfigurationName). Any folder will do as long as it is subjected to the Build Config as set by Configuration Name above.

            Pls treat this thread as solved.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post