
Hi Mohit, Thx for the reply. "#include <openssl/ossl.h>" is to access headers from openssl "the library", whereas I want to access the headers of openssl "the ruby library", or more specifically its C extension headers. Both "#include <ruby/ruby.h>" and "#include <sys/time.h>" do not apply to my use-case: the first is a header file from the ruby distribution, not an stdlib, whereas the latter is a (non-ruby related) system library. Best regards, Tiago Mohit Sindhwani <mo_mail@onghu.com> escreveu no dia segunda, 27/02/2023 à(s) 16:35:
Hi Tiago,
On 2023-2-27 7:27 pm, Tiago Cardoso via ruby-talk wrote:
I'm writing a C extension which interfaces with ruby-openssl objects, and the openssl API. In the process, I'm needing access to some functions which ruby-openssl declares in the header file: https://github.com/ruby/openssl/blob/ea0a112a0c6a0498629e778af7991c9b4e34956... (example: ossl_raise). However, it's not clear to me how should I declare the #include in order to access it, for a header file coming from stdlib. Seems that ruby itself correctly places its header files (examples: ruby.h, or ruby/io.h), but I don't see the openssl gem ones.
The beginning of my C file looks like:
```C #include <ruby.h> #include <openssl/evp.h>
#include <pathto/openssl/ossl.h> // how to do this? ```
What is the error that you are getting? I would have that it should just work with "#include <openssl/ossl.h>" on the idea that it's relative to the system include directory but I am still exploring how C native extensions work but I thought it should have worked since I see other gems (e.g., grpc) include other items like:
#include <ruby/ruby.h> #include <sys/time.h>
Best regards, Mohit.