Qt-interest Archive, March 2002
link error with QPtrList with MSVC++ 6.0 and Qt 3.0.3
Message 1 in thread
Hi everybody,
I recently developed a linker problem with my application. Please note that
before today, this application used to link fine, but something changed
while I was working today and it no longer links. Anyways, here is the
linker error:
Linking...
qt-mt303.lib(qt-mt303.dll) : error LNK2005: "public: virtual __thiscall
QPtrList<class QDockWindow>::~QPtrList<class QDockWindow>(void)"
(??1?$QPtrList@VQDockWindow@@@@UAE@XZ) already defined in vapplication.obj
qt-mt303.lib(qt-mt303.dll) : warning LNK4006: "public: virtual __thiscall
QPtrList<class QDockWindow>::~QPtrList<class QDockWindow>(void)"
(??1?$QPtrList@VQDockWindow@@@@UAE@XZ) already defined in vapplication.obj;
second definition ignored
Creating library Debug/vida.lib and object Debug/vida.exp
Debug/vida.exe : fatal error LNK1169: one or more multiply defined symbols
found
In my file vapplication.cpp I have this line of code:
QPtrList<QDockWindow> docked = dockedWindows();
If I comment out this line and all the references to the list docked, my
application now links fine. However, this is not a good solution because I
want to access docked. The strange thing is that yesterday, this used to
link fine. Any thoughts? The only thing that I can think of is that I
rebuilt Qt in debug mode today to do some debugging of the Qt library.
Anyways, this error developed shortly thereafter and I did a make clean and
rebuilt Qt in release mode and still had the problem.
Thanks in advance,
Joe