-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot find header files #546
Comments
I'm also running into the same issue after doing an irony upgrade (to irony-20190703.1732) at roughly the same time that I did an OS upgrade (to OSx 10.14), which also included an Xcode upgrade. irony is working just fine, except that it's not finding any of the headers from either the c or c++ standard library. I've tried building irony with the four llvm builds on my system, which include the native Xcode (prefix path: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/), and three different versions from MacPorts: llvm-8.0, llvm-7.0, and llvm-6.0 (which is what I think I was using before). The irony-server seems to be building just fine:
Interestingly, when I use llvm-7.0 or llvm-8.0, flycheck-irony can't find the header files themselves, but it's not complaining about the functions that should be in those headers and company-irony is suggesting them for me (i.e. #include gives an error, but memset() works just fine). However, when I use llvm-6.0 or Xcode, flycheck doesn't complain on the header files and instead complains on the functions (for instance, memset and memcpy both result in "undeclared identifier" errors). I've played around with manually setting the LIBCLANG_LIBRARY and LIBCLANG_INCLUDE_DIR options, and I've used install_name_tool to force irony-server to point to the correct libclang.dylib, but I'm still seeing the same issues. I've been through many battles over the years with reconfiguring irony after llvm updates, but this one finally has me stumped. |
Ok, I bit the bullet and added my system include paths to a .clang_complete file (as per the Mac OS X issues and workaround wiki entry) and now it seems like everything's working again. So I was probably just taking up extra bandwidth by adding to this thread, since it seems like that's pretty much the go-to fix for header issues on a Mac. But I'm still curious about why irony doesn't automatically know where the system headers are. I'm assuming that these would be built into the libclang library, and they're clearly available to clang, since I can compile with it without adding extra -I's. As an aside, and perhaps a path to a possible solution: xcode has a command called "xcrun" to set up a build environment for you. In fact, all of the clang commands that MacPorts installs are just scripts that run "xcrun /path/to/executable/clang-tool." If I try to run those executables on their own without xcrun then I get the same errors that irony throws. Unfortunately, running irony-server with xcrun doesn't make any difference. |
When I have a .c file open, emacs cannot auto-complete on standard library .h files, and functions from standard library .h files show up as errors. On my
#includes
I get 'string.h' file not found'. However, I can use cmake to build what I write with standard libraries. Please help.This the relevant part of my init file:
When I reinstall the irony server, this is the message I get:
The text was updated successfully, but these errors were encountered: