July 11, 2011

SeedOfLife SeedOfLife
Lab Rat
39 posts

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

 

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

3 replies

July 11, 2011

koahnig koahnig
Dinosaur Breeder
2908 posts

Are you using vsaddin [developer.qt.nokia.com]
If not, installing it may solve your problems.

July 11, 2011

SeedOfLife SeedOfLife
Lab Rat
39 posts

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 [pastebin.com]

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

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

July 11, 2011

SeedOfLife SeedOfLife
Lab Rat
39 posts

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 [stackoverflow.com].

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.

 
  ‹‹ [SOLVED] QGraphicsView and scale      Documentation without Qt Assistant ››

You must log in to post a reply. Not a member yet? Register here!