How is it possible that eclipse shoes me just one error. after i solve this
it shows me 5 different errors.
does not all of the errors appearr at once?
i am working on xilinx sdk 2018.3 which is based on eclipse.
But sometimes your code may contain syntax errors that makes it impossible to be parsed. There may be other errors lurking in your code, but as long as the code cannot even be parsed, the compiler won't be able to tell.
Once the syntax error is resolved and the code can actually be parsed, other errors may become evident, such as trying to access a variable that was never declared, or call a function that was never declared, etc. pp...
Also, often the compiler only shows the first instance of a particular type of error, even though there may be several instances of that error in your code. Consequently, if you only fix the first instance of the error, the other instances still exist; and the compiler will then reported the next instance.
Last but not least, "fixing an error" means that you changed the code, in some way. And, of course, any code change has the potential of breaking something and thus introduce new errors π
Multiple markers at this line
- 'sitalRtMt_Initialize' was not declared in
this scope
- suggested alternative: 'sitalMt_Initialize'
Although when i cntl+click 'sitalRtMt_Initialize' it give me reference to 2 places in a window called "open decleration", mean that it was declared !? so why it gives error in the first place?
Just because a function, class or type is declared somewhere does not necessarily mean that the declaration actually is "available" at the place where you want to use it π
You generally have to #include the header file where something that you want to use is declared before you can use it. And you have to do this separately, in every source code file, where you want to use it.
Also, C++ has namespaces. If symbol foobar is declared in a certain namespace, then you either have to use the syntax some_namespace::foobar, or you have to use write using some_namespace; a the top your source code file and then you can access foobar without namespace prefix.
a) #include the relevant header file, i.e. the header file containing the definitions you need, within that source file
b) Ensure you're using the right namespace qualifications for the symbols you're using
i think it has something to do with path/include settings.
If that were the case, you'd probably be getting preprocessor errors reporting that header files can't be found. Are you getting such errors?
Generally, if a header file 'A' requires another header file 'B', then the header file 'A' should#include header file 'B' β instead of requiring the user to #include 'B' before 'A' can be #include'd. And all header files should contain proper "include guards" to avoid problems when the same header file gets included multiple times.
But "should" does not mean it was actually made that way, so better double-check π
From where was this code obtained (assuming not in-house)? Are there no instructions/help/manual etc re how to use?
PS. xlinix is an Integrated Design Environment for creating embedded applications. The web site has manuals, help, support etc. Do these not state how to use the SDK within a program etc?
some issue i had:
library properties-->c/c++ build -->settings-->toll settings-->symbols
i choose for example LINUX as symbol. mean only #if defined LINUX will be white and the rest
will shows gray . but why the compiler check and shows errors in this gray area?
The syntax highlighting in your IDE (e.g. Eclipse) tries to be "smart", and therefore it grays out lines that it "thinks" are disabled by #if's, based on which macros (e.g. LINUX) the IDE "thinks" are #define'd.
But, what really happens in the compiler, that is (or: may be) a different story π
Be aware that a macro (e.g. LINUX) will be defined only if either there is a #definein the code, possibly in one of the header file that you include, or if you pass command-line option -D to the compiler (e.g. -DLINUX).
Do not blindly trust that syntax highlighting always is "in sync" with what happens in the compiler.