|
|
Re: Indexer can`t resolve symbols in C files, but resolve them in C++ files [message #1713381 is a reply to message #1713356] |
Tue, 03 November 2015 16:44 |
Alim Adzhiev Messages: 4 Registered: November 2015 |
Junior Member |
|
|
David Vavra wrote on Tue, 03 November 2015 14:47You said all include paths are configured in the project properties but are they? If you look at Project ==> Properties ==> C/C++ General ==> Preprocessor Include Paths, Macros, etc. you will see there are selections for different languages in the Entries tab. Are the paths available to c++ also available to c? If not, add the path to the header containing the definition of INT8U to the set of c paths then rebuild the index.
If that doesn't work then what's the actual error message? It would have been nice if you had selected the Problems view in you snapshots instead of the Console view.
Yes, include path lists are identical for C and C++ on the "Preprocessor Include Paths" tab.
Problem list contains only records like "Symbol 'xxxx' could not be resolved", "Type 'xxxx' could not be resolved" and "Field 'xxxx' could not be resolved" for symbols undelied by red. All of them are types, variables and struct fields from included header files.
-
Attachment: c_file_2.png
(Size: 128.49KB, Downloaded 8972 times)
|
|
|
|
|
|
Re: Indexer can`t resolve symbols in C files, but resolve them in C++ files [message #1713875 is a reply to message #1713832] |
Sat, 07 November 2015 12:05 |
David Vavra Messages: 1426 Registered: October 2012 |
Senior Member |
|
|
If you are including a header into a C source, it had better conform to C. Treating something you arbitrarily labelled a C++ file as a C file is more than reasonable -- it's required. There are only minor differences in syntax between C and C++ so, as far as CDT is concerned, telling it all files are C++ will only cause it to overlook any C++ forms that show up in a C file that are in fact errors.
My guess is that declarations in header files are cached and likely C definitions are somehow different than C++ definitions in the cache. Some of the differences are important though. For example, in C, it's possible to have simultaneously both a struct X and an int X. The standard mapping of .h is to both C++ and C and I wouldn't be surprised if they are scanned independent of use and always treated as C++ files or perhaps the order they are encountered that determines how they are treated.
Looks like this may be a bug but whether it is or not is a matter of opinion.
[Updated on: Sat, 07 November 2015 12:07] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.02692 seconds