Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does openssl/ssl.h contain nothing but a relative path?

I built OpenSSL using the MSVC++ 2013 Express compiler by doing the following:

  • Installing ActivePerl 5.16.3 from here.
  • Grabbing openssl-1.0.1e.tar.gz and extracting it to C:\OpenSSL\Win64.
  • Opening up the "VS2013 x64 Cross Tools Command Prompt" and cd-ing to the directory where I had extracted the archive.
  • Running the following commands:

    perl Configure VC-WIN64A
    ms\do_win64a
    nmake -f ms\ntdll.mak

This completed without errors (the proper DLLs are built). However, something very strange has happened. If I open up openssl/ssl.h, the contents of the file are:

../../ssl/ssl.h

Since this is obviously not valid C/C++, I can't compile any applications that depend on OpenSSL headers due to the problem above. What have I done wrong?

like image 798
Nathan Osman Avatar asked Oct 20 '22 17:10

Nathan Osman


2 Answers

duskwuff's comment was indeed correct. The problem was that 7-Zip didn't properly extract the symbolic links in the archive. The solution was to download GnuWin32's tar command line utility and use that to extract the archive:

tar -xvf openssl-1.0.1e.tar.gz
like image 179
Nathan Osman Avatar answered Oct 28 '22 20:10

Nathan Osman


This is not the case of only openssl/ssl.h. This is the case of almost every files which I saw.

I guess that this information is used while building the OpenSSL to generate the include files into the include folder which you mentioned in the makefiles (for Windows, it is nt.mak or ntdll.mak).

If you generate or build the library, you will see in the log that header files are being copied to a folder mentioned in makefile and there you will find the header files which will look like valid C header files. You actually use those generated header files, not this header files.

It looks like a template for generating header files.

like image 28
doptimusprime Avatar answered Oct 28 '22 21:10

doptimusprime