Question

Ok so I am an engineer / applied-math guy and someone only mildly technical was impressed by a linux version of some software but wants it for Mac (Doctors...)

Can someone point me at how to redistribute an executable for Mac? Before I ditched Windows the atomic solution was to copy a bunch of DLL's into their System32 folder. Some sub-questions:

1) Ok I see "sudo macports install XYZ". Will this allow me to statically build QT apps? Or, suppose they have QT installed, how do I get my app to find it on their comp?

2) Maybe there's an example out there, using VTK + QT + Boost, for building application for Mac?

My apologies with the vague question, if I knew what to methodically search for I would have done so.

Was it helpful?

Solution

Is there any specific reason why you want to statically link Qt+VTK+Boost with the app? On the Mac, for libraries like these I can't think of any reason (except licensing) why static linking would be preferable to dynamic.

Take a look at the "Deploying an Application on Mac OS X" link that Bavarious posted. It explains how Mac apps are stored in bundles, allowing an app made up of many files to appear to the user as a single file. Libraries can also be stored in a bundle (along with their header files), in which case it's called a framework. Any needed frameworks can be stored inside the app bundle, making the app self-contained.

Qt comes with a utility called macdeployqt which automatically copies the Qt frameworks (plus plugins) into the bundle, then fixes up the app binary (using install_name_tool) so the dynamic linker knows to look in the app bundle. You'll probably need to do this manually for VTK and Boost, which could be more complicated if they aren't built automatically as frameworks. They are popular libraries though, there should be guides on the Internet about deploying Mac apps with VTK/Boost.

Also, I would not use MacPorts to install Qt for this purpose. The Qt binaries available from Nokia work just fine, and they are universal (built for both 32-bit and 64-bit, in case you need to target both).

By the way, I'm not particularly a Windows guy, but I don't think throwing DLLs into System32 is a good way to deploy libraries on Windows. For a Qt app I made, we put the Qt DLLs (and mingw/gcc DLLs) into the same folder as the .exe, and it worked fine.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top