4

I am working with the OpenSSL library for C++. I used this library in another project and it worked great. I carried it over to another project today and I'm having issues.

Two of the header files are .h.in files: opensslv.h.in and configuration.h.in.

In the first project, this was not an issue. But in my new project it gives me an error on this line #include <openssl/configuration.h> because configuration.h cannot be found:

...\include\openssl\opensslconf.h(14): fatal error C1083: Cannot open include file: 'openssl/configuration.h': No such file or directory

I understand there is no literal configuration.h file but from what I understand that configuration.h.in file should generate a configuration.h file right?

Does anybody have any idea why that might be happening? Maybe I changed something in the project properties?

Basj
  • 41,386
  • 99
  • 383
  • 673
  • Typically, that indicates that one file is generated from the other. In other words, `config.h.in` is a template for `config.h`. In effect, that means that you need to perform a build step to generate this file. – Ulrich Eckhardt Feb 22 '20 at 08:30
  • BTW: Can you clarify what you mean with a "c++ .h.in file"? If the "c++" is supposed to tag the question as C++-related, don't do that, that's what regular tags are for. You can [edit] your question to clarify that. As a new user here, also take the [tour] and read [ask]. – Ulrich Eckhardt Feb 22 '20 at 08:32
  • I dont remember having to generate the file from the template myself before, very strange – Steele Stonick Feb 22 '20 at 08:47
  • It's part of building and installing OpenSSL. You shouldn't have to do it yourself as part of your project. – Ulrich Eckhardt Feb 22 '20 at 09:53

2 Answers2

2

.h.in is a template for a header file. .in suffix looks similar to autotools template files, but according to their FAQ, OpenSSL uses their own build system based on Perl. Anyway, you should call one of the Configure scripts, and build after that. Docs.

  • Thank you! I see Perl is needed, even for Windows compilation (in my case): https://wiki.openssl.org/index.php/Compilation_and_Installation#Windows – Basj May 11 '22 at 10:15
0

I'm unable to comment, but you need to provide more information about your directory structure. What do you mean by "carried it over"? This most likely sounds like it's happening due to something pointing to the wrong directory. What environment are you working in?

First thing I would do is double check that your project environment is looking in the correct directory for include files.

I also just found this answer that may be helpful to you as well: https://stackoverflow.com/a/31322172/2494727

  • I have a folder called openssl-master and it has include and lib folders in it. From what I remember before that was all I needed for openssl in my last project. I tried to do the same thing with another project and I am getting errors. and Im working in Visual Studio on Windows 10 – Steele Stonick Feb 22 '20 at 08:58
  • @SteeleStonick As you stated in your question, you've used this on another project previously, but then you "carried it over" and it doesn't work. Can elaborate on what you mean by carried it over? Did you have a look at the linked answer? It gives some configurations of your environment that are worth double checking. – InterestingGuy Feb 22 '20 at 20:11
  • I did look over that question and am still having a little trouble. got the project to compile but im just having a certificate issue now. – Steele Stonick Mar 05 '20 at 15:43