Re: problems with visual c++
Brought to you by:
rathmann
From: David T. <Dav...@ra...> - 2004-02-27 20:07:33
|
> qwt.lib(qwt.dll) : error LNK2005: "public: virtual __thiscall=20 > QMemArray<double>::~QMemArray<double>(void)"=20 > (??1?$QMemArray@N@@UAE@XZ) already defined in=20 > dataprogram.lib(datagui.obj) > > Where dataprogram.lib is the lib I built successfully before from my=20 > other sources. How does a Qt symbol end up in both my and Qwt's=20 > objects?? This makes absolutely no sense to me... Shouldn't the Qt lib = > complain, if at all? I can only suggest what your problem might be, I can't tell you for sure = unfortunately. Is there a QMemArray<double> template instantiation (i.e.= QMemArray<double> obj; ) in each of the 'qwt' and 'dataprogram' librarie= s? If so, try to omit linking 'dataprogram' to your application that lin= ks 'qwt' and instead link all of your source files that comprise 'datapro= gram'. I think what might be happening is that in order for a library to= successfully build, each specific template instantiation (declaration) m= ust have exactly one definition for that template instantiation across AL= L translation units making up a particular library or executable. If a d= efinition for a template instantiation exists in each of 'qwt' and 'datap= rogram', MSDevStudio 6.0 might not be smart enough to discard one of thos= e definitions (in accordance to the One Definition Rule). We never had m= uch luck when writing templates with DevStudio 6.0 which was the reason w= e went to 7.1. Just a possibility. Hope that works. David |