Unknown type name 'CGVector'; did you mean 'CIVector'? - uikit

I am working in a project i started in the last Xcode 4 version and when i open and try tu run it using the new Xcode 5 i get this error in both UIPushBehavior.h and UIGravityBehavior.h.
/Applications/xcode 4/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPushBehavior.h:34:34: Unknown type name 'CGVector'; did you mean 'CIVector'?
and does not compile my project.
Any ideas on how to fix this will be greatly appreciated.

Well i fix the error.The problem relied on the Header Search Paths and the Library Search Path both were pointing to the project directories so the UIKit the project was using was an old one.
In my case i fix the problem by changing the Header Search Path to :
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/u‌​sr/include.
and leaving the Library search path pointing to my project folder:
$(SRCROOT)/project_name
Tricky one since it compiled in any version prior to XCode 5 5A1413.
Hope this helps to anyone else.

CGVector is part of CGGeometry.
To fix your problem, make certain the ApplicationServices framework is included in your project and also "#import <CoreGraphics/CGGeometry.h>" at the top of your .m file.
Oh, looking closely at the documentation, I see CGVector was made available as of iOS 7 and later. This means you might have a conflicting type in your project if something else was defining it prior to you using Xcode 5.

Related

Lexical or Preprocessor Issue 'ParseFacebookUtils/PFFacebookUtils.h' file not found

I am getting the below error within AppDelegate.m while trying to run my app. I have removed and re-added the FacebookSDK.framework in hopes that it will help however, it did not. My deployment target is 7.1 and I am using Xcode 5.1.1
Lexical or Preprocessor Issue 'ParseFacebookUtils/PFFacebookUtils.h' file not found on the line below
#import <ParseFacebookUtils/PFFacebookUtils.h>
"ParseFacebookUtils" and "FacebookSDK" are two different frameworks. You get error ParseFacebookUtils.framework, and as I can see from screenshot it is missing. Try to reload it (you can find it in parse-library archive).

Compiling Autotalent v2 Issues with Xcode 5.0.1 and Mavericks

I've been struggling to get Auto Talent from Oli Larkin to compile for some time now. I'm pretty new to Xcode and that may be the issue, but either way I figured I'd see if anyone could help me. I'm trying to compile this in order to make a 64 bit version.
Starting from the top:
I've traced down a few things that I thought were the issues.
Noticed that wdl sdk was missing. Downloaded it from https://github.com/olilarkin/wdl-ol. Added the wdl folder outside of the src folder.
Got some warnings when starting up Xcode 5.0.2. Let Xcode fix them.
Realized that the /Developer/Examples folder doesn't exist in Mavericks. Found https://developer.apple.com/library/mac/samplecode/CoreAudioUtilityClasses/Introduction/Intro.html#//apple_ref/doc/uid/DTS40012328-Intro-DontLinkElementID_2, downloaded the sample code, linked to AUBase as I realized this path needed updating in the AU Build Settings (see screenshot).
iPlug.xcodeproj is in red. Not sure what to do about this. Any ideas? I'm assuming it's important.
Update: Based on the recent comments, I'm now getting somewhere. But, at the moment I'm getting the following errors. This has to do with not having a Lice SDK or something. Is this absolutely needed? If so, do you have the time to elaborate on this and where to get it? Thanks again for all of the help.
It looks like I'm getting another issue as well related to clang. Maybe related to Xcode - Command /Developer/usr/bin/clang failed with exit code 1, not sure.
Note: Before finally getting to the errors above, I had to...
Link CoreMIDI.framework "Frameworks and Libraries" -> "Linked Frameworks" -> App to /System/Library/Frameworks/CoreMIDI.framework.
Set compiler in the build settings to default compiler. Otherwise it said unsupported compiler and threw some warnings. Hopefully this didn't mess anything up.
Rename aeffect.h and aeffectx.h to aeffect.h and aeffectx.h from the VST3 SDK. You can find these files in public.sdk -> source -> vst2.x. Apparently 2.x isn't really supported anymore. After renaming them, I moved them to the VST_SDK folder in WDL as the readme instructed.
the source you have will not compile straight off with recent versions of WDL-OL, since lots has changed. The way to upgrade it is to strip out the pertinent source code (i.e. autotalent.h/cpp and the mayer fft stuff) and re-duplicate one of the template projects in WDL-OL and bring it in to the new folder.
I've done it for you:
https://github.com/olilarkin/autotalent
you can clone this repository into the IPlugExamples folder of WDL-OL, and provided you've put all the SDK files in place it should compile straight off.
oli

