Compilation issue - iphone

I am facing some compilation issues. In my iPhone app I am using some external library which I have placed in my Frameworks folder. But both these ".a" files and ".h" file comes in red color and they are not getting compiled. Any clue what I am doing wrong here.
It gives errors like not able to find classes of these external lib.

If they are red. Then those files are actually missing from your iPhone project. In order to fix this. Re-download the library (.a and .h) files, then add them into your project again.
I would recommend deleting the "RED" files first, and then re-add the files again.
If you're still having problems after following this. Drop a note.
Hope this helps...

Related

AST Deserialize Issue, input is not a PCH file

I'm currently taking over someone's else project who was in a different country. He is using MumbleKit in his project, however when i try building the project, these errors occurred.                                        
error: input is not a PCH file: '/Users/kai/Library/Developer/Xcode/DerivedData/TestBuild-bivflkvgwypsqidilllttbdfyjjq/Build/Intermediates.noindex/PrecompiledHeaders/SharedPrecompiledHeaders/70367429320928002/CELT-0.7.pch.gch'
fatal error: file '/Users/kai/Library/Developer/Xcode/DerivedData/TestBuild-bivflkvgwypsqidilllttbdfyjjq/Build/Intermediates.noindex/PrecompiledHeaders/SharedPrecompiledHeaders/70367429320928002/CELT-0.7.pch.gch' is not a valid precompiled PCH file
Now, i have tried fixing the header path file and cleaning the project and deleting derived folder's content, still this error occurred. I believe xcode is trying to find a pch file but this .gch is being created instead. How can i prevent this .gch from being created in the derived folder? Or how do i fix this in general since i don't really deal with 3rd party project dependency before.
EDIT : I believe this error is coming from the 3rd party Mumble kit, CELT-0.7 project
Okay, I've found the solution, Mumble kit's CELT project have a file : Base.xcconfig.
There is a variable, GCC_PRECOMPILE_PREFIX_HEADER, initially it was set to YES, after set it NO, that fixed it. Though it will be nice if someone would explain to me what it does exactly.

Issue installing zxing on xCode 4.2

I recently tried installing zxing in xCode 4.2 for my next app. Here is what happened.
I began following the steps, everything was going ok, the first strange thing I noticed is that libZXingWidget.a library showed up red when I added it. I started to get worried because xCode still baffles me. The rest of the steps were followed without issue until I added paths to the header search paths. I tried using an absolute path from /Users to the /cpp/core/src/ and /iphone/ZXingWidget/Classes directories I set up then a relative path and no matter what I get the following error:
clang: error: no such file or directory: '/Users/myusername/Desktop/../../cpp/core/src/zxing/common/GreyscaleLuminanceSource.cpp'
Which .cpp file is causing this seems to rotate around. Funny thing is that do not ever even specify Desktop in my header search paths. Early on I had my folders on my desktop and I was referencing them from there but since then I have deleted that project and have a completely new one. I have no idea what is causing the project to search that location and I would like to know how I can change it.
Thanks!
Try deleting then re-adding the lib. If the problem still occurs, you may want to look into the pbxproj xml file with a text editor to try to see where the wrong path come from.
I had similar problem. Try to move your "cpp" folder to "Users", if it helps then you have problems with your pathes.

Problems with finding Three20 Header Files for iPhone App

I am trying to create an app using three20 for a photo viewer. When I follow the instructions on their site (which is now simply running a python script) it seems to behave correctly but then when I try to build I get a "No such file or directory" error for using #import <Three20/Three20.h>.
I am pretty sure the header search path is correct, but I can't seem to get it working, even when I follow exact tutorials online.
Has anyone seen this problem before and know how to fix it?
Have you checked to make sure you actually have added three20 into your dir. as I remember having a similar problem, when I tried to use three20 which was due to the fact it wasn't in the right place, when I thought it was.
It sounds like you haven't imported the files correctly. Have another look at where you added the files to you project, if you have at all. (If not, you need to drag them into your project first!)
If you try to compile the project without the file added to the project, it will fail. Simply adding a path is not enough.
You need to drag it into Xcode...
Add it to the project...
And then your code should build.
I hope this helps!

Xcode iPhone app package missing files

I'm struggling to figure out what exactly it is that decides which files go into the .app-package when compiling an application in Xcode. I've noticed that most image files go there automatically, while others like yaml-files or psd don't, and I cant find anywhere to set this. So, how do you do this?
Look at the build phases for your application target. You'll find that recognized image files were added to the Copy Bundle Resources phase. To copy files of a type that Xcode doesn't recognize, you can add a Copy Files build phase.
If all else fails, read the documentation.

Build Error - missing required architecture i386 in file

