[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
Are you using "vsaddin":http://developer.qt.nokia.com/wiki/QtVSAddin
If not, installing it may solve your problems.
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.
Can somebody explain to me what really happens when I toggle this MocDirectory setting. ?
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.