How to config YouCompleteMe for C language? Announcing the arrival of Valued Associate #679:...
Why aren't road bike wheels tiny?
Why are two-digit numbers in Jonathan Swift's "Gulliver's Travels" (1726) written in "German style"?
Will I be more secure with my own router behind my ISP's router?
Married in secret, can marital status in passport be changed at a later date?
How to keep bees out of canned beverages?
Help Recreating a Table
Can I take recommendation from someone I met at a conference?
Has a Nobel Peace laureate ever been accused of war crimes?
A German immigrant ancestor has a "Registration Affidavit of Alien Enemy" on file. What does that mean exactly?
Knights and Knaves question
Why doesn't the university give past final exams' answers?
How to break 信じようとしていただけかも知れない into separate parts?
How can I introduce the names of fantasy creatures to the reader?
What helicopter has the most rotor blades?
Why did Bronn offer to be Tyrion Lannister's champion in trial by combat?
Assertions In A Mock Callout Test
What could prevent concentrated local exploration?
What is the definining line between a helicopter and a drone a person can ride in?
What were wait-states, and why was it only an issue for PCs?
Where is Bhagavad Gita referred to as Hari Gita?
Why isn't everyone flabbergasted about Bran's "gift"?
How to create a command for the "strange m" symbol in latex?
Is Bran literally the world's memory?
Is it OK if I do not take the receipt in Germany?
How to config YouCompleteMe for C language?
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)Are there any autocompletion plugins for vim?How to setup VIM for php development?How do I install package libc6-dev-i386 on fedora?In Vim (with YouCompleteMe), can I limit the number of possible completions shown?how to save changes to config directory`vim` and `YouCompleteMe`YouCompleteMe set flags for filetypeVim: use tab key for autocompletion with Autocomplpop pluginYouCompleteMe gives continiously error in VimNeovim no ~/.config/nvim
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
Recently, I installed YouCompleteMe
and I'm new user in it. I read installation instructions from this link: http://valloric.github.io/YouCompleteMe. Now, I can use it for python and etc, but I can't use it for C. I don't understand what's the meaning of this sentence from the link: "forget that if you want the C-family semantic completion engine to work, you will need to provide the compilation flags for your project to YCM."
I read the YCM user guide, but I couldn't solve my problem. Tnx from anybody who explains me what is the meaning of the above sentence and what do I do?
vim fedora autocomplete c
bumped to the homepage by Community♦ 6 hours ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
Recently, I installed YouCompleteMe
and I'm new user in it. I read installation instructions from this link: http://valloric.github.io/YouCompleteMe. Now, I can use it for python and etc, but I can't use it for C. I don't understand what's the meaning of this sentence from the link: "forget that if you want the C-family semantic completion engine to work, you will need to provide the compilation flags for your project to YCM."
I read the YCM user guide, but I couldn't solve my problem. Tnx from anybody who explains me what is the meaning of the above sentence and what do I do?
vim fedora autocomplete c
bumped to the homepage by Community♦ 6 hours ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
Recently, I installed YouCompleteMe
and I'm new user in it. I read installation instructions from this link: http://valloric.github.io/YouCompleteMe. Now, I can use it for python and etc, but I can't use it for C. I don't understand what's the meaning of this sentence from the link: "forget that if you want the C-family semantic completion engine to work, you will need to provide the compilation flags for your project to YCM."
I read the YCM user guide, but I couldn't solve my problem. Tnx from anybody who explains me what is the meaning of the above sentence and what do I do?
vim fedora autocomplete c
Recently, I installed YouCompleteMe
and I'm new user in it. I read installation instructions from this link: http://valloric.github.io/YouCompleteMe. Now, I can use it for python and etc, but I can't use it for C. I don't understand what's the meaning of this sentence from the link: "forget that if you want the C-family semantic completion engine to work, you will need to provide the compilation flags for your project to YCM."
I read the YCM user guide, but I couldn't solve my problem. Tnx from anybody who explains me what is the meaning of the above sentence and what do I do?
vim fedora autocomplete c
vim fedora autocomplete c
asked Aug 13 '16 at 9:52
ThisIsMeThisIsMe
16137
16137
bumped to the homepage by Community♦ 6 hours ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 6 hours ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
You need to have a file named .ycm_extra_conf.py in the directory containing the projects source code. That link is to the example file provided with the plugin, and you have to update it to properly describe your compilation options.
I usually create one (or more) for a project and commit them along with the project into whatever scm program I'm using.
Couple of things to watch out for:
If you are used to gcc there are some compilation flags that clang (what YCM is using) doesn't support.
If you are compiling linux kernel code (driver, etc) it will not work well, since clang doesn't support many of the assembly macros provided by gcc. I'm not aware of a workaround.
Additional info from developer:
C-family Semantic Completion
YCM looks for a .ycm_extra_conf.py file in the directory of the opened
file or in any directory above it in the hierarchy (recursively); when
the file is found, it is loaded (only once!) as a Python module. YCM
calls a FlagsForFile method in that module which should provide it
with the information necessary to compile the current file. You can
also provide a path to a global .ycm_extra_conf.py file, which will be
used as a fallback. To prevent the execution of malicious code from a
file you didn't write YCM will ask you once per .ycm_extra_conf.py if
it is safe to load. This can be disabled and you can white-/blacklist
files. See the Options section for more details.
See YCM's own .ycm_extra_conf.py for details on how this works. You
should be able to use it as a starting point. Don't just copy/paste
that file somewhere and expect things to magically work; your project
needs different flags. Hint: just replace the strings in the flags
variable with compilation flags necessary for your project. That
should be enough for 99% of projects.
If you've modified and added this file to your project (or provided a path to it) you will not get the same error message as in your original question. If you do, YCM can't see it - possibly named incorrectly ( leading . ) or not in the right level in the source hierarchy - see link above.
Otherwise if its still not working you should have a different error message; post that. Initial YCM configuration takes some work and took a few trips through their documentation the first time.
Tnx but it doesn't work for me.
– ThisIsMe
Aug 14 '16 at 20:34
add a comment |
I don't understand what's the meaning of this sentence from the link:
"forget that if you want the C-family semantic completion engine to
work, you will need to provide the compilation flags for your project
to YCM."
This simply means that instad of compiling like
cd ~/.vim/bundle/YouCompleteMe
./install.py
You need to add
cd ~/.vim/bundle/YouCompleteMe
./install.py --clang-completer
I think the install instructions are updated anyway to reflect the above.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1113114%2fhow-to-config-youcompleteme-for-c-language%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You need to have a file named .ycm_extra_conf.py in the directory containing the projects source code. That link is to the example file provided with the plugin, and you have to update it to properly describe your compilation options.
I usually create one (or more) for a project and commit them along with the project into whatever scm program I'm using.
Couple of things to watch out for:
If you are used to gcc there are some compilation flags that clang (what YCM is using) doesn't support.
If you are compiling linux kernel code (driver, etc) it will not work well, since clang doesn't support many of the assembly macros provided by gcc. I'm not aware of a workaround.
Additional info from developer:
C-family Semantic Completion
YCM looks for a .ycm_extra_conf.py file in the directory of the opened
file or in any directory above it in the hierarchy (recursively); when
the file is found, it is loaded (only once!) as a Python module. YCM
calls a FlagsForFile method in that module which should provide it
with the information necessary to compile the current file. You can
also provide a path to a global .ycm_extra_conf.py file, which will be
used as a fallback. To prevent the execution of malicious code from a
file you didn't write YCM will ask you once per .ycm_extra_conf.py if
it is safe to load. This can be disabled and you can white-/blacklist
files. See the Options section for more details.
See YCM's own .ycm_extra_conf.py for details on how this works. You
should be able to use it as a starting point. Don't just copy/paste
that file somewhere and expect things to magically work; your project
needs different flags. Hint: just replace the strings in the flags
variable with compilation flags necessary for your project. That
should be enough for 99% of projects.
If you've modified and added this file to your project (or provided a path to it) you will not get the same error message as in your original question. If you do, YCM can't see it - possibly named incorrectly ( leading . ) or not in the right level in the source hierarchy - see link above.
Otherwise if its still not working you should have a different error message; post that. Initial YCM configuration takes some work and took a few trips through their documentation the first time.
Tnx but it doesn't work for me.
– ThisIsMe
Aug 14 '16 at 20:34
add a comment |
You need to have a file named .ycm_extra_conf.py in the directory containing the projects source code. That link is to the example file provided with the plugin, and you have to update it to properly describe your compilation options.
I usually create one (or more) for a project and commit them along with the project into whatever scm program I'm using.
Couple of things to watch out for:
If you are used to gcc there are some compilation flags that clang (what YCM is using) doesn't support.
If you are compiling linux kernel code (driver, etc) it will not work well, since clang doesn't support many of the assembly macros provided by gcc. I'm not aware of a workaround.
Additional info from developer:
C-family Semantic Completion
YCM looks for a .ycm_extra_conf.py file in the directory of the opened
file or in any directory above it in the hierarchy (recursively); when
the file is found, it is loaded (only once!) as a Python module. YCM
calls a FlagsForFile method in that module which should provide it
with the information necessary to compile the current file. You can
also provide a path to a global .ycm_extra_conf.py file, which will be
used as a fallback. To prevent the execution of malicious code from a
file you didn't write YCM will ask you once per .ycm_extra_conf.py if
it is safe to load. This can be disabled and you can white-/blacklist
files. See the Options section for more details.
See YCM's own .ycm_extra_conf.py for details on how this works. You
should be able to use it as a starting point. Don't just copy/paste
that file somewhere and expect things to magically work; your project
needs different flags. Hint: just replace the strings in the flags
variable with compilation flags necessary for your project. That
should be enough for 99% of projects.
If you've modified and added this file to your project (or provided a path to it) you will not get the same error message as in your original question. If you do, YCM can't see it - possibly named incorrectly ( leading . ) or not in the right level in the source hierarchy - see link above.
Otherwise if its still not working you should have a different error message; post that. Initial YCM configuration takes some work and took a few trips through their documentation the first time.
Tnx but it doesn't work for me.
– ThisIsMe
Aug 14 '16 at 20:34
add a comment |
You need to have a file named .ycm_extra_conf.py in the directory containing the projects source code. That link is to the example file provided with the plugin, and you have to update it to properly describe your compilation options.
I usually create one (or more) for a project and commit them along with the project into whatever scm program I'm using.
Couple of things to watch out for:
If you are used to gcc there are some compilation flags that clang (what YCM is using) doesn't support.
If you are compiling linux kernel code (driver, etc) it will not work well, since clang doesn't support many of the assembly macros provided by gcc. I'm not aware of a workaround.
Additional info from developer:
C-family Semantic Completion
YCM looks for a .ycm_extra_conf.py file in the directory of the opened
file or in any directory above it in the hierarchy (recursively); when
the file is found, it is loaded (only once!) as a Python module. YCM
calls a FlagsForFile method in that module which should provide it
with the information necessary to compile the current file. You can
also provide a path to a global .ycm_extra_conf.py file, which will be
used as a fallback. To prevent the execution of malicious code from a
file you didn't write YCM will ask you once per .ycm_extra_conf.py if
it is safe to load. This can be disabled and you can white-/blacklist
files. See the Options section for more details.
See YCM's own .ycm_extra_conf.py for details on how this works. You
should be able to use it as a starting point. Don't just copy/paste
that file somewhere and expect things to magically work; your project
needs different flags. Hint: just replace the strings in the flags
variable with compilation flags necessary for your project. That
should be enough for 99% of projects.
If you've modified and added this file to your project (or provided a path to it) you will not get the same error message as in your original question. If you do, YCM can't see it - possibly named incorrectly ( leading . ) or not in the right level in the source hierarchy - see link above.
Otherwise if its still not working you should have a different error message; post that. Initial YCM configuration takes some work and took a few trips through their documentation the first time.
You need to have a file named .ycm_extra_conf.py in the directory containing the projects source code. That link is to the example file provided with the plugin, and you have to update it to properly describe your compilation options.
I usually create one (or more) for a project and commit them along with the project into whatever scm program I'm using.
Couple of things to watch out for:
If you are used to gcc there are some compilation flags that clang (what YCM is using) doesn't support.
If you are compiling linux kernel code (driver, etc) it will not work well, since clang doesn't support many of the assembly macros provided by gcc. I'm not aware of a workaround.
Additional info from developer:
C-family Semantic Completion
YCM looks for a .ycm_extra_conf.py file in the directory of the opened
file or in any directory above it in the hierarchy (recursively); when
the file is found, it is loaded (only once!) as a Python module. YCM
calls a FlagsForFile method in that module which should provide it
with the information necessary to compile the current file. You can
also provide a path to a global .ycm_extra_conf.py file, which will be
used as a fallback. To prevent the execution of malicious code from a
file you didn't write YCM will ask you once per .ycm_extra_conf.py if
it is safe to load. This can be disabled and you can white-/blacklist
files. See the Options section for more details.
See YCM's own .ycm_extra_conf.py for details on how this works. You
should be able to use it as a starting point. Don't just copy/paste
that file somewhere and expect things to magically work; your project
needs different flags. Hint: just replace the strings in the flags
variable with compilation flags necessary for your project. That
should be enough for 99% of projects.
If you've modified and added this file to your project (or provided a path to it) you will not get the same error message as in your original question. If you do, YCM can't see it - possibly named incorrectly ( leading . ) or not in the right level in the source hierarchy - see link above.
Otherwise if its still not working you should have a different error message; post that. Initial YCM configuration takes some work and took a few trips through their documentation the first time.
edited Aug 15 '16 at 19:55
answered Aug 14 '16 at 5:08
ArgonautsArgonauts
3,8651122
3,8651122
Tnx but it doesn't work for me.
– ThisIsMe
Aug 14 '16 at 20:34
add a comment |
Tnx but it doesn't work for me.
– ThisIsMe
Aug 14 '16 at 20:34
Tnx but it doesn't work for me.
– ThisIsMe
Aug 14 '16 at 20:34
Tnx but it doesn't work for me.
– ThisIsMe
Aug 14 '16 at 20:34
add a comment |
I don't understand what's the meaning of this sentence from the link:
"forget that if you want the C-family semantic completion engine to
work, you will need to provide the compilation flags for your project
to YCM."
This simply means that instad of compiling like
cd ~/.vim/bundle/YouCompleteMe
./install.py
You need to add
cd ~/.vim/bundle/YouCompleteMe
./install.py --clang-completer
I think the install instructions are updated anyway to reflect the above.
add a comment |
I don't understand what's the meaning of this sentence from the link:
"forget that if you want the C-family semantic completion engine to
work, you will need to provide the compilation flags for your project
to YCM."
This simply means that instad of compiling like
cd ~/.vim/bundle/YouCompleteMe
./install.py
You need to add
cd ~/.vim/bundle/YouCompleteMe
./install.py --clang-completer
I think the install instructions are updated anyway to reflect the above.
add a comment |
I don't understand what's the meaning of this sentence from the link:
"forget that if you want the C-family semantic completion engine to
work, you will need to provide the compilation flags for your project
to YCM."
This simply means that instad of compiling like
cd ~/.vim/bundle/YouCompleteMe
./install.py
You need to add
cd ~/.vim/bundle/YouCompleteMe
./install.py --clang-completer
I think the install instructions are updated anyway to reflect the above.
I don't understand what's the meaning of this sentence from the link:
"forget that if you want the C-family semantic completion engine to
work, you will need to provide the compilation flags for your project
to YCM."
This simply means that instad of compiling like
cd ~/.vim/bundle/YouCompleteMe
./install.py
You need to add
cd ~/.vim/bundle/YouCompleteMe
./install.py --clang-completer
I think the install instructions are updated anyway to reflect the above.
answered Aug 26 '17 at 19:34
pragMATHiCpragMATHiC
11
11
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1113114%2fhow-to-config-youcompleteme-for-c-language%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown