2

I am trying to make an SSL socket. I have done some research and I found this answer in stackoverflow too:

Turn a simple socket into an SSL socket

I created a C file and I include the same headers:

#include <openssl/applink.c>
#include <openssl/bio.h>
#include <openssl/ssl.h>
#include <openssl/err.h>

But when I try to compile it, it makes this error:

socketMng.c:12:10: fatal error: openssl/applink.c: No such file or directory
 #include <openssl/applink.c>

I can't find that file in /usr/include/openssl/. I find that file in a folder named mn... I also included using quotation marks instead of <> from that folder but does not work.

Can .c included form the header? (I have never seen it) How can I solve it?

I already have libssl-dev installed.

Thanks

Roger Coll
  • 117
  • 1
  • 3
  • 12

1 Answers1

1

Can .c file be included from the header?

Yes. All that include does is to take a file and paste its content instead of the include statement. Depending on who you ask it could be bad design, but it is perfectly valid.

Andrejs Cainikovs
  • 27,428
  • 2
  • 75
  • 95
klutt
  • 30,332
  • 17
  • 55
  • 95