{"action":"created","issue":{"url":"https://api.github.com/repos/Valloric/YouCompleteMe/issues/1353","repository_url":"https://api.github.com/repos/Valloric/YouCompleteMe","labels_url":"https://api.github.com/repos/Valloric/YouCompleteMe/issues/1353/labels{/name}","comments_url":"https://api.github.com/repos/Valloric/YouCompleteMe/issues/1353/comments","events_url":"https://api.github.com/repos/Valloric/YouCompleteMe/issues/1353/events","html_url":"https://github.com/Valloric/YouCompleteMe/issues/1353","id":56364157,"number":1353,"title":"Some Objective-C modules not working?","user":{"login":"HiPhish","id":4954650,"avatar_url":"https://avatars.githubusercontent.com/u/4954650?v=3","gravatar_id":"","url":"https://api.github.com/users/HiPhish","html_url":"https://github.com/HiPhish","followers_url":"https://api.github.com/users/HiPhish/followers","following_url":"https://api.github.com/users/HiPhish/following{/other_user}","gists_url":"https://api.github.com/users/HiPhish/gists{/gist_id}","starred_url":"https://api.github.com/users/HiPhish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HiPhish/subscriptions","organizations_url":"https://api.github.com/users/HiPhish/orgs","repos_url":"https://api.github.com/users/HiPhish/repos","events_url":"https://api.github.com/users/HiPhish/events{/privacy}","received_events_url":"https://api.github.com/users/HiPhish/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":18,"created_at":"2015-02-03T11:13:12Z","updated_at":"2016-08-25T22:23:55Z","closed_at":"2015-02-04T15:30:54Z","body":"I want to use Vim for writing Objective-C code and a makefile for compilation instead of relying on XCode. I have it all working now, but the last problem is YouCompleteMe.\r\n\r\nObjective-C has a feature called modules, basically instead of using the preprocessor like for example `#include <Cocoa/Cocoa.h>` you use a language directive: `@import Cocoa;`\r\n\r\nThis feature is built into Clang and the developers want to make it part of the standard for C and C++. Here is a video presentation explaining the problem with the preprocessor and how modules solve it:\r\nhttps://www.youtube.com/watch?v=4Xo9iH5VLQ0\r\n\r\nHere are my compiler flags from .ycm_extra_conf.py:\r\n```python\r\nflags = [\r\n'-c',\r\n'-ObjC',\r\n'-fmodules',\r\n'-fobjc-arc',\r\n]\r\n```\r\nThe third flag is the one that turns modules on in Clang. I use these exact same flags in my makefile, so I know that they do work:\r\n```\r\nC_FLAGS = -ObjC -Werror -pedantic-errors -fmodules -fobjc-arc\r\n\r\n# Program binary\r\nopengl: opengl.o AppDelegate.o MyOpenGLView.o\r\n\tclang ${C_FLAGS} -o ${EXECUTABLE_NAME} opengl.o AppDelegate.o MyOpenGLView.o\r\n\r\nopengl.o: main.m\r\n\tclang -c ${C_FLAGS} -o opengl.o main.m\r\n\r\nAppDelegate.o: AppDelegate.m AppDelegate.h\r\n\tclang -c ${C_FLAGS} -o AppDelegate.o AppDelegate.m\r\n\r\nMyOpenGLView.o: MyOpenGLView/MyOpenGLView.h MyOpenGLView/MyOpenGLView.m\r\n\tclang -c ${C_FLAGS} -o MyOpenGLView.o MyOpenGLView/MyOpenGLView.m\r\n\r\n```\r\n\r\nThe weird part is that some modules do seem to work:\r\n```objc-c\r\n@import OpenGL.GL3; // works fine\r\n@import Foundation; // could not build module 'Foundation'\r\n@import asdjfljalk; // module 'asdjfljalk' not found\r\n```\r\nThe third is just some random nonsense, but the fact that the error is different implies that the Foundation module was found, that it just couldn't be built. But the module is not broken, it builds fine from the command-line using the makefile. Is YCM using a different Clang than what I compile code with?\r\n\r\nA minimum example source file looks like this:\r\n```objc-c\r\n@import AppKit;\r\n@interface MyOpenGLView : NSOpenGLView {\r\n}\r\n@end\r\n```\r\nThat's the header file I use form my class. I am on OS X 10.10.2 using MacVim 7.4 with a huge install. YCM works fine for C and C#, if that's relevant."},"comment":{"url":"https://api.github.com/repos/Valloric/YouCompleteMe/issues/comments/242562832","html_url":"https://github.com/Valloric/YouCompleteMe/issues/1353#issuecomment-242562832","issue_url":"https://api.github.com/repos/Valloric/YouCompleteMe/issues/1353","id":242562832,"user":{"login":"micbou","id":10026824,"avatar_url":"https://avatars.githubusercontent.com/u/10026824?v=3","gravatar_id":"","url":"https://api.github.com/users/micbou","html_url":"https://github.com/micbou","followers_url":"https://api.github.com/users/micbou/followers","following_url":"https://api.github.com/users/micbou/following{/other_user}","gists_url":"https://api.github.com/users/micbou/gists{/gist_id}","starred_url":"https://api.github.com/users/micbou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/micbou/subscriptions","organizations_url":"https://api.github.com/users/micbou/orgs","repos_url":"https://api.github.com/users/micbou/repos","events_url":"https://api.github.com/users/micbou/events{/privacy}","received_events_url":"https://api.github.com/users/micbou/received_events","type":"User","site_admin":false},"created_at":"2016-08-25T22:23:55Z","updated_at":"2016-08-25T22:23:55Z","body":"@haifengkao Clang 4.0? 3.9 has not yet been released. "}}
{"actor":{"display_login":"micbou"}}