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:

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

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.