[vtkusers] VTK deployment with static libraries on Mac (and in Qt Creator)
mbcx9rb9
richard.j.brown at live.co.uk
Tue Mar 14 12:50:32 EDT 2017
Hi all,
I want to deploy an application that uses VTK on other Macs.
I think (I'm new to this) therefore that I need to compile the application
using static libraries... So I rebuilt VTK with static libraries.
I went to recompile my application in Qt Creator, and I got a bunch of
errors that I'll paste at the end of this post.
The application compiles without any problems using dynamic libraries in Qt
and compiles without any problems with the static libraries when compilation
is done through CMake. I know that include(${VTK_USE_FILE}) sets some
settings, such as which OpenGL version to use, etc. so I imagine its a
problem with my VTK_MODULE_INITs that I use when I compile with Qt Creator.
At the moment, my VTK_MODULE_INITs are:
#include <vtkAutoInit.h>
VTK_MODULE_INIT(vtkRenderingFreeType)
VTK_MODULE_INIT(vtkRenderingOpenGL)
VTK_MODULE_INIT(vtkInteractionStyle)
VTK_MODULE_INIT(vtkRenderingContextOpenGL)
Any ideas how I can compile with static libraries in Qt Creator?
Thanks in advance.
The list of errors is as follows:
Undefined symbols for architecture x86_64:
"_Get1IndResource", referenced from:
_FT_New_Face_From_Resource in libvtkfreetype-7.1.a(ftbase.c.o)
"_FSOpenResourceFile", referenced from:
_FT_New_Face_From_LWFN in libvtkfreetype-7.1.a(ftbase.c.o)
_FT_New_Face_From_Resource in libvtkfreetype-7.1.a(ftbase.c.o)
"_OBJC_CLASS_$_NSWindow", referenced from:
_OBJC_CLASS_$_vtkCocoaFullScreenWindow in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
objc-class-ref in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
"_CloseResFile", referenced from:
_FT_New_Face_From_LWFN in libvtkfreetype-7.1.a(ftbase.c.o)
_FT_New_Face_From_Resource in libvtkfreetype-7.1.a(ftbase.c.o)
"_objc_msgSendSuper2", referenced from:
-[vtkCocoaServer initWithRenderWindow:] in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
-[vtkCocoaTimer initWithInteractor:timerId:] in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindowInteractor.mm.o)
-[vtkCocoaGLView initWithFrame:] in
libvtkRenderingOpenGL-7.1.a(vtkCocoaGLView.mm.o)
-[vtkCocoaGLView updateTrackingAreas] in
libvtkRenderingOpenGL-7.1.a(vtkCocoaGLView.mm.o)
"_GetHandleSize", referenced from:
_vtk_freetype_FT_New_Face_From_FOND in
libvtkfreetype-7.1.a(ftbase.c.o)
_FT_New_Face_From_LWFN in libvtkfreetype-7.1.a(ftbase.c.o)
"_FSRefMakePath", referenced from:
_vtk_freetype_FT_New_Face_From_FOND in
libvtkfreetype-7.1.a(ftbase.c.o)
_lookup_lwfn_by_fond in libvtkfreetype-7.1.a(ftbase.c.o)
"_ReleaseResource", referenced from:
_vtk_freetype_FT_New_Face_From_FOND in
libvtkfreetype-7.1.a(ftbase.c.o)
"_GetResInfo", referenced from:
_vtk_freetype_FT_New_Face_From_FOND in
libvtkfreetype-7.1.a(ftbase.c.o)
"_OBJC_CLASS_$_NSOpenGLPixelFormat", referenced from:
objc-class-ref in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
"_objc_setProperty_nonatomic", referenced from:
-[vtkCocoaGLView setRolloverTrackingArea:] in
libvtkRenderingOpenGL-7.1.a(vtkCocoaGLView.mm.o)
"_ResError", referenced from:
_vtk_freetype_FT_New_Face_From_FOND in
libvtkfreetype-7.1.a(ftbase.c.o)
_FT_New_Face_From_LWFN in libvtkfreetype-7.1.a(ftbase.c.o)
_FT_New_Face_From_Resource in libvtkfreetype-7.1.a(ftbase.c.o)
"_NSPointInRect", referenced from:
-[vtkCocoaGLView mouseMoved:] in
libvtkRenderingOpenGL-7.1.a(vtkCocoaGLView.mm.o)
"_UseResFile", referenced from:
_FT_New_Face_From_LWFN in libvtkfreetype-7.1.a(ftbase.c.o)
_FT_New_Face_From_Resource in libvtkfreetype-7.1.a(ftbase.c.o)
"_FSPathMakeRef", referenced from:
_lookup_lwfn_by_fond in libvtkfreetype-7.1.a(ftbase.c.o)
_FT_New_Face_From_LWFN in libvtkfreetype-7.1.a(ftbase.c.o)
_FT_New_Face_From_Resource in libvtkfreetype-7.1.a(ftbase.c.o)
"_FSOpenResFile", referenced from:
_FT_New_Face_From_LWFN in libvtkfreetype-7.1.a(ftbase.c.o)
_FT_New_Face_From_Resource in libvtkfreetype-7.1.a(ftbase.c.o)
"__objc_empty_cache", referenced from:
_OBJC_METACLASS_$_vtkCocoaFullScreenWindow in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
_OBJC_CLASS_$_vtkCocoaFullScreenWindow in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
_OBJC_CLASS_$_vtkCocoaServer in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
_OBJC_METACLASS_$_vtkCocoaServer in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
_OBJC_CLASS_$_vtkCocoaTimer in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindowInteractor.mm.o)
_OBJC_METACLASS_$_vtkCocoaTimer in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindowInteractor.mm.o)
_OBJC_CLASS_$_vtkCocoaGLView in
libvtkRenderingOpenGL-7.1.a(vtkCocoaGLView.mm.o)
...
"_OBJC_CLASS_$_NSEvent", referenced from:
objc-class-ref in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindowInteractor.mm.o)
"_OBJC_CLASS_$_NSAutoreleasePool", referenced from:
objc-class-ref in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindowInteractor.mm.o)
"_OBJC_CLASS_$_NSThread", referenced from:
objc-class-ref in libvtkRenderingOpenGL-7.1.a(vtkCocoaGLView.mm.o)
"_OBJC_CLASS_$_NSTimer", referenced from:
objc-class-ref in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindowInteractor.mm.o)
"_NSZeroPoint", referenced from:
vtkCocoaRenderWindowInteractor::TerminateApp() in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindowInteractor.mm.o)
"_OBJC_CLASS_$_NSObject", referenced from:
_OBJC_CLASS_$_vtkCocoaServer in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
_OBJC_CLASS_$_vtkCocoaTimer in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindowInteractor.mm.o)
"_NSDefaultRunLoopMode", referenced from:
-[vtkCocoaTimer startTimerWithInterval:repeating:] in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindowInteractor.mm.o)
"_Get1Resource", referenced from:
_FT_New_Face_From_LWFN in libvtkfreetype-7.1.a(ftbase.c.o)
"_GetResource", referenced from:
_vtk_freetype_FT_New_Face_From_FOND in
libvtkfreetype-7.1.a(ftbase.c.o)
"_NSEventTrackingRunLoopMode", referenced from:
-[vtkCocoaTimer startTimerWithInterval:repeating:] in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindowInteractor.mm.o)
"___CFConstantStringClassReference", referenced from:
CFString in libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
CFString in libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
CFString in libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
CFString in libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
CFString in libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
CFString in libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
CFString in libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
...
"_OBJC_CLASS_$_NSView", referenced from:
objc-class-ref in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
_OBJC_CLASS_$_vtkCocoaGLView in
libvtkRenderingOpenGL-7.1.a(vtkCocoaGLView.mm.o)
"_OBJC_CLASS_$_NSMutableDictionary", referenced from:
objc-class-ref in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
objc-class-ref in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindowInteractor.mm.o)
"_OBJC_CLASS_$_NSScreen", referenced from:
objc-class-ref in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
"_OBJC_CLASS_$_NSRunLoop", referenced from:
objc-class-ref in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindowInteractor.mm.o)
"_OBJC_CLASS_$_NSString", referenced from:
objc-class-ref in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
objc-class-ref in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindowInteractor.mm.o)
"_HomeResFile", referenced from:
_vtk_freetype_FT_New_Face_From_FOND in
libvtkfreetype-7.1.a(ftbase.c.o)
"_OBJC_METACLASS_$_NSObject", referenced from:
_OBJC_METACLASS_$_vtkCocoaFullScreenWindow in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
_OBJC_METACLASS_$_vtkCocoaServer in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
_OBJC_METACLASS_$_vtkCocoaTimer in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindowInteractor.mm.o)
_OBJC_METACLASS_$_vtkCocoaGLView in
libvtkRenderingOpenGL-7.1.a(vtkCocoaGLView.mm.o)
"_CGWarpMouseCursorPosition", referenced from:
vtkCocoaRenderWindow::SetCursorPosition(int, int) in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
"_FSGetForkCBInfo", referenced from:
_vtk_freetype_FT_New_Face_From_FOND in
libvtkfreetype-7.1.a(ftbase.c.o)
"_OBJC_CLASS_$_NSTrackingArea", referenced from:
objc-class-ref in libvtkRenderingOpenGL-7.1.a(vtkCocoaGLView.mm.o)
"_OBJC_CLASS_$_NSCursor", referenced from:
objc-class-ref in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
"_NSViewFrameDidChangeNotification", referenced from:
-[vtkCocoaServer startObservations] in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
-[vtkCocoaServer stopObservations] in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
"_CFRetain", referenced from:
vtkCocoaRenderWindow::New() in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
vtkCocoaRenderWindowInteractor::vtkCocoaRenderWindowInteractor() in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindowInteractor.mm.o)
"_OBJC_CLASS_$_NSNotificationCenter", referenced from:
objc-class-ref in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
"_OBJC_CLASS_$_NSApplication", referenced from:
objc-class-ref in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
objc-class-ref in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindowInteractor.mm.o)
"_objc_msgSend_stret", referenced from:
-[vtkCocoaServer viewFrameDidChange:] in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
vtkCocoaRenderWindow::SetSize(int, int) in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
vtkCocoaRenderWindow::SetPosition(int, int) in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
vtkCocoaRenderWindow::CreateAWindow() in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
vtkCocoaRenderWindow::GetSize() in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
vtkCocoaRenderWindow::GetScreenSize() in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
vtkCocoaRenderWindow::GetPosition() in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
...
"_CGWindowLevelForKey", referenced from:
vtkCocoaRenderWindow::CreateAWindow() in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
"_NSWindowWillCloseNotification", referenced from:
-[vtkCocoaServer startObservations] in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
-[vtkCocoaServer stopObservations] in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
"_CFRelease", referenced from:
vtkCocoaRenderWindow::~vtkCocoaRenderWindow() in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
vtkCocoaRenderWindowInteractor::~vtkCocoaRenderWindowInteractor() in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindowInteractor.mm.o)
vtkCocoaRenderWindowInteractor::~vtkCocoaRenderWindowInteractor() in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindowInteractor.mm.o)
"_OBJC_CLASS_$_NSOpenGLContext", referenced from:
objc-class-ref in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
"_objc_msgSend", referenced from:
vtkCocoaRenderWindow::New() in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
-[vtkCocoaServer startObservations] in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
-[vtkCocoaServer stopObservations] in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
-[vtkCocoaServer windowWillClose:] in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
vtkCocoaRenderWindow::~vtkCocoaRenderWindow() in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
vtkCocoaRenderWindow::DestroyWindow() in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
vtkCocoaRenderWindow::SetWindowName(char const*) in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
...
"_FSGetCatalogInfo", referenced from:
_lookup_lwfn_by_fond in libvtkfreetype-7.1.a(ftbase.c.o)
_FT_New_Face_From_Resource in libvtkfreetype-7.1.a(ftbase.c.o)
"_OBJC_METACLASS_$_NSWindow", referenced from:
_OBJC_METACLASS_$_vtkCocoaFullScreenWindow in
libvtkRenderingOpenGL-7.1.a(vtkCocoaRenderWindow.mm.o)
"_OBJC_METACLASS_$_NSView", referenced from:
_OBJC_METACLASS_$_vtkCocoaGLView in
libvtkRenderingOpenGL-7.1.a(vtkCocoaGLView.mm.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
make: *** [../bin-Release/PF3.app/Contents/MacOS/PF3] Error 1
17:50:18: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project PF3 (kit: Desktop Qt 5.7.0 clang
64bit)
When executing step "Make"
--
View this message in context: http://vtk.1045678.n5.nabble.com/VTK-deployment-with-static-libraries-on-Mac-and-in-Qt-Creator-tp5742475.html
Sent from the VTK - Users mailing list archive at Nabble.com.
More information about the vtkusers
mailing list