On the first line of each file .cpp in a C++-cli project:
#include "StdAfx.h"
..I have the following warning and intellisense refuses to work:
IntelliSense: PCH warning:
I've tried:
Rebooting my machine.
Deleting all the .sdf files.
Doing a clean / rebuild all.
...what might cause this and how can I fix it?
I'm not sure why, but removing and re-adding the last pair of files I added to the project appears to have resolved the issue.
This is possibly because I renamed a class after adding it and the old versions got cached or something like that? Strange that clearing the .sdf file didn't fix it though.
Related
I recently downloaded LLVM-3.9 and built XCode project files for it with:
mkdir llvm-3.9.0.XCode # The .XCode in the name was probably a bad idea
cd llvm-3.9.0.XCode
cmake -G Xcode ../llvm-3.9.0.src/
The cmake then generated a valid looking XCode project files.
Then when I tried opening the project directory with XCode, I kept getting error:
Project .../llvm-3.9.0.XCode cannot be opened because it is missing its project.pbxproj file.
Apparently this error message is often the result of corrupt project files, but this is not the problem in my case. It seems this error can be shown due to different reasons. Here are some similar, but not identical questions that did not help me:
One about merge problems.
A question about where the file shoud be.
One about dropbox problems?
One where the problem seems to be corrupt project files
One where the problem was permissions
The solution I used was this:
cd llvm-3.9.0.XCode
cd LLVM.xcodeproj
open .
In other words, I navigated to the newly generated LLVM.xcodeproj with the shell
and used the system open command on that folder.
I quickly replaced a failing hard drive. All files I checked seem ok. However, my Xcode projects won't compile. I get this message.
error: PCH was compiled with module cache path '/Volumes/MacintoshHD2/Users/david/Library/Developer/Xcode/DerivedData/ModuleCache/2LN1PGURQ7K4J', but the path is currently '/Volumes/HD1 - DATA/Users/david/Library/Developer/Xcode/DerivedData/ModuleCache/2LN1PGURQ7K4J'
Is there a way to fix this?
Thanks
I just deleted my entire DerivedData folder and that did the trick for me
I downloaded files from a separate Stack OverFlow post, and dragged the folder into my project (as a group.) The dependancies get resolved and it shows no error for code that relies on the files, but when I try to compile I get this error:
<unknown>:0: error: unexpected input file: /.../xyz.Swift
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1
It might be nothing, but the files themselves in the project navigator show up as blank icons (while my project's other file have the swift red spalsh icon) despite checking in as swift files in the attribute inspector.
I've fumbled a few times with adding and deleting multiple sets of files, I checked the local dir and nothing seem out of order... is there something else that might be messing this up?
Thanks for suggestions!
Solved - The issue was with the filename extension:
xyz .Swift will not properly link. It will be processed by xcode and solve code issues expecting it, but the linker will hiccup.
renamed files to xyz .swift -> problem solved.
In my case it was after removing a compiler flag in a way it didn't like. Try to figure out what you changed in your compiler settings before it started acting weird. Sometimes because Xcode caches compiled code the problem doesn't immediately start after doing the change!
I haven't seen that precise error before, but don't add files through Finder. Start over, and this time use 'New' -> 'File...' from the Xcode 'File' menu. It has to update its internal manifests to track all project files; you don't want to subvert this process.
After that you may still need to do a 'Clean' before re-building, and perhaps remove all of the DerivedData as well while Xcode is not running:
How can I safely delete in my ~/Library/Developer/Xcode/DerivedData directory?
I am running into this issue, which, although not a show-stopper is becoming increasingly annoying.
I have a project where a rebuild or a build after some changes will result in the C1083 error:
fatal error C1083: Cannot open include file: 'Filename.h' no such file or directory
If I build again, the issue goes away! (I have checked the include directories, they are good). A rebuild always fails with this error and must be followed by a normal build to fix the issue.
Has anybody run into this issue? Any guesses as to what may be the cause of the problem?
I have two targets -- an iOS target and a macOS target. On the iOS target, it first fails to find the file called for by the line
#include "i386/types.h"
in the file types.h. On the macOS target, it fails to find almost all of the headers imported by AppKit.h -- starting with the line
#import <AppKit/AppKitDefines.h>
Interestingly, it did find Foundation.h.
What went wrong, and how can I fix it?
EDIT: I know the files are present on my machine, because other projects find them no problem.
Well, i386 doen't make any sense on IOS so likely some settings have been messed up by having both types of targets...
So start a new project, add only the targets and see if that works out?