errors in UNDEFINED symbols code

Aug 9, 2022 at 11:51am
Hello!
When i am define symbol in eclipse-based Vitis, the code that is UNDEFINED is gray colored so it is not meant to be compiled.

However i am getting error in this area:

"fatal error: stld1553_nix.h: No such file or directory"

Why it is giving error in this area?
Aug 9, 2022 at 5:33pm
Your compiler can't find the specified file.
How you specify to the compiler where to look, depends on the compiler.
What compiler are you using?
Aug 10, 2022 at 10:06am
Also, just because some code appears "gray colored" (disabled) in your text-editor (IDE), e.g. Eclipse, it does not mean that this code is actually disabled from the actual compiler's perspective!

Most text-editor targeted for program code have some, more or less, advanced "syntax highlighting" capabilities. When it comes to C/C++ preprocessor directives, the text-editor will have to make some educated guesses about which macros are defined (or not), in order to decide whether code sections enclosed in #ifdef's is enabled (or not). But only the compiler will have the full picture and know for sure...
Last edited on Aug 10, 2022 at 10:10am
Aug 10, 2022 at 1:42pm
Hi

Basically software is doing auto. compiling and linking . the command for compiling is:

aarch64-linux-gnu-g++

i run with Linux btw on xilinx board.

So i need to provide the requested .h file anyway?
Aug 10, 2022 at 10:31pm
If you can not change the code in question, and if that code does #include the file "stld1553_nix.h", then yes, you will have to provide that file for the compilation to succeed ;-)

That is unless the #include directive is guarded by an ifdef or ifndef – in which case you could prevent the #include by (un)defining the respective macro, e.g by passing -DNAME or -UNAME on the command-line.


If, in fact, you can change the code, then you can simply remove the #include, if you want... 🙃
Last edited on Aug 10, 2022 at 10:36pm
Topic archived. No new replies allowed.