You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello everyone,
I'm trying to compile an external project as a Zephyr module and I'm a bit confused on how to access some headers (and from which environment they should come).
As an example, I don't get any error while including pthread.h from one of my header, but then I can't access some standard symbols.
eg:
error: 'PTHREAD_MUTEX_INITIALIZER' undeclared here (not in a function); did you mean 'X_MUTEX_INITIALIZER'?
34 | #define X_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
| ^~~~~~~~~~~~~~~~~~~~~~~~~
warning: implicit declaration of function 'pthread_mutex_unlock'; did you mean 'x_mutex_unlock'? [-Wimplicit-function-declaration]
33 | #define x_mutex_unlock(pmutex) pthread_mutex_unlock(pmutex)
| ^~~~~~~~~~~~~~~~~~~~
PTHREAD_MUTEX_INITIALIZER is available in zephyr/include/zephyr/posix/pthread.h 🤔
I tried using the posix pthread Zephyr header without success (using CONFIG_POSIX_API), and saw that some other modules are including some out of tree pthread.h header they are providing for some reason.
I'm also encountering issues with dirent.h header, I kinda understood that some headers could come from the sdk but I'm not sure how ? (I'm currently getting the #error "<dirent.h> not supported" message from /home/zephyr-sdk-0.16.5/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/sys/dirent.h.
For context, to test access to my modules headers, I'm simply building the hello world sample adding headers include in it (as well as some config enabling my module)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone,
I'm trying to compile an external project as a Zephyr module and I'm a bit confused on how to access some headers (and from which environment they should come).
As an example, I don't get any error while including
pthread.h
from one of my header, but then I can't access some standard symbols.eg:
PTHREAD_MUTEX_INITIALIZER
is available inzephyr/include/zephyr/posix/pthread.h
🤔I tried using the posix pthread Zephyr header without success (using CONFIG_POSIX_API), and saw that some other modules are including some out of tree pthread.h header they are providing for some reason.
I'm also encountering issues with dirent.h header, I kinda understood that some headers could come from the sdk but I'm not sure how ? (I'm currently getting the
#error "<dirent.h> not supported"
message from/home/zephyr-sdk-0.16.5/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/sys/dirent.h
.For context, to test access to my modules headers, I'm simply building the hello world sample adding headers include in it (as well as some config enabling my module)
Thanks by advance for some inputs.
Beta Was this translation helpful? Give feedback.
All reactions