I'm getting this error when building my iPhone application:
ld: warning: in /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.sdk/System/Library
/Frameworks/UIKit.framework/UIKit, missing required architecture i386 in file
It goes the same for all the frameworks in my app. It's very weird since this was not happening earlier.
This happens when you add a framework to your project and unintentionally copy the framework into your project directory.
The fix is to check your project directory (where you store your project on disk) for any iphone SDK *.Framework files and delete them.
Project will build fine afterwards.
I had this same problem, and the solution turned out to be an easy fix. Backup then open project.pbxproj (located inside your project file bundle) in TextMate or TextEdit and search for the section titled "/* Begin XCBuildConfiguration section */". Look for a key named FRAMEWORK_SEARCH_PATHS and delete it and it's contents (once per build configuration, so I removed it in two places). Here is an example of what I deleted:
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(DEVELOPER_DIR)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.sdk/System/Library/Frameworks\"",);
My project now build for both the iPhone device and the iPhoneSimulator.
What has happened here is that Xcode has mysteriously added a "Framework Search Paths" entry that points to a particular iPhone device SDK. For example, mine was recently set to:
$(DEVELOPER_DIR)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.2.1.sdk/System/Library/Frameworks
This leads the compiler to find frameworks of the incorrect architecture. Removing any values under the "Framework Search Paths" key in your target's build settings will resolve the issue.
I just wanted to mention that in XCode if you go to "Edit Project Settings"
and find "Search Paths" There is a field for "Framework Search Paths". Updating this should fix the problem, without having to hack the project file!
Cheers!
Jesse
Check that you didn't copy the framework into your project when you added it. If you copied it, it can't find the original paths. To fix this problem. Delete the AVFoundation framework from your frameworks folder in your project, then add it again, but this time, make sure you don't have copy check marked.
This fixed it for me!
I fixed it in a different way.The reason why i was getting this error was that i added security.framework twice in my project.I was not able to see security framework in xcode ,i opened the project in finder and found this framework which i deleted and problem solved.
If your app is meant to run on the device, make sure you are not trying to run in it on the simulator. May sound obvious, but check anyway.
Though it is possible that something got deleted, it has been my experience that something gets screwed up in the project file. I have yet to pin down what that "something" is. I've had similar issues when the SDK installation is just fine. There are a couple of options.
First, add all of your files to a new project. This seems to usually work. Kind of a pain, though.
Second, you can right-click project in XCode/Get Info/Build/Library Search Paths. Add new paths similar to /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.sdk/usr/lib. Add appropriate versions of that string for each version (2.2.1, etc) and platform (simulator or iPhoneOS). Perform a similar action for Framework Search Paths if frameworks are your problem.
Third, which is more work but more reliable, is to open project.pbxproj from within MyProject.xcodeproj (Textmate is good for this). Look for "/* Begin XCBuildConfiguration section */", then "LIBRARY_SEARCH_PATHS" and "FRAMEWORK_SEARCH_PATHS". Add or modify the paths as appropriate, and save the file.
In any case, a pain in the butt, and I'd sure like to pin-point the cause because I've had this happen a couple of times. Project builds fine, then just up and refuses to do so with what seems to be little reason.
"Edit Project Settings" and find "Search Paths" There is a field for "Framework Search Paths". delete all!!
It just happened here to me as well. Thanks to a great partner we found the answer. Your Xcode may be pointing to the simulator ..change it to a IOS device instead ..built smooth after ....
Run the file command on the framework from Terminal:
file /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.sdk/System/Library /Frameworks/UIKit.framework/UIKit
You should get back a message telling you which architectures the UIKit binary is compatible with. If you don't see "i386" listed, then you've somehow managed to remove the i386 version of UIKit, which will mean that you can't build for the simulator.To fix that, you'll have to re-install the SDK.
If you get some other error, hopefully it'll help you figure out what the actual problem is.
I just want to let you know that In my case, I was having the same problem, I realized that I had an older Xcode folder called Xcode3.1.3 I just rename it because it was an older version and that did the magic for me.
Check your library search paths in your target settings. Sometimes goofy libraries get entered in there and this will give you a similar error.
You can remove all entries in this section.
I'd just experienced something slightly different, because I work on my own library (WM_GSRecognizerLib), but the error is the same.
What'd happen: due to some updates, the path targeting the lib to include (.a) was from the "Debug-iphoneos" folder (where it is generated). Compiling for Generic iOS Devices worked fine, but not for simulator, complaining for the missing i386 architecture.
What I did for this issue, is to also include the binaries from the "Debug-iphonesimulator" folder.
It can help for this topic, because the explanation is here: devices require binaries for arm64/armv7/armv7s, while simulator does need i386.
My solution was to set on simulator target debug YES, just look on git status to see the new line added as architecture only on .project. if you don't set this the build will run to all architectures and will show some missing architecture like i386 or other.
NOTE THAT obviously the main issue is to use some framework that implements some kind of specific architecture.
I too got the same error am using xcode version 4.0.2 so what i did was selected the xcode project file and from their i selected the Target option their i could see the app of my project so i clicked on it and went to the build settings option.
Their in the search option i typed Framework search path, and deleted all the settings and then clicked the build button and that worked for me just fine,
Thanks and Regards