Quantcast

VTK deployment with static libraries on Mac (and in Qt Creator)

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

VTK deployment with static libraries on Mac (and in Qt Creator)

mbcx9rb9
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"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: VTK deployment with static libraries on Mac (and in Qt Creator)

Sean McBride
On Tue, 14 Mar 2017 09:50:32 -0700, mbcx9rb9 said:

>  "_OBJC_CLASS_$_NSWindow", referenced from:
>      _OBJC_CLASS_$_vtkCocoaFullScreenWindow in

This tells me you aren't linking against Cocoa.framework.

Cheers,

--
____________________________________________________________
Sean McBride, B. Eng                 [hidden email]
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: VTK deployment with static libraries on Mac (and in Qt Creator)

mbcx9rb9
Hi Sean,

So how do I go about linking against Cocoa.framework. With another VTK_MODULE_INIT?

Regards,
Richard

> On 14 Mar 2017, at 18:25, Sean McBride <[hidden email]> wrote:
>
> On Tue, 14 Mar 2017 09:50:32 -0700, mbcx9rb9 said:
>
>> "_OBJC_CLASS_$_NSWindow", referenced from:
>>     _OBJC_CLASS_$_vtkCocoaFullScreenWindow in
>
> This tells me you aren't linking against Cocoa.framework.
>
> Cheers,
>
> --
> ____________________________________________________________
> Sean McBride, B. Eng                 [hidden email]
> Rogue Research                        www.rogue-research.com
> Mac Software Developer              Montréal, Québec, Canada
>
>

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: VTK deployment with static libraries on Mac (and in Qt Creator)

Sean McBride
In reply to this post by Sean McBride
On Wed, 15 Mar 2017 14:13:39 +0000, Richard Brown said:

>So how do I go about linking against Cocoa.framework. With another
>VTK_MODULE_INIT?

You need to do that when building your application, as opposed to building VTK.  Do you build your app with CMake?  With Xcode?  With something else?  Presumably you're ultimately using clang, in which case something needs to pass "-framework Cocoa" to it.

Cheers,

--
____________________________________________________________
Sean McBride, B. Eng                 [hidden email]
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: VTK deployment with static libraries on Mac (and in Qt Creator)