Xcode shows many errors but program compiles and runs fine (in both simulator and device)

After installing the CocoaLumberjack' log compressor class I've been getting this annoying behavior: Xcode complains that there are many undeclared identifiers and gives me many errors (not warnings but errors with the red icon).
The thing is that I can compile and run my iPad app just fine but Xcode won't do any autocompletion. I tried cleaning the build folder (Product > option + Clean), and also deleting derived data. I've also rebooted to no avail.
As you can imagine this is a pain to work with. I did have this behavior happen before on a previous version of Xcode; it had something to do with stuff in my precompiled headers file but using the solution above would always fix it. I'm currently using Xcode 4.4 (4F250).
Sample error I'm getting:
Semantic Error: use of undeclared identifier 'DDTTYLogger'
The above happens even with classes that I wrote myself and that have not changed since installing the CocoaLumberjack compressor class.
I finally solved this after MANY attempts using the following:
Remove the last #import from my Prefix.pch and build again. Errors would happen (obviously). Put the line back and build again. No errors would show and after 10 seconds or so, errors would come back again.
Repeat the above except instead of the last #import, remove the last TWO imports, then three, four, etc. I did this until I removed five imports and when I put them back and waited, Xcode stopped complaining.
Note that this didn't occur to me at all. I read this solution on a blog somewhere.
Weird bug...
Open build settings and set "Precompile Prefix Header" to "No", that solved my problem.
Kudos for: https://stackoverflow.com/a/7035492/936957
I've been running into these issues constantly on all the latest versions of Xcode, in both Objective-C and Swift.
I noticed today that I was getting the errors in one particular class file. I removed it from some extra targets it was in and the errors finally went away!
I think Xcode has some fundamental bugs with it's handling of multiple targets right now. My theory is that if the other target is not built, you will essentially see errors from that target. Anyway hope this helps someone.
Not bad,
If you follow these Steps-
1-Clean Xcode(Cmd+Shif+K).
2- Clear Derived Data(Cmd+Shift+G).
Enter this path( ~/Library/Developer/Xcode/DerivedData/).
3- Quit and open again Xcode.
This problem can cause by setting "Target Membership" for some files are not the same.
Example:
A class XYZ put in file "a.swift" and it's used in file "b.swift". But "Target Membership" setting of "a.swift" is not the same "Target Membership" setting of b.swift.
Check "Target Membership" setting as below:
I was having issues with a library installed via cocoapods. Going to Build Settings and searching for 'Allow Non-modular Includes In Framework Modules' then setting it to Yes did the trick.
I had it on Xcode 10.1 when I accidentally pressed:
Cmd+Shift+U - ( build for Testing )
try Clean (Cmd+Shift+K) and then:
Cmd+Shift+R ( build for Running )
After update to Xcode 11, I met the same problem. I tried all the mentioned advices (cleaning folders, turning on/off different settings, restarting xCode), but nothing helped. Also, I have a big project in C, so, I'd like to keep using precompiled headers.
Finally I found that simple restart of Mac OS solves the problem! It's really weird behaviour, but I'm happy anyway that I found a solution – it's hard to code when lots of colourful error messages float around.
For me it helped cleanning the project. XCode->Product->Clean
I got the similar type of issue.
Alternate option to fix this is
Open organizer and delete the derived data of your project or delete all the projects in organizer projects tab. It works fine..
I just had the same thing in Xcode 5.1.
I fixed it by making sure there were no blank lines between #import's
I have removed some extra spaces and extra lines from .pch file and it xcode stopped complaining
This happened to me as well, but cleaning didn't fix it. What did was quitting and reopening XCode. Afterwards, all the phantom errors were gone. For those wondering, the tabs you have open when you close will still be open when you reopen.
I had this issue recently. It can be remedied in some cases by deleting the ModuleCache folder inside DerivedData, along with the project folder in DerivedData. Note that Xcode must be quit before doing this.
Running on Xcode Version 10.1 (10B61), I set the build setting "Increase Sharing of Precompiled Headers" to NO. I was working in an .xcworkspace with many projects sharing the same frameworks, and no Objective-C bridging header (meaning I've added no obj-c code myself). I'm not sure when Xcode did away with .pch files by default, but I didn't have any of those in my project.
Open up a terminal and create a nice little function accessible via the command line...
nano ~/.bashrc
add (making the necessary substitutions between the pointy braces)
cycle() {
git stash save "BACKUP"
git checkout <<SOME OTHER BRANCH>>
git branch -D $1
xcodebuild -allowProvisioningUpdates -workspace <<YOUR WORKSPACE>>.xcworkspace -scheme <<YOUR SCHEME>> -configuration Release clean
git checkout $1
}
^X and save it by following the prompts, then enter source ~/.bashrc to make it visible to the current terminal session.
Make sure your branch is pushed to origin, cause we're going to delete it :)
Call the function using cycle <<MY BRANCH>> (once it's run you might want to call git stash pop to restore any working copy changes)
Hope it works for you! Xcode, get on your game!
In my case (mixed objc/swift project) at least part of errors were caused by absence of imports for some used frameworks, e.g. "import UIKit". Project was compiled successfully because frameworks were anyway included in headers in Prefix.pch file. But errors were shown, for example about not finding method defined in UILabel extension, and yes, this extension was without "import UIKit". So I think these errors in most cases depends on Prefix.pch precompilation/updating.
Touching Prefix.pch, cleaning, removing derived data, closing/opening XCode sometimes helps, but not always.
Using SPM, it can be that the Module you import, which you use at the location of the errors, has missing dependencies itself.
In my case I had an error about a missing initializer, XCode trying to use a different one than the one already defined in the other Module. But the project compiled fine! Nothing worked at first. Then I tried first cleaning, and then Product -> Perform Action -> Compile "myfile.swift" and it showed what the missing dependency in the dependency was! Note: This goes recursive. In multiple places a depenendency may have not been declared in the package.swift -> compile the same file repeatedly until it compiles successfully.
So.. it wasn't that the module with the error had a missing dependency, but rather that the direct dependency did miss a Module-dependency declaration in its package.swift declaration.
My explanation is that to generate the Error-output of XCode, Modules get compiled alone on their own. Import errors then show up. But when Modules are built as part of a larger Module, then that large module may import the missing dependency of the broken sub-Module already, making the build pass.

Mac Ogre Xcode project can't find headers

While trying to get the template Xcode 4 ogre project to work, the build fails because it can't find OgreCamera.h.
I've installed Ogre to /opt/local/lib/OGRE, and specified that as the Ogre SDK location when creating the Xcode 4 project.
Needless to say, the header and framework include paths in the project settings point exactly to where all the header files are, yet not one of them can be found. I've tried commenting out the include of OgreCamera.h, and upon trying to run, the next include, OgreEntity.h, cannot be found. Commenting that out and running again, the next include can't be found, and so on (these includes are in OgreFramework.h.
I don't understand why these headers, which clearly exist when I go look for them in the Finder or Terminal, can't be found by the project, even when I specify their full path like this:
#include </opt/local/lib/OGRE/lib/release/Ogre.framework/Versions/1.7.4/Headers/OgreCamera.h>
Did I somehow install the Ogre SDK incorrectly? (I copied it from the DMG into place…)
I had the same problem, and found partial success by following rjstelling's answer from this thread:
why can't Xcode find this header file?
That solved the OgreCamera.h include issues, but now I'm stuck on including the boost libraries. They are not picked up on the search paths, or in the Indexing group as suggested in the thread above.
Basically it looks like a bug in XCode4 that has to be worked around until a patch is released. There is also more information here:
Compile, Build or Archive problems with Xcode 4 (and dependencies)

Adding a framework in Xcode

Im trying to add a third party framework in Xcode but I'm getting an error that it can't be found
error: MKAbeFook/MKAbeFook.h: No Such File or Directory
I've added it in the Linked Frameworks group and added it to the Target for this project. I've also added it to a new Copy Files build phase for that target.
Basically I've followed the instructions here: http://pointlesscrap.net/mkabefook/desktop/gettingstarted
Any ideas where I'm going wrong?
Best way to diagnose this is to post the compiler invocation line, not just the error (you can just drag and drop the line from the Build Results window that says "Compiling foo.m"). My expectation is that you don't have a Frameworks Search Path set up for the location of the framework. Xcode usually adds that manually when you add the framework, but if you put it in certain kinds of places, or added it in certain ways, you need to manually point your target's Framework Search Paths at its directory.
Perhaps the author mistook MKFaceBook for MKAbeFook?
EDIT: Never mind, it looks like that is actully the name of the framework.

Resources