When building my Objective-C project (for Mac OS 10.9, Xcode 5.11), I get the error message
Lexical or Preprocessor Issue 'OpenGL/OpenGL.h' file not found.
The error is caused by the include section of the file CVDisplayLink.h where the above named file is included. CVDisplayLink.h belongs to the framework CoreVideo. Now there are two strange points related to that issue:
The error appeared after I tried to test some basic OpenGL features using the tutorial in the Mac Developer Library ( https://developer.apple.com/library/mac/documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/opengl_drawing/opengl_drawing.html#//apple_ref/doc/uid/TP40001987-CH404-SW8 ).
I added an NSOpenGLView to my MainMenu as well as the related code given in the tutorial. Then the error message appeared. I also tried to add the OpenGL and CoreVideo frameworks to my project target, but this did not help.
After some frustration, I removed the NSOpenGLView from my project, as well as all related code. Now the error Message still appeares and I have no Idea how to ged rid of it.
Related
I get this error only when I try to archive, building for simulator or other test device works. Previously, I had this problem when trying to build for a test device, but I started over and reinstalled the pod and it worked. I have tried setting 'Allow non-modular Includes in Frameworks' to yes in both my project and Target, but this has NOT worked. Any ideas on how to get out of this would be greatly appreciated!
I got the same error (for archiving only) for my Swift framework with C code inside.
Only this remedy helped me.
Add -Xcc -Wno-error=non-modular-include-in-framework-module in Other Swift Flags (build settings of framework). This flag forces the compiller count that error as a warning.
Recently added first swift file to large obj-c project. Compile and run in simulator is fine. Attempt to compile and run for a device and I get a file not found error on the obj-c compiler generated swift header file (aka Objective-C Generated Interface Header Name ending with -swift.h)
I have confirmed (at least to my knowledge) that project settings are correct and can see the file in the (derived data) file system for debug / simulator builds but nothing else.
Have looked at this and this but have not helped. Using xCode8 GM
The problem corrected itself when I
Did a clean (have done many times before)
Built for "Generic" iOS device (success)
Closed and restarted Xcode
Built for Device
go figure..
[Edit] and if this doesn't help .. try this post I just found for more ideas
I'm running OS 10.11, and my Xcode version is 7.2.
All of the sudden my project fails to compile in Xcode. Xcode seems to be confused about the file type -- I'm getting errors that indicate my code is being compiled as C++ even tho all the files in my project are labeled as type Objective-C code. Here are some of the errors that occur in deeply-nested system header files:
Unknown type name 'namespace' 'utility' file not found (from #include_next <utility>)
I've verified that all the files are listed as Objective-C. I've even tried changing them to Objective-C++, by 'Identity and Type', and by also changing the extensions to .mm, but this introduces an even bigger set of mysterious compile errors deep in system-level header files, such as:
Use of undeclared identifier 'nullptr_t'; did you mean 'nullptr'? No member named 'memchr' in the global namespace
I've tried reinstalling Xcode a couple times. Any suggestions?
Further mystifying is that I have a different Mac with the same version of OS X, same version of Xcode, and with the exact same code (verified thru git), and it compiles fine.
I created a new project, copied all the files and configuration to the new project, and the issue resolved itself.
I want to try out Scintilla (in Cocoa), but XCode does not cooperate. I included the Scintilla framework at scite337/scintilla/cocoa/ScintillaFramework/build/Release/Scintilla.framework by right-clicking the target in XCode and selecting Add Existing Frameworks.. and then Add Others.... This seemed to work, suddenly the compiler seemed to find the files because the files produced some parser errors (so it has to get compiled, right?). But after I solved these errors, I got a knew one:
Framework not found Scintilla
Command /Developer/usr/bin/llvm-g++-4.2 failed with exit code 1
I did verify if the Target Membership of the framework was set to required and it was. I tried to set the header search path to the path of the framework as well, but that gave the same error. I have no idea how to proceed from here.
XCode 3.2.6, Mac OS X 10.6.8
I have created an iPhone project that uses uses the ZXing bar code scanning library. I added ZXing using CocoaPods and it works perfectly when I compile it on my system (Mountain Lion with Xcode 4.5 (4G182)). But when I passed it on to the person in charge of producing the signed ipa for enterprise distribution, who from what I understand is also using the same version of Xcode, he is seeing the following parse error when compiling:
Parse Issue
Expected unqualified-id in file included from /The/Absolute/Path/to/Pods/ZXing/objc/src/ZXing/ZXBinarizer.mm
The line that is highlighted is:
#import <ZXing/ZXBinarizer.h>
^
I was able to look at his system via WebEx and I checked the header search paths and the values that were apparently configured via CocoaPods do resolve to the actual location of the files.
When I clicked on the "Parse Issue" line in the issue navigator, it showed only:
../../ZXing/objc/src/ZXing/ZXBinarizer.h
^
I've searched the web quite a bit for a solution and I see plenty references to 'Expected unqualified-id', but most of them are due to malformed code.
There are still quite a few things about Xcode that I do not understand, so I'm hoping that someone will tell me that I've overlooked something simple here.
Posting links to the exact code being compiled would help.
You can use clang -E to see what the code looks like after preprocessing (with all the #imports expanded), and then diff the preprocessed output on your system against the output of the same command on your colleague's system.
I do see in
http://code.google.com/p/zxing/source/browse/trunk/objc/src/ZXing/ZXBinarizer.h
that they're referring to NSObject without #importing <Foundation/Foundation.h> first. This is a bad idea, but it's probably not your actual problem. (I would expect a different error message if it were the culprit.)
Are you 100% sure that your colleague is compiling ZXBinarizer.mm as Objective-C++, not as regular C++?
Are you 100% sure that Xcode doesn't give you any specific file and line information for the error? If Xcode really is just pointing to an #import line, then can you post the 10 lines before and after that line, and also the first 10 lines of the file being #imported?
I ended up having to revert out of using CocoaPods for dependency management and just include the project manually. Since the problem was on someone else's machine, but worked fine on my own, I was unable to determine the real cause. After I just included ZXing directly in my project, he was able to compile it.
smcmahon, I've had a very similar issue with building an iOS project with CocoaPods and seeing those weird errors, and was able to figure out the problem. Make sure that the symlinks that CocoaPods has created (like ZXing/ZXBinarizer.h) are indeed symlinks, and not just regular text files with a filepath in them.
A bit more detailed explanation is in my blog: http://www.egeek.me/2013/01/26/note-about-building-cocoapods-powered-ios-projects/
Hope this will help.