How to use openssl/sha.h in C?

Hello everyone.
I'm stuck. I want to use an external library. It's available on Github, but I'm overwhelmed because the project is so huge.

Does a more experienced developer have any tips for me on how to work with this?

So, I'm not interested in the code itself. ChatGPT spits that out for me, or I use the examples from GitHub…
I don't know how to get this to work…

Thank you for any helpful answers.

(1 votes)
Loading...

Similar Posts

Subscribe
Notify of
1 Answer
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
jo135
1 year ago

If I get you right, you’ll be stuck on the build.

The easiest thing is Linux or MacOS. You can see that you have installed the corresponding OpenSSL packages (means something like “opensl-dev”). Then the headers automatically land where they expect the compiler, and in your case it is enough the compiler flag -lcrypto, which makes the call look like that.

gcc -o meinprogramm meinprogramm.c -lcrypto

Because this is laborious in the long term, it can be useful to build the project with CMake. Once again a little learning effort, but pays off quickly.

If you’re on Windows, let all hope go…no, it’s not that bad, but you have to worry about the compiler finding the headers and the linker the libraries. I haven’t had to do this for a long time and I can’t say any more details.