- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello all,
when I build a project with PSOC 6 I have 127 build errors saying that #include is nested too deeply in project.h
what on earth could be going on?
Any idea what circumstances cause this to happen?
Thanks.
PS see attached output during build.
Solved! Go to Solution.
- Tags:
- psoc 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can reproduce the issue by creating a custom component.
1) Create a component without pins.
2) Add a header file to the component as follows.
#include "project.h"
extern uint32_t `$INSTANCE_NAME`_global_variable;
Declare a global variable. project.h is included to use the uint32_t type.
3) Add a C file to the component as follows.
#include "`$INSTANCE_NAME`.h"
uint32_t `$INSTANCE_NAME`_global_variable;
Define a global variable body.
4) Put the component instance on a top level schematic.
5) Build the project and got huge number of error.
I have two solutions.
Solution 1)
In the header file, include "stdin.h" instead of "project.h"
#include <stdint.h>
extern uint32_t `$INSTANCE_NAME`_global_variable;
Solution 2)
In the header file, add #ifdef structure to prevent recursive inclusion.
#if !defined(`$INSTANCE_NAME`_H)
#define `$INSTANCE_NAME`_H
#include "project.h"
extern uint32_t `$INSTANCE_NAME`_global_variable;
#endif /* End `$INSTANCE_NAME`_H */
It is better to combine both solutions.
#if !defined(`$INSTANCE_NAME`_H)
#define `$INSTANCE_NAME`_H
#include <stdint.h>
extern uint32_t `$INSTANCE_NAME`_global_variable;
#endif /* End `$INSTANCE_NAME`_H */
This can reduce the number of header file inclusion to reduce the compile time.
Regards,
Noriaki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please check the content of the project.h file.
There should be #include line to include the project.h file directly or indirectly.
Regards,
Noriaki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can reproduce the issue by creating a custom component.
1) Create a component without pins.
2) Add a header file to the component as follows.
#include "project.h"
extern uint32_t `$INSTANCE_NAME`_global_variable;
Declare a global variable. project.h is included to use the uint32_t type.
3) Add a C file to the component as follows.
#include "`$INSTANCE_NAME`.h"
uint32_t `$INSTANCE_NAME`_global_variable;
Define a global variable body.
4) Put the component instance on a top level schematic.
5) Build the project and got huge number of error.
I have two solutions.
Solution 1)
In the header file, include "stdin.h" instead of "project.h"
#include <stdint.h>
extern uint32_t `$INSTANCE_NAME`_global_variable;
Solution 2)
In the header file, add #ifdef structure to prevent recursive inclusion.
#if !defined(`$INSTANCE_NAME`_H)
#define `$INSTANCE_NAME`_H
#include "project.h"
extern uint32_t `$INSTANCE_NAME`_global_variable;
#endif /* End `$INSTANCE_NAME`_H */
It is better to combine both solutions.
#if !defined(`$INSTANCE_NAME`_H)
#define `$INSTANCE_NAME`_H
#include <stdint.h>
extern uint32_t `$INSTANCE_NAME`_global_variable;
#endif /* End `$INSTANCE_NAME`_H */
This can reduce the number of header file inclusion to reduce the compile time.
Regards,
Noriaki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Noriaki
I will test your suggestions later and report back here.
many thanks.
Fausto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you mean the Notes messages like this?
Actually I don't know.
I see these messages disappeared when the "Programming\Debugging>Debug Selection" option is set to "GPIO" in the "System" tab of the "Design Wide Resource" but I don't think this is a solution what your are expecting.
Regards,
Noriaki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
They are not errors or warning, so the code still compiles okay. I was just wondering if there is a note somewhere in PSOC 6 documentation that mentions these build messages.
Regards
Fausto