View Full Version : Linking a foreign static library using QtCreator

22nd September 2010, 03:52
Hi, I'm using VTK's QVTKWidget, and it works a charm on Windows, Linux and Mac-OSX. To reduce the number of files and generally simplify deployment (esp. on the Mac) I am trying to use static versions of the various libraries, starting with the VTK end. I have build static VTK libraries, but when I try to use them to build my Qt app I run into a problem. My code (myvtk.cpp) that uses VTK functions is being compiled with symbols for those functions that all are prefixed by "_imp_", as if they are being imported from a DLL. For example, myvtk.o contains a reference to _imp___ZN11vtkRenderer11RemoveActorEP7vtkProp
which leads to an "undefined reference" error from the linker, because libvtkrendering.a contains the symbol

I know that it is possible to link to static VTK libraries, because I've been in contact with someone who is doing this - but he uses cmake, not QtCreator/qmake. I'd be grateful if someone could suggest a way to tell QtCreator/qmake not to add the prefix.