PDA

View Full Version : Qt standalone application with Cocoa Library Crash



rokkamraja
8th June 2010, 14:21
Hi All,

Below is my usecase:

1.) I have a Window Tracking Library on MAC written using Cocoa framework, with XCode 3.1.

2.) I have a QT application compiled on same MAC.

I want to use the DYLIB generated in 1 in Qt application. I am able to compile it successfully without any issues and also able to instantiate the WindowTracker object.

However, the application crashes when I am trying to use the methods defined in the library ?

I would like to know if there are any known issues with such usage, if its possible and any alternatives ?

I have tried compiling Qt with Cocoa and now strangely my application throws an exception at start itself:


*** Terminating app due to uncaught exception 'NSArchiverArchiveInconsistency', reason: '*** -[NSKeyedUnarchiver decodeObjectForKey:]: missing class information for object'
*** Call stack at first throw:
(
0 CoreFoundation 0x00007fff8741ad24 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x00007fff841960f3 objc_exception_throw + 45
2 CoreFoundation 0x00007fff8741ab47 +[NSException raise:format:arguments:] + 103
3 CoreFoundation 0x00007fff8741aad4 +[NSException raise:format:] + 148
4 Foundation 0x00007fff852683c4 _decodeObjectBinary + 665
5 Foundation 0x00007fff85267f99 _decodeObject + 208
6 AppKit 0x00007fff8485340d loadNib + 146
7 AppKit 0x00007fff84852b70 +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:] + 763
8 AppKit 0x00007fff848527a5 +[NSBundle(NSNibLoading) loadNibNamed:owner:] + 326
9 QtGui 0x00000001002cd699 _Z7qt_initP19QApplicationPrivatei + 2249
10 QtGui 0x00000001003373dd _ZN19QApplicationPrivate9constructEv + 77
11 QtGui 0x0000000100337846 _ZN12QApplicationC2ERiPPci + 102
12 myApp 0x000000010000f932 main + 66
13 myApp 0x000000010000ea36 _start + 224
14 myApp 0x000000010000e955 start + 33
15 ??? 0x0000000000000001 0x0 + 1
)
terminate called after throwing an instance of 'NSException'
Abort trap


Any ideas or help on how to get my application working will be greatly appreciated.

The APIs that I have mainly used in my Library are:

1.) CGWindow.h
2.) CGDirectDisplay.h


Thanks,
Raja.