1
votes

I am trying to compile a C program using Netbeans IDE and windows 7 32 bit operating system. The program has references to following headers

#include <openssl/bio.h>

#include <openssl/ssl.h>

#include <openssl/err.h>

I have downloaded the openssl package from Cygwin. I am able to run Openssl.exe from the C:\cygwin\bin\openssl.exe path successfully without any error.I have defined system environment variable and include directories in c compiler to C:\cygwin\bin.

But when program is compiled I am getting "openssl/bio.h: No such file or directory" fatal error.

As an alternative I downloaded 'openssl_1.1.1.orig.tar.gz' and expanded the same using cygwin terminal. The folders do contain all the required header files but I am seeing the same error even after setting the include directory path to newly downloaded directory.

Please let me know where I am going wrong.

1
Do you need to extend the search path for included headers with -I or /I? - M Oehm
Please edit your question and add more information. Show the compile command. C:\cygwin\bin is not the correct include directory. If you have something like C:\cygwin\usr\include\openssl\bio.h then you might have to add C:\cygwin\usr\include as include directory. What exactly do you mean with "openssl package from Cygwin"? What is the exact name of this package. Maybe it contains the binary program and library only. You may need a development library package. If openssl_1.1.1.orig.tar.gz is a source code package you would have to build it before you can use it for your program. - Bodo
@bodo thanks for the response. Can you let me know on how to build openssl_1.1.1.orig.tar.gz in windows 7 environment. Should I write a separate c program for it? - Deepak Kumar
@DeepakKumar Read the installation instructions inside this archive or where you got it from. If you don't know how to build it, then it is probably much easier to install ready-built libraries. Please answer all requests for more information in your question. - Bodo
@bodo I have edited the question. While downloading Cygwin they provide options for downloading different packages for example gcc++, gdb files. Openssl is an exe file that got downloaded. When I run that exe file I get 'openssl>' as an output in a separate window. Acutally I am trying to replicate a solution provided in youtube site youtube.com/watch?v=0YWQ4SW_2fo. In this video gentleman executes command 'apt -get install libssl -dev' from his linux terminal. I am unable to replicate that on my windows PC. If that is done then I think my problem will be resolved. - Deepak Kumar

1 Answers

2
votes

You need to install the libssl-devel package

$ cygcheck -p usr/include/openssl/bio.h
Found 3 matches for usr/include/openssl/bio.h
libssl-devel-1.1.1b-1 - libssl-devel: A general purpose cryptography toolkit with TLS implementation (development)
libssl-devel-1.1.1c-1 - libssl-devel: A general purpose cryptography toolkit with TLS implementation (development)
libssl-devel-1.1.1d-1 - libssl-devel: A general purpose cryptography toolkit with TLS implementation (development)