Openssl header file not found

I'm trying to make a mini project that uses openssl and I'm including <openssl/rsa.h> header file. But I keep getting the following message:

hello.c:2:10: fatal error: openssl/rsa.h: No such file or directory
 #include <openssl/rsa.h>
          ^~~~~~~~~~~~~~~

I can see that I have the following package installed: libopenssl1.1

root@OpenWrt:~# opkg list-installed | grep ssl
libopenssl1.1 - 1.1.1d-2
python3-openssl - 3.8.1-1

I'm simply compiling using gcc:

gcc hello.c && ./a.out

What am I doing wrong here? I assume I need to pass some sort of path to gcc so it knows where to look for openssl?

I could be wrong, but I think you are not supposed to compile inside the device running OpenWrt, but cross-compile it in a computer then move the binaries to the device.

2 Likes

@ArshanKhanifar It would be more helpful to just stick to your original topic instead of opening new ones.

1 Like

@Borromini y apologies, I thought these two questions were slightly different. But really they're the same... this is what I ran into while I researched my task a bit more hah. Should I close this one?