mbcx9rb9
Building in Qt Creator gives this error. Building with Cmake compiles without any problems (I assumed due to VTK_USE_FILE). Also I can compile the program in Qt Creator using dylibs without any problems (so I guess normally Qt links to Cocoa, it's just linking to cocoa when using static libs in Qt that causes the problem).

Thanks

On 16 Mar 2017 5:01 p.m., "Sean McBride [via VTK]" <ml-node+[hidden email]> wrote:
On Wed, 15 Mar 2017 14:13:39 +0000, Richard Brown said:

>So how do I go about linking against Cocoa.framework. With another
>VTK_MODULE_INIT?

You need to do that when building your application, as opposed to building VTK.  Do you build your app with CMake?  With Xcode?  With something else?  Presumably you're ultimately using clang, in which case something needs to pass "-framework Cocoa" to it.

Cheers,

--
____________________________________________________________
Sean McBride, B. Eng                 [hidden email]
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers



If you reply to this email, your message will be added to the discussion below:
http://vtk.1045678.n5.nabble.com/VTK-deployment-with-static-libraries-on-Mac-and-in-Qt-Creator-tp5742475p5742496.html
To unsubscribe from VTK deployment with static libraries on Mac (and in Qt Creator), click here.
NAML

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [vtkusers] VTK deployment with static libraries on Mac (and in Qt Creator)

mbcx9rb9
This post has NOT been accepted by the mailing list yet.
In reply to this post by Sean McBride
Bump. Does anyone have any experience building a VTK application in Qt Creator with static libraries?

Regards,
Richard

On 16 Mar 2017, at 17:07, mbcx9rb9 <[hidden email]> wrote:

Building in Qt Creator gives this error. Building with Cmake compiles without any problems (I assumed due to VTK_USE_FILE). Also I can compile the program in Qt Creator using dylibs without any problems (so I guess normally Qt links to Cocoa, it's just linking to cocoa when using static libs in Qt that causes the problem).

Thanks

On 16 Mar 2017 5:01 p.m., "Sean McBride [via VTK]" <ml-node+<a href="x-msg://2/user/SendEmail.jtp?type=node&amp;node=5742498&amp;i=0" target="_top" rel="nofollow" link="external" class="">[hidden email]> wrote:
On Wed, 15 Mar 2017 14:13:39 +0000, Richard Brown said:

>So how do I go about linking against Cocoa.framework. With another
>VTK_MODULE_INIT?

You need to do that when building your application, as opposed to building VTK.  Do you build your app with CMake?  With Xcode?  With something else?  Presumably you're ultimately using clang, in which case something needs to pass "-framework Cocoa" to it.

Cheers,

--
____________________________________________________________
Sean McBride, B. Eng                 [hidden email]
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers



If you reply to this email, your message will be added to the discussion below:
http://vtk.1045678.n5.nabble.com/VTK-deployment-with-static-libraries-on-Mac-and-in-Qt-Creator-tp5742475p5742496.html
To unsubscribe from VTK deployment with static libraries on Mac (and in Qt Creator), click here.
NAML



View this message in context: Re: VTK deployment with static libraries on Mac (and in Qt Creator)
Sent from the VTK - Users mailing list archive at Nabble.com.
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: VTK deployment with static libraries on Mac (and in Qt Creator)

mbcx9rb9
In reply to this post by mbcx9rb9
Bump. Does anyone have any experience building a VTK application in Qt Creator with static libraries?

Regards,
Richard

On 16 Mar 2017, at 17:07, mbcx9rb9 <[hidden email]> wrote:

Building in Qt Creator gives this error. Building with Cmake compiles without any problems (I assumed due to VTK_USE_FILE). Also I can compile the program in Qt Creator using dylibs without any problems (so I guess normally Qt links to Cocoa, it's just linking to cocoa when using static libs in Qt that causes the problem).

Thanks

On 16 Mar 2017 5:01 p.m., "Sean McBride [via VTK]" <ml-node+<a href="x-msg://2/user/SendEmail.jtp?type=node&amp;node=5742498&amp;i=0" target="_top" rel="nofollow" link="external" class="">[hidden email]> wrote:
On Wed, 15 Mar 2017 14:13:39 +0000, Richard Brown said:

>So how do I go about linking against Cocoa.framework. With another
>VTK_MODULE_INIT?

You need to do that when building your application, as opposed to building VTK.  Do you build your app with CMake?  With Xcode?  With something else?  Presumably you're ultimately using clang, in which case something needs to pass "-framework Cocoa" to it.

Cheers,

--
____________________________________________________________
Sean McBride, B. Eng                 [hidden email]
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers



If you reply to this email, your message will be added to the discussion below:
http://vtk.1045678.n5.nabble.com/VTK-deployment-with-static-libraries-on-Mac-and-in-Qt-Creator-tp5742475p5742496.html
To unsubscribe from VTK deployment with static libraries on Mac (and in Qt Creator), click here.
NAML



View this message in context: Re: VTK deployment with static libraries on Mac (and in Qt Creator)
Sent from the VTK - Users mailing list archive at Nabble.com.
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: VTK deployment with static libraries on Mac (and in Qt Creator)

Sean McBride
In reply to this post by Sean McBride
On Thu, 16 Mar 2017 09:07:54 -0700, mbcx9rb9 said:

>Building in Qt Creator gives this error. Building with Cmake compiles
>without any problems

So sounds more like a Qt problem problem, to be asked on a Qt list...

(I've never used Qt, so alas have no further suggestions.)

Sean


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: VTK deployment with static libraries on Mac (and in Qt Creator)

David Gobbi
Hi Richard,

It is possible to build dynamically-linked applications with Qt and VTK, and to share such applications.  On the Mac, the Qt libraries become part of the app bundle.  I do not know how to do this with Qt Creator, but there should definitely be Qt experts around who know how to do it.  Maybe not on the VTK list, however, since I don't think that many of us here use Qt Creator.

There are two strong reasons for using dynamic linking with Qt:
1) it allows you to use the Qt binaries from the Qt download site.
2) it allows you to use the Qt LGPL license without releasing your code

Reason (2) is important.  If you use static Qt libraries, then you must either pay for a Qt license or else release your own code as LGPL or a compatible open-source license.

 - David




On Mon, Mar 20, 2017 at 9:20 AM, Sean McBride <[hidden email]> wrote:
On Thu, 16 Mar 2017 09:07:54 -0700, mbcx9rb9 said:

>Building in Qt Creator gives this error. Building with Cmake compiles
>without any problems

So sounds more like a Qt problem problem, to be asked on a Qt list...

(I've never used Qt, so alas have no further suggestions.)

Sean

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: VTK deployment with static libraries on Mac (and in Qt Creator)

Elvis Stansvik
In reply to this post by mbcx9rb9

Den 20 mars 2017 3:11 em skrev "Richard Brown" <[hidden email]>:
>
> Bump. Does anyone have any experience building a VTK application in Qt Creator with static libraries?

I build our Qt + VTK almost daily from within Qt Creator, but never with static libraries, for the reasons David brought up. I would recommend going with dynamic linking unless you have a very strong reason not to.

I've also recently dabbled with packaging as an AppImage on Linux (worked quite well).

Elvis

>
> Regards,
> Richard
>
>> On 16 Mar 2017, at 17:07, mbcx9rb9 <[hidden email]> wrote:
>>
>> Building in Qt Creator gives this error. Building with Cmake compiles without any problems (I assumed due to VTK_USE_FILE). Also I can compile the program in Qt Creator using dylibs without any problems (so I guess normally Qt links to Cocoa, it's just linking to cocoa when using static libs in Qt that causes the problem).
>>
>> Thanks
>>
>> On 16 Mar 2017 5:01 p.m., "Sean McBride [via VTK]" <ml-node+[hidden email]> wrote:
>>>
>>> On Wed, 15 Mar 2017 14:13:39 +0000, Richard Brown said:
>>>
>>> >So how do I go about linking against Cocoa.framework. With another
>>> >VTK_MODULE_INIT?
>>>
>>> You need to do that when building your application, as opposed to building VTK.  Do you build your app with CMake?  With Xcode?  With something else?  Presumably you're ultimately using clang, in which case something needs to pass "-framework Cocoa" to it.
>>>
>>> Cheers,
>>>
>>> --
>>> ____________________________________________________________
>>> Sean McBride, B. Eng                 [hidden email]
>>> Rogue Research                        www.rogue-research.com
>>> Mac Software Developer              Montréal, Québec, Canada
>>>
>>>
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>>
>>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>>>
>>> Search the list archives at: http://markmail.org/search/?q=vtkusers
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://public.kitware.com/mailman/listinfo/vtkusers
>>>
>>>
>>> ________________________________
>>> If you reply to this email, your message will be added to the discussion below:
>>> http://vtk.1045678.n5.nabble.com/VTK-deployment-with-static-libraries-on-Mac-and-in-Qt-Creator-tp5742475p5742496.html
>>> To unsubscribe from VTK deployment with static libraries on Mac (and in Qt Creator), click here.
>>> NAML
>>
>>
>>
>> ________________________________
>> View this message in context: Re: VTK deployment with static libraries on Mac (and in Qt Creator)
>> Sent from the VTK - Users mailing list archive at Nabble.com.
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Search the list archives at: http://markmail.org/search/?q=vtkusers
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/vtkusers
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: VTK deployment with static libraries on Mac (and in Qt Creator)

mbcx9rb9
In reply to this post by David Gobbi
Hi David, Elvis,

I’ll stick to dynamic libraries in that case. 

After a bit of reading I think I need to copy the dynamic libraries into the app bundle then use install_name_tool to sort out all the paths.

Thanks for the help,
Richard

On 20 Mar 2017, at 17:44, David Gobbi <[hidden email]> wrote:

Hi Richard,

It is possible to build dynamically-linked applications with Qt and VTK, and to share such applications.  On the Mac, the Qt libraries become part of the app bundle.  I do not know how to do this with Qt Creator, but there should definitely be Qt experts around who know how to do it.  Maybe not on the VTK list, however, since I don't think that many of us here use Qt Creator.

There are two strong reasons for using dynamic linking with Qt:
1) it allows you to use the Qt binaries from the Qt download site.
2) it allows you to use the Qt LGPL license without releasing your code

Reason (2) is important.  If you use static Qt libraries, then you must either pay for a Qt license or else release your own code as LGPL or a compatible open-source license.

 - David




On Mon, Mar 20, 2017 at 9:20 AM, Sean McBride <[hidden email]> wrote:
On Thu, 16 Mar 2017 09:07:54 -0700, mbcx9rb9 said:

>Building in Qt Creator gives this error. Building with Cmake compiles
>without any problems

So sounds more like a Qt problem problem, to be asked on a Qt list...

(I've never used Qt, so alas have no further suggestions.)

Sean


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: VTK deployment with static libraries on Mac (and in Qt Creator)

David Gobbi
Hi Richard,

CMake can take care of that for you, see the following web page:
There's more information about this issue on the cmake mailing list.

Cheers,
 - David

On Tue, Mar 21, 2017 at 8:04 AM, Richard Brown <[hidden email]> wrote:
Hi David, Elvis,

I’ll stick to dynamic libraries in that case. 

After a bit of reading I think I need to copy the dynamic libraries into the app bundle then use install_name_tool to sort out all the paths.

Thanks for the help,
Richard

On 20 Mar 2017, at 17:44, David Gobbi <[hidden email]> wrote:

Hi Richard,

It is possible to build dynamically-linked applications with Qt and VTK, and to share such applications.  On the Mac, the Qt libraries become part of the app bundle.  I do not know how to do this with Qt Creator, but there should definitely be Qt experts around who know how to do it.  Maybe not on the VTK list, however, since I don't think that many of us here use Qt Creator.

There are two strong reasons for using dynamic linking with Qt:
1) it allows you to use the Qt binaries from the Qt download site.
2) it allows you to use the Qt LGPL license without releasing your code

Reason (2) is important.  If you use static Qt libraries, then you must either pay for a Qt license or else release your own code as LGPL or a compatible open-source license.

 - David




On Mon, Mar 20, 2017 at 9:20 AM, Sean McBride <[hidden email]> wrote:
On Thu, 16 Mar 2017 09:07:54 -0700, mbcx9rb9 said:

>Building in Qt Creator gives this error. Building with Cmake compiles
>without any problems

So sounds more like a Qt problem problem, to be asked on a Qt list...

(I've never used Qt, so alas have no further suggestions.)

Sean



_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: VTK deployment with static libraries on Mac (and in Qt Creator)

mbcx9rb9
David, 

Sorry for the belated reply and thanks for the pointer, I’ll look into it!

Regards,
Richard

On 21 Mar 2017, at 15:08, David Gobbi [via VTK] <[hidden email]> wrote:

Hi Richard,

CMake can take care of that for you, see the following web page:
There's more information about this issue on the cmake mailing list.

Cheers,
 - David

On Tue, Mar 21, 2017 at 8:04 AM, Richard Brown <<a href="x-msg://3/user/SendEmail.jtp?type=node&amp;node=5742567&amp;i=0" target="_top" rel="nofollow" link="external" class="">[hidden email]> wrote:
Hi David, Elvis,

I’ll stick to dynamic libraries in that case. 

After a bit of reading I think I need to copy the dynamic libraries into the app bundle then use install_name_tool to sort out all the paths.

Thanks for the help,
Richard

On 20 Mar 2017, at 17:44, David Gobbi <<a href="x-msg://3/user/SendEmail.jtp?type=node&amp;node=5742567&amp;i=1" target="_top" rel="nofollow" link="external" class="">[hidden email]> wrote:

Hi Richard,

It is possible to build dynamically-linked applications with Qt and VTK, and to share such applications.  On the Mac, the Qt libraries become part of the app bundle.  I do not know how to do this with Qt Creator, but there should definitely be Qt experts around who know how to do it.  Maybe not on the VTK list, however, since I don't think that many of us here use Qt Creator.

There are two strong reasons for using dynamic linking with Qt:
1) it allows you to use the Qt binaries from the Qt download site.
2) it allows you to use the Qt LGPL license without releasing your code

Reason (2) is important.  If you use static Qt libraries, then you must either pay for a Qt license or else release your own code as LGPL or a compatible open-source license.

 - David




On Mon, Mar 20, 2017 at 9:20 AM, Sean McBride <<a href="x-msg://3/user/SendEmail.jtp?type=node&amp;node=5742567&amp;i=2" target="_top" rel="nofollow" link="external" class="">[hidden email]> wrote:
On Thu, 16 Mar 2017 09:07:54 -0700, mbcx9rb9 said:

>Building in Qt Creator gives this error. Building with Cmake compiles
>without any problems

So sounds more like a Qt problem problem, to be asked on a Qt list...

(I've never used Qt, so alas have no further suggestions.)

Sean



_______________________________________________ 
Powered by www.kitware.com 

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe: 
http://public.kitware.com/mailman/listinfo/vtkusers



If you reply to this email, your message will be added to the discussion below:
http://vtk.1045678.n5.nabble.com/VTK-deployment-with-static-libraries-on-Mac-and-in-Qt-Creator-tp5742475p5742567.html
To unsubscribe from VTK deployment with static libraries on Mac (and in Qt Creator), click here.
NAML

Loading...