How to integrate aurioTouch app functionality in other app? - iphone

I am trying to integrate aurioTouch app functionality in my app but I am having problems because few portion of that app is written in C++ and for this I changed my .m file into .mm but still having issues. I have added the image. Please see/ How this error can be resolved?

Read this:
https://stackoverflow.com/a/4714727/88461
If you have a .cpp file with C++ code that needs to use Objective-C as
well, either rename that .cpp file to .mm or pass -x objective-c++ to
the compiler.

I also faced the same issue and was unable to sort it out for a very long time. The real problem starts when you import the auriotouch's .cpp classes in to your project. Generally while doing that we face a lot of compilation errors and sometimes linker errors. So,
First:
Change the extension of all of your class files in your project from .m to .mm. This will make your class files to support both C++ and objective C codes. [If not, u'll face multiple compilation issues]
Second:
Check whether you have imported the class files(.m, .mm or.cpp) in Project->Targets-> build phases-> Compile sources. [If not, u'll face linker errors]
Third:
Try to check whether u have properly declared the global variables in your class files. [If not, it might show duplicate symbol error]

Related

GenericKeyChain KeychainItemWrapper.m does not compile when copied to another project

I compile and run Apple's GenericKeyChain sample code. No problems there. Now I want to use both files KeychainItemWrapper.m and KeychainItemWrapper.h in my new project and I get lots of compilation errors. I see that Apple's sample code is using ARC. Other posting here direct people to disable ARC for this file. That did not work. I have link the Security Framework on my new project.
My question is what should I do to get these two files compiled successfully on my new project. Why Apple sample code compiles with no problems.
The compilation errors are mostly ARC Casting Rules and ARC restrictions as well as Semantic Issue of using "release".
try the following 2 methods:
Go to Build Setting -> Swift Compiler -> Objective-C Bridging Header and set the path to /"Your project name"-Bridging-Header.h
ex path: myProject/myProject-Bridging-Header.h
Go to Build Phase -> Compile Source and pick the objective-c file (.m file) and set compiler flag to be "-fno-objc-arc"

WebRTC in iPhone (gas-preprocessor issues)

I'm trying compile the lastest WebRTC version for iPhone. I not need to compile the entire solution, I only need to compile the VAD module.
To do that, I have created a Xcode project and I have tried to compile the source necessary, but I have a problem with the *.s files and its assembler.
Like in the FFMPEG library, I know that I must "translate" the assembler code to an assembler code that the gcc for iPhone understand, but I don't know how I do this manually.
I have tried to create a configure file and set in it "as=gas-preprocessor.pl" (like in FFMPEG), but does not work.
Any idea? How do I run the gas-preprocessor.pl manually?
Thanks.
I'm just finishing it on iOS and has built standalone static libraries of NS/VAD/AECM and AGC, here's some tips for you, and hope you success:
1. Source File List
for standalone VAD build, you should make sure your project has all of these files(no .s file needed), and I'm not listed the header files here, you will get some header file can not be found errors, just fixing it and things will be done.)
webrtc_vad.c
vad_core.c
vad_filterbank.c
vad_gmm.c
vad_sp.c
real_fft.c
division_operations.c
complex_bit_reverse.c
cross_correlation.c
complex_fft.c
downsample_fast.c
vector_scaling_operations.c
get_scaling_square.c
energy.c
min_max_operations.c
spl_init.c
2. Adding a macro called WEBRTC_MAC
I'm not sure why the Xcode environment does not provide this macro, but it should be defined to ensure that WEBRTC_POSIX is enabled. To define this macro, adding it to a new header file or just define it in the webrtc-header-files.
3. Following these steps to build and setup a static library of WebRTC-VAD module on iOS
notice, do not use LLVM 2.0 to compile the VAD module(use GCC or LLVM GCC). cus' it can throw you lots of errors when compiling some webrtc variable declarations.
4. Using the libwebrtc_vad.a
if you got this far, things are easy to go, just include webrtc_vad.h and using the API provided by this module. and vad is working fine in my case.
hope i helped.
try to check this link https://groups.google.com/forum/?fromgroups=#!topic/discuss-webrtc/VJg-fk2-i_0 i believe you have to set inline assembly correctly. I am also onto this so let me know if you want to switch emails or something.

Library Project Reference in Xcode

I know something like this is already asked many times on SO, but I've tried everything (been at this for three hours now) and I still didn't find a solution. I'm quite new to xCode and I'm starting to work on a project that was originally created by somebody else.
So, I have a library project in my xcode (XS2Library) and now I would like to reference to that library in my other project (WaarBenJij). Building the Library succeeds and I reference to it by adding the LibXS2Library.a to the Project target's "Link Binary With Libraries".
Xcode doesn't give me any errors, so it looks like the library project is referenced appropriately. However, when I try to build my project I get the error that a class that resides in my library project cannot be found ("'XS2URLLoader.h' file not found").
Can anybody steer me in the right direction, maybe?
There's a sensible difference between the .a file, which is needed for linkage and contains the library source, and the .h file, which is needed to compile (and preprocess) and which contains the functions and classes declarations.
Here you included the .a file, which is required for a later step, but to use the library you also need to import the required .h files into your project.
The easier way is to simply put them in your project.
Or you can add the whole library as a subproject and as a dependency.

How to use in ObjectiveC project C++ files

I have a reqular objective C project. I import 10 C++ files into my project. All this files take "are communicating" with each other. If I have a look at File1.h, this file can manage all the operations in other class.
So, the question is How to include reference to File1.h and to call functions from it.
For example: [File1Class getAudioData];
If I include it by #include "File1.h", I will get a error "Class is unknown element"
P.S. I want to import aurioTouch2 sample code to my project and to call functions from theire C++ code.
You Can simply open both the projects in Xcode and drag and drop the files you need from the aurioTouch2 application. Make sure the files are actually copied by selecting the check mark that you get after you drop the files in your xcode project. After this, you will be able to use those files/classes. Consider using ".mm" as the extension of the implementation file in which you want to use the c++ files/classes. You may also use ".mm" as extension for your appdelegate implementation file in case you get c++ related errors.

why do I get this error building a static library for my iPhone project using XCode 4?

I have an existing iPhone application, and I just wanted to make a static library out of the code, so that I can use it by a separate test application (within the workspace). The application compiles fine, but when I try to compile the library version (which has the same code files) I get the following error:
Lexical or Preprocessor Issue - "MyClass.h" file not found
However, the application still runs, even through there is this error. In fact when I compile the application (which uses the static library) it initially says no errors, and then after a second or two the above mention error then appears.
I'm basically doing:
Create a new target in the project using the Coco Touch Static Library
Add the .m files in the targets "Compile Sources"
Adding the .h files in the targets "Copy Headers"
Adding the same set of libraries in the "Link binaries with libraries"
Go into the Profile and modified the Target to be RELEASE
Any suggestions? Am I missing a step here?
I'll have a stab at this :-) I think it might be that MyClass.h has been set to private. Thus it is not added to header directory when you create the static library. You should check to see if this is so by checking the output header directory. If the header file is missing, then it's pretty sure thats whats going on.
Secondly, why use a seperate app for testing and therefore require building a static library at all? I have several static libraries and apps which I unit test with GHUnit. I do it by simply adding a new app target and configuring it to run the GHUnit iOS app. I can then add the classes I want to test and any testing frameworks such as OCMock without having to create separate projects. Basically it sounds like your testing methodolody is perhaps more complex than necessary. :-)
So, the issue turned out to be I had "-ObjC" set in the "Other Link Flags" option, which I'd put there as at one stage trying to get things working I read this was required - Dereks advice to review the compilation log worked well here