[Interest] How to include a Objective-C project as a .pri?

Nuno Santos nunosantos at imaginando.pt
Fri Jul 17 12:03:08 CEST 2015


Ok, I have found the problem. The lib comes with a .pch file with the following content:

//
// Prefix header for all source files of the 'AEAudioController' target in the 'AEAudioController' project
//

#ifdef __OBJC__
    #import <Foundation/Foundation.h>
#endif

I have added the qmake variable:

PRECOMPILED_HEADER += $$PWD/TheAmazingAudioEngine/TheAmazingAudioEngine/TheAmazingAudioEngine-Prefix.pch

It is now compiling. Only one error left:

@synthesize of 'weak' property is only allowed in ARC or GC mode

Does anyone knows how can I enabled ARC from .pro file?

Thanks,

Nuno Santos
Founder / CEO / CTO
www.imaginando.pt
+351 91 621 69 62

> On 17 Jul 2015, at 10:32, Nuno Santos <nunosantos at imaginando.pt> wrote:
> 
> Hi,
> 
> I’m trying to add an Objective-C project as .pri
> 
> However, during compiling for iOS-clang, it complains about not knowing about NSObject and BOOL types. Isn’t this supposed to be part of the iOS-clang compilator knowledge? 
> 
> This is my .pri file. I have added TheAmazingAudioEngine as a git submodule:
> 
> ios {
>     HEADERS += $$PWD/TheAmazingAudioEngine/TheAmazingAudioEngine/TheAmazingAudioEngine.h \
>                $$PWD/TheAmazingAudioEngine/TheAmazingAudioEngine/AEAudioController+Audiobus.h \
>                $$PWD/TheAmazingAudioEngine/TheAmazingAudioEngine/AEAudioController+AudiobusStub.h \
>                $$PWD/TheAmazingAudioEngine/TheAmazingAudioEngine/AEAudioController.h \
>                $$PWD/TheAmazingAudioEngine/TheAmazingAudioEngine/AEAudioFileLoaderOperation.h \
>                $$PWD/TheAmazingAudioEngine/TheAmazingAudioEngine/AEAudioFilePlayer.h \
>                $$PWD/TheAmazingAudioEngine/TheAmazingAudioEngine/AEAudioFileWriter.h \
>                $$PWD/TheAmazingAudioEngine/TheAmazingAudioEngine/AEAudioUnitChannel.h \
>                $$PWD/TheAmazingAudioEngine/TheAmazingAudioEngine/AEAudioUnitFilter.h \
>                $$PWD/TheAmazingAudioEngine/TheAmazingAudioEngine/AEBlockAudioReceiver.h \
>                $$PWD/TheAmazingAudioEngine/TheAmazingAudioEngine/AEBlockChannel.h \
>                $$PWD/TheAmazingAudioEngine/TheAmazingAudioEngine/AEBlockFilter.h \
>                $$PWD/TheAmazingAudioEngine/TheAmazingAudioEngine/AEBlockScheduler.h \
>                $$PWD/TheAmazingAudioEngine/TheAmazingAudioEngine/AEFloatConverter.h \
>                $$PWD/TheAmazingAudioEngine/TheAmazingAudioEngine/AEUtilities.h \
>                $$PWD/TheAmazingAudioEngine/TheAmazingAudioEngine/TheAmazingAudioEngine-Prefix.pch \
>                $$PWD/TheAmazingAudioEngine/TheAmazingAudioEngine/Library/TPCircularBuffer/TPCircularBuffer.h \
>                $$PWD/TheAmazingAudioEngine/TheAmazingAudioEngine/Library/TPCircularBuffer/TPCircularBuffer+AudioBufferList.h
> 
>     OBJECTIVE_SOURCES += $$PWD/TheAmazingAudioEngine/TheAmazingAudioEngine/AEAudioController+Audiobus.m \
>                          $$PWD/TheAmazingAudioEngine/TheAmazingAudioEngine/AEAudioController.m \
>                          $$PWD/TheAmazingAudioEngine/TheAmazingAudioEngine/AEAudioFileLoaderOperation.m \
>                          $$PWD/TheAmazingAudioEngine/TheAmazingAudioEngine/AEAudioFilePlayer.m \
>                          $$PWD/TheAmazingAudioEngine/TheAmazingAudioEngine/AEAudioFileWriter.m \
>                          $$PWD/TheAmazingAudioEngine/TheAmazingAudioEngine/AEAudioUnitChannel.m \
>                          $$PWD/TheAmazingAudioEngine/TheAmazingAudioEngine/AEAudioUnitFilter.m \
>                          $$PWD/TheAmazingAudioEngine/TheAmazingAudioEngine/AEBlockAudioReceiver.m \
>                          $$PWD/TheAmazingAudioEngine/TheAmazingAudioEngine/AEBlockChannel.m \
>                          $$PWD/TheAmazingAudioEngine/TheAmazingAudioEngine/AEBlockFilter.m \
>                          $$PWD/TheAmazingAudioEngine/TheAmazingAudioEngine/AEBlockScheduler.m \
>                          $$PWD/TheAmazingAudioEngine/TheAmazingAudioEngine/AEFloatConverter.m
>                          
> 
>     SOURCES += $$PWD/TheAmazingAudioEngine/TheAmazingAudioEngine/AEUtilities.c \
>                $$PWD/TheAmazingAudioEngine/TheAmazingAudioEngine/Library/TPCircularBuffer/TPCircularBuffer.c \
>                $$PWD/TheAmazingAudioEngine/TheAmazingAudioEngine/Library/TPCircularBuffer/TPCircularBuffer+AudioBufferList.c
> }
> 
> The instructions for this lib relies in adding their xcode project to the xcode project but I usually use QtCreator to manage my projects and I only generate the xcode project for deploying. 
> 
> This is the kind of errors:
> 
> In file included from /Users/nsantos/Dropbox/workspace/drc/TheAmazingAudioEngine/TheAmazingAudioEngine/AEAudioController.m:26:
> /Users/nsantos/Dropbox/workspace/drc/TheAmazingAudioEngine/TheAmazingAudioEngine/AEAudioController.h:141:28: error: cannot find protocol declaration for 'NSObject'
> @protocol AEAudioPlayable <NSObject>
>                            ^
> /Users/nsantos/Dropbox/workspace/drc/TheAmazingAudioEngine/TheAmazingAudioEngine/AEAudioController.h:184:33: error: unknown type name 'BOOL'
> @property (nonatomic, readonly) BOOL channelIsPlaying;
>                                 ^
> /Users/nsantos/Dropbox/workspace/drc/TheAmazingAudioEngine/TheAmazingAudioEngine/AEAudioController.h:194:33: error: unknown type name 'BOOL'
> @property (nonatomic, readonly) BOOL channelIsMuted;
>                                 ^
> /Users/nsantos/Dropbox/workspace/drc/TheAmazingAudioEngine/TheAmazingAudioEngine/AEAudioController.h:249:28: error: cannot find protocol declaration for 'NSObject'
> @protocol AEAudioReceiver <NSObject>
>                            ^
> /Users/nsantos/Dropbox/workspace/drc/TheAmazingAudioEngine/TheAmazingAudioEngine/AEAudioController.h:328:26: error: cannot find protocol declaration for 'NSObject'
> @protocol AEAudioFilter <NSObject>
>                          ^
> /Users/nsantos/Dropbox/workspace/drc/TheAmazingAudioEngine/TheAmazingAudioEngine/AEAudioController.h:396:34: error: cannot find protocol declaration for 'NSObject'
> @protocol AEAudioTimingReceiver <NSObject>
>                                  ^
> /Users/nsantos/Dropbox/workspace/drc/TheAmazingAudioEngine/TheAmazingAudioEngine/AEAudioController.h:442:32: error: cannot find interface declaration for 'NSObject', superclass of 'AEAudioController'
> @interface AEAudioController : NSObject
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~   ^
> /Users/nsantos/Dropbox/workspace/drc/TheAmazingAudioEngine/TheAmazingAudioEngine/AEAudioController.h:478:4: error: expected a type
> + (BOOL)voiceProcessingAvailable;
>    ^
> /Users/nsantos/Dropbox/workspace/drc/TheAmazingAudioEngine/TheAmazingAudioEngine/AEAudioController.h:478:1: warning: method has no return type specified; defaults to 'id' [-Wmissing-method-return-type]
> + (BOOL)voiceProcessingAvailable;
> ^
>         (id)
> /Users/nsantos/Dropbox/workspace/drc/TheAmazingAudioEngine/TheAmazingAudioEngine/AEAudioController.h:500:92: error: expected a type
> - (id)initWithAudioDescription:(AudioStreamBasicDescription)audioDescription inputEnabled:(BOOL)enableInput;
> 
> Any ideas?
> 
> Thanks in advance,
> 
> Regards,
> 
> Nuno
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150717/dc7d6f48/attachment.html>


More information about the Interest mailing list