"iostream" file not found in Xcode 4.2 - iphone

I'm adding Zxing 1.7(Qr scanner) to my projects.
I upgraded Mac OS X to Lion and xcode4.2, iOS5.0.
Problem is that when I run the project, I always saw "iostream file not found".
I run the scanTest(Qr scanner test sample code prvided from Zxing team) ,but it works well.
So, I compare my projects and scanTest, but I can't find any difference.
What can I do to solve this problem?

You can only include iostream in C++ or ObjectiveC++ files. If your case is the latter, the file suffix needs to be .mm. So, for example, if your controller class imports QRCodeReader.h and is named MyController.m, it should be renamed MyController.m → MyController.mm.

Yes Right. This post helps me in understanding this concept a lot.
We make error when we are importing QRCodeReader.h into .m file of the project. Instead of this change the extension of the file to .mm file.
it will include iostream file in the counted.h file of your project.
thanks guys.

Related

Cocoapod xcode workspace - swift and objective-c source files

First time in trying to create a cocoapod project.
I used 'pod library create name' command creating the standard template, using the swift language option.
I have added in C-files to the workspace but I don't know how to add a bridging header file so swift can import the C functions.
An attempt resulted in the compiler complaining about using a bridging header in a framework.
Is it actually possible to mix and match swift & (obj-)C files in the same cocoapod workspace/project?
TIA
Mark
Woke up next morning and found the answer.
Sorry for the traffic.
Edit the XXX-umbrella.h file.

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 integrate aurioTouch app functionality in other app?

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]

How to use fopen from a C library while Using iPhone SDK

I apologize in advance if this has been addressed, but I have not found a specific answer as of yet.
First, I am trying to use a C library in an iPhone/Cocoa touch app. It compiles fine as a plain C project and as a plain Foundation project (using X-code). My problems is this: The library uses a dictionary file which is called directly using fopen(). My question is how can that file be accessed on an iPhone from a C library which does not or cannot use Objective-C/SDK routines. I'm assuming that there is a way...somehow.
Thanks!
I think fopen is ok. But XCode put all resource files into the root directory. So maybe you should rewrite the library to open the file from the root.
Other solution is to create "folder reference" with "Add to project" menu. This way I think the whole folder will be copied to the app bundle.