Eclipse CDT indexer different results for C file than C++ fileWhat are the differences between a pointer variable and a reference variable in C++?Difference between 'struct' and 'typedef struct' in C++?Differences between INDEX, PRIMARY, UNIQUE, FULLTEXT in MySQL?Why is reading lines from stdin much slower in C++ than Python?Can code that is valid in both C and C++ produce different behavior when compiled in each language?GTest with Eclipse CDT - Functions could not be resolved after adding libraryEclipse Mars CDT Makefile project C++14 supportEclipse CDT Oxygen: Compiler issueEclipse-cdt indexer crashes with NullPointerExceptionsEclipse CDT flags extern “C” in header file as syntax error
Using substitution ciphers to generate new alphabets in a novel
Pre-mixing cryogenic fuels and using only one fuel tank
Is there an injective, monotonically increasing, strictly concave function from the reals, to the reals?
Is there a way to get `mathscr' with lower case letters in pdfLaTeX?
Quoting Keynes in a lecture
Can a Canadian Travel to the USA twice, less than 180 days each time?
Calculate sum of polynomial roots
How do you respond to a colleague from another team when they're wrongly expecting that you'll help them?
Plot of a tornado-shaped surface
Keeping a ball lost forever
Can I say "fingers" when referring to toes?
Can a College of Swords bard use a Blade Flourish option on an opportunity attack provoked by their own Dissonant Whispers spell?
How can I write humor as character trait?
Why would a new[] expression ever invoke a destructor?
Why does the Sun have different day lengths, but not the gas giants?
Non-trope happy ending?
How does a computer interpret real numbers?
Does IPv6 have similar concept of network mask?
Temporarily disable WLAN internet access for children, but allow it for adults
Did arcade monitors have same pixel aspect ratio as TV sets?
Can disgust be a key component of horror?
Why is the "ls" command showing permissions of files in a FAT32 partition?
Unexpected behavior of the procedure `Area` on the object 'Polygon'
Biological Blimps: Propulsion
Eclipse CDT indexer different results for C file than C++ file
What are the differences between a pointer variable and a reference variable in C++?Difference between 'struct' and 'typedef struct' in C++?Differences between INDEX, PRIMARY, UNIQUE, FULLTEXT in MySQL?Why is reading lines from stdin much slower in C++ than Python?Can code that is valid in both C and C++ produce different behavior when compiled in each language?GTest with Eclipse CDT - Functions could not be resolved after adding libraryEclipse Mars CDT Makefile project C++14 supportEclipse CDT Oxygen: Compiler issueEclipse-cdt indexer crashes with NullPointerExceptionsEclipse CDT flags extern “C” in header file as syntax error
I'm using Eclipse 2018-12 with latest CDT. Getting odd indexing problems with the Editor. Given the below. If the source file has a ".c" extension the indexer complains that type "bool" and "false" cannot be resolved. If the file has a "*.cpp" extension the type is resolved.
In both cases, the project will build and can be debugged.
Not sure if it matters, but I'm using CMake 3.13 to generate Eclipse Project files, although I have tried to manually adjust project settings to no avail.
#include <stdbool.h>
void main(void)
bool success = false;
I have a C Project, but my unit testing is using GTest and are the only .cpp files in the project. All .c files exhibit this behavior.
c++ c indexing eclipse-cdt
add a comment |
I'm using Eclipse 2018-12 with latest CDT. Getting odd indexing problems with the Editor. Given the below. If the source file has a ".c" extension the indexer complains that type "bool" and "false" cannot be resolved. If the file has a "*.cpp" extension the type is resolved.
In both cases, the project will build and can be debugged.
Not sure if it matters, but I'm using CMake 3.13 to generate Eclipse Project files, although I have tried to manually adjust project settings to no avail.
#include <stdbool.h>
void main(void)
bool success = false;
I have a C Project, but my unit testing is using GTest and are the only .cpp files in the project. All .c files exhibit this behavior.
c++ c indexing eclipse-cdt
5
Wellbool
is a basic type in C++. C didn't have a boolean type until C11 and that is_Bool
withstdbool.h
having a typedef forbool
. So my best guess is it works for C++ files because it's baked into the language. Does your C project need to be configured for the C11 standard?
– Christian Gibbons
Feb 22 at 20:54
Guess I should add that this is also happening with my own types. I include "map.h". Funny that the indexer will recognize map_create() function but doesn't recognize my type "Map" as in Map map = map_create();
– geminicode
Feb 22 at 20:57
"Funny that the indexer will recognize map_create() function but doesn't recognize my type "Map" as in Map map = map_create();" -- C is different from C++ in that you have to writestruct Map map = map_create();
, don't you?
– HighCommander4
Mar 8 at 1:39
add a comment |
I'm using Eclipse 2018-12 with latest CDT. Getting odd indexing problems with the Editor. Given the below. If the source file has a ".c" extension the indexer complains that type "bool" and "false" cannot be resolved. If the file has a "*.cpp" extension the type is resolved.
In both cases, the project will build and can be debugged.
Not sure if it matters, but I'm using CMake 3.13 to generate Eclipse Project files, although I have tried to manually adjust project settings to no avail.
#include <stdbool.h>
void main(void)
bool success = false;
I have a C Project, but my unit testing is using GTest and are the only .cpp files in the project. All .c files exhibit this behavior.
c++ c indexing eclipse-cdt
I'm using Eclipse 2018-12 with latest CDT. Getting odd indexing problems with the Editor. Given the below. If the source file has a ".c" extension the indexer complains that type "bool" and "false" cannot be resolved. If the file has a "*.cpp" extension the type is resolved.
In both cases, the project will build and can be debugged.
Not sure if it matters, but I'm using CMake 3.13 to generate Eclipse Project files, although I have tried to manually adjust project settings to no avail.
#include <stdbool.h>
void main(void)
bool success = false;
I have a C Project, but my unit testing is using GTest and are the only .cpp files in the project. All .c files exhibit this behavior.
c++ c indexing eclipse-cdt
c++ c indexing eclipse-cdt
edited Feb 22 at 21:46
howlger
11.8k51841
11.8k51841
asked Feb 22 at 20:42
geminicodegeminicode
261
261
5
Wellbool
is a basic type in C++. C didn't have a boolean type until C11 and that is_Bool
withstdbool.h
having a typedef forbool
. So my best guess is it works for C++ files because it's baked into the language. Does your C project need to be configured for the C11 standard?
– Christian Gibbons
Feb 22 at 20:54
Guess I should add that this is also happening with my own types. I include "map.h". Funny that the indexer will recognize map_create() function but doesn't recognize my type "Map" as in Map map = map_create();
– geminicode
Feb 22 at 20:57
"Funny that the indexer will recognize map_create() function but doesn't recognize my type "Map" as in Map map = map_create();" -- C is different from C++ in that you have to writestruct Map map = map_create();
, don't you?
– HighCommander4
Mar 8 at 1:39
add a comment |
5
Wellbool
is a basic type in C++. C didn't have a boolean type until C11 and that is_Bool
withstdbool.h
having a typedef forbool
. So my best guess is it works for C++ files because it's baked into the language. Does your C project need to be configured for the C11 standard?
– Christian Gibbons
Feb 22 at 20:54
Guess I should add that this is also happening with my own types. I include "map.h". Funny that the indexer will recognize map_create() function but doesn't recognize my type "Map" as in Map map = map_create();
– geminicode
Feb 22 at 20:57
"Funny that the indexer will recognize map_create() function but doesn't recognize my type "Map" as in Map map = map_create();" -- C is different from C++ in that you have to writestruct Map map = map_create();
, don't you?
– HighCommander4
Mar 8 at 1:39
5
5
Well
bool
is a basic type in C++. C didn't have a boolean type until C11 and that is _Bool
with stdbool.h
having a typedef for bool
. So my best guess is it works for C++ files because it's baked into the language. Does your C project need to be configured for the C11 standard?– Christian Gibbons
Feb 22 at 20:54
Well
bool
is a basic type in C++. C didn't have a boolean type until C11 and that is _Bool
with stdbool.h
having a typedef for bool
. So my best guess is it works for C++ files because it's baked into the language. Does your C project need to be configured for the C11 standard?– Christian Gibbons
Feb 22 at 20:54
Guess I should add that this is also happening with my own types. I include "map.h". Funny that the indexer will recognize map_create() function but doesn't recognize my type "Map" as in Map map = map_create();
– geminicode
Feb 22 at 20:57
Guess I should add that this is also happening with my own types. I include "map.h". Funny that the indexer will recognize map_create() function but doesn't recognize my type "Map" as in Map map = map_create();
– geminicode
Feb 22 at 20:57
"Funny that the indexer will recognize map_create() function but doesn't recognize my type "Map" as in Map map = map_create();" -- C is different from C++ in that you have to write
struct Map map = map_create();
, don't you?– HighCommander4
Mar 8 at 1:39
"Funny that the indexer will recognize map_create() function but doesn't recognize my type "Map" as in Map map = map_create();" -- C is different from C++ in that you have to write
struct Map map = map_create();
, don't you?– HighCommander4
Mar 8 at 1:39
add a comment |
2 Answers
2
active
oldest
votes
Found a similar post in an Eclipse forum. Consensus was this might be a Bug in the indexer/editor code.
However there was a workaround solution. It you have a Project with both .c and .cpp files in the project Properties -> C/C++ General -> Language Mappings, add a mapping for "C Source File" to the "GNU C++" Language.
Since my build files are being generated by CMake I don't believe this will impact the way Eclipse Builds/Debugs my code.
add a comment |
I agree that this is a bug in Eclipse CDT, which I've filed in its bug tracker.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
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%2fstackoverflow.com%2fquestions%2f54834858%2feclipse-cdt-indexer-different-results-for-c-file-than-c-file%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
Found a similar post in an Eclipse forum. Consensus was this might be a Bug in the indexer/editor code.
However there was a workaround solution. It you have a Project with both .c and .cpp files in the project Properties -> C/C++ General -> Language Mappings, add a mapping for "C Source File" to the "GNU C++" Language.
Since my build files are being generated by CMake I don't believe this will impact the way Eclipse Builds/Debugs my code.
add a comment |
Found a similar post in an Eclipse forum. Consensus was this might be a Bug in the indexer/editor code.
However there was a workaround solution. It you have a Project with both .c and .cpp files in the project Properties -> C/C++ General -> Language Mappings, add a mapping for "C Source File" to the "GNU C++" Language.
Since my build files are being generated by CMake I don't believe this will impact the way Eclipse Builds/Debugs my code.
add a comment |
Found a similar post in an Eclipse forum. Consensus was this might be a Bug in the indexer/editor code.
However there was a workaround solution. It you have a Project with both .c and .cpp files in the project Properties -> C/C++ General -> Language Mappings, add a mapping for "C Source File" to the "GNU C++" Language.
Since my build files are being generated by CMake I don't believe this will impact the way Eclipse Builds/Debugs my code.
Found a similar post in an Eclipse forum. Consensus was this might be a Bug in the indexer/editor code.
However there was a workaround solution. It you have a Project with both .c and .cpp files in the project Properties -> C/C++ General -> Language Mappings, add a mapping for "C Source File" to the "GNU C++" Language.
Since my build files are being generated by CMake I don't believe this will impact the way Eclipse Builds/Debugs my code.
answered Feb 27 at 18:35
geminicodegeminicode
261
261
add a comment |
add a comment |
I agree that this is a bug in Eclipse CDT, which I've filed in its bug tracker.
add a comment |
I agree that this is a bug in Eclipse CDT, which I've filed in its bug tracker.
add a comment |
I agree that this is a bug in Eclipse CDT, which I've filed in its bug tracker.
I agree that this is a bug in Eclipse CDT, which I've filed in its bug tracker.
edited Mar 8 at 1:55
answered Mar 8 at 1:45
HighCommander4HighCommander4
27.5k1798165
27.5k1798165
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- 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%2fstackoverflow.com%2fquestions%2f54834858%2feclipse-cdt-indexer-different-results-for-c-file-than-c-file%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
5
Well
bool
is a basic type in C++. C didn't have a boolean type until C11 and that is_Bool
withstdbool.h
having a typedef forbool
. So my best guess is it works for C++ files because it's baked into the language. Does your C project need to be configured for the C11 standard?– Christian Gibbons
Feb 22 at 20:54
Guess I should add that this is also happening with my own types. I include "map.h". Funny that the indexer will recognize map_create() function but doesn't recognize my type "Map" as in Map map = map_create();
– geminicode
Feb 22 at 20:57
"Funny that the indexer will recognize map_create() function but doesn't recognize my type "Map" as in Map map = map_create();" -- C is different from C++ in that you have to write
struct Map map = map_create();
, don't you?– HighCommander4
Mar 8 at 1:39