Hi I want to use wolfssl library (v3.6.9) on Keil (v5.17), but when I add wolfCrypt to project, I get this error:
C:\Program Files (x86)\Keil 5.17\ARM\PACK\wolfSSL\CyaSSL\3.6.9\wolfssl\wolfssl/wolfcrypt/wc_port.h(78): error: #5: cannot open source input file "pthread.h": No such file or directory
I searched all directories for pthread.h, but it's not available! How can I use the WolfSSL for cryptography?
You ask "how can I use..." Maybe you should ask "can I use..."
The Keil tools doesn't support pthreads, which is quite reasonable. The POSIX standard was written with the assumption that you have a full OS - not that you run your code directly on the hardware.
So it will be up to you if you have the skills to modify the wolfssl code to manage without pthreads. And we can't know if you have the skills to do that.
Please follow these instructions: www.wolfssl.com/.../wolfssl-keil-mdk-arm.html Does the problem still come up afterwards?
Thank you for replay well, seems I have to modify the files, but I downloaded the wolfssl as a TLS/SSL library for Keil! How it's not compatible with Keil? Even with RTX? Why they don't remove it from packages list?
I read this instruction, but I thought there is no compatibility problem for keil v5.17 :(
Hello Mohammads,
please contact WolfSSL if the instructions are not working for you on that page.
Kind regards,
Christopher
Standard step when having an error, is to take a bit closer look at the error.
The header file in question does try to include pthread.h.
But there are several interesting #define there - have you spent some time thinking about them.
Like #SINGLE_THREADED? Like #WOLFSSL_CMSIS_RTOS? Like #WOLFSSL_MDK_ARM?
And have you verified exactly what #defines your code gets compiled with?
Are you running your project? Or a project supplied by Keil? Or a project supplied from WolfSSL? Or from some else source?
Problem solved By choosing correct definitions
Debugging really can't be ignored when trying to develop stuff. Outside magic will not always intervene and remove the need for own thinking.