Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: unknown type name pthread_t #1

Open
Cmystall opened this issue Jan 3, 2023 · 3 comments
Open

error: unknown type name pthread_t #1

Cmystall opened this issue Jan 3, 2023 · 3 comments

Comments

@Cmystall
Copy link

Cmystall commented Jan 3, 2023

C language code compilation prompt "error: unknown type name pthread_t" in linux, do you know the reason for this error? I hope to get your recovery as soon as possible, thank you?

@mdednev
Copy link
Owner

mdednev commented Jan 3, 2023

What are you trying to compile? This is bare hardware toolchain with newlib c library without actual pthread support. If you include pthread.h header (/usr/lib/microblaze-xilinx-elf/include/pthread.h) you could compile source with pthread library calls, but build process will fail at the linking stage due to missing pthread functions implementation.

@Cmystall
Copy link
Author

Cmystall commented Jan 5, 2023

Before compiling, temporary environment variables were added(/opt/2015.3/bin:/opt/2015.3/gnu/microblaze/lin/bin:/opt/2015.3/gnu/arm/lin/bin:/opt/2015.3/gnu/microblaze/linux_toolchain/lin64_be/bin:/opt/2015.3/gnu/microblaze/linux_toolchain/lin64_le/bin),"pthread.h"'s path of existence is "/opt/2015.3/gnu/microblaze/lin/microblaze-xilinx-elf/include/pthread.h",Is it compilable? And there are also "pthread.h" in other paths, only the most similar paths are listed here. Thank you very much for your reply

@mdednev
Copy link
Owner

mdednev commented Jan 6, 2023

Toolchain from current repository doesn't need to add any environment variables to compile sources. It installs to the system default path (/usr/bin) and works seamlessly without any other system or environment tuning.

"pthread.h"'s path of existence is "/opt/2015.3/gnu/microblaze/lin/microblaze-xilinx-elf/include/pthread.h",Is it compilable?

First of all, this file doesn't belong to the current repository toolchain. So, I suppose that you can compile you sources with this header file, but it seems very unlikely to that you will get successful linking due to missing pthread_* functions in your toolchain system libraries for bare hardware target (without OS like linux with multitasking and multithreading support).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants