Question

I am trying to implement the automatic updater for my application written in C++/Qt. It should work on Mac OS X. I've searched over the web and found out that Sparkle framework should be suitable for my needs. I added Sparkle framework 1.5 b6 to my xcode project, also added the header file:

#include <Sparkle/Sparkle.h> 

Now, when I try to build the project, the compiler gives me a lot of errors in SUVersionComparisonProtocol.h and SUUpdater.h:

Expected unqualified-id: @protocol SUVersionComparison
Expected unqualified-id: @end
Expected unqualified-id: @interface SUUpdater: NSObject {

etc etc

I see those headers are written in Objective-C, so it seems like C++ compiler simply can't handle them. However, I know C++ applications that use Sparkle. So could somebody tell me how should it be used in C++ applications?

Was it helpful?

Solution

Indeed, you need to mix C++ and Objective-C.

Here is an excellent explanation, along with an implementation example: http://el-tramo.be/blog/mixing-cocoa-and-qt/

and here is a C++/Qt project that builds a Qt-usable dylib wrapper for Sparkle: https://github.com/Roxee/qt-roxeemegaup/

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