I was working a project in C++
and all of the sudden my Mac said that Xcode was finished updating, so I just exited out of the popup and didn't think anything of it. I went back to my project and tried to run my makefile and it said I need to be root to accept Xcode's terms. So, I just booted up Xcode, accepted the terms, and quit. Now, when I work on my project in Vim, I am getting all kinds of errors. E.g.
#include<iostream> // 'iostream' file not found
#include<string>
int main()
{
std::cout << "hello" << std::endl; // use of undeclared identifier 'std'
return 0;
}
I have no idea what has happened. Can anybody help me?
I use g++
to compile and this is the output of g++ --version
:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx- include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.3.0
Thread model: posix
My Xcode
version is now 6.0.1
.
All this being said, I still seem to be able to compile my code. I am just getting all types of errors in Vim, related somehow to this Xcode update.
I use YouCompleteMe
for error highlighting.
I believe I have found the solution. I am assuming that when Xcode updated, its folder structure changed.
I fixed this issue by changing my .ycm_extra_conf.py
. I changed the flag line
'/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1'
to
'/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1',
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다