0

I'm using MSVS and am trying to install some libraries following the instructions in this post: https://stackoverflow.com/a/20339327/8619332

However, although it's all success I got this error: Cannot open include file: 'openssl/opensslconf.h'

I didn't really understand what the instructions meant by:

"Make sure the include directory and lib directory are specified under the Visual C++ directories in project properties."

Well, I added all the lib and include directories in the project folder in project properties -> VC++ -> include/lib.

Upon searching about this error, I came across on many different answers. Such as:

"For anyone who comes across this bug, it is fixed by going to project->build options, select your sketch (not the debug or release, select "search directories" and add "......\openssl\include"."

However there isn't really a "build options" option, so I wasn't able to do much.

I also tried installing OpenSSL-Win32. Am I doing something wrong? How do I fix this?

Edit: The whole mistake is:

c:\users\alex\source\repos\project26\packages\openssl.1.0.1.21\build\native\include\openssl\e_os2.h(56): fatal error C1083: Cannot open include file: 'openssl/opensslconf.h': No such file or directory

  • What are you trying to do? Are you trying to compile curl on windows using MSVS2017 command prompt or something else? – Artemy Vysotsky Sep 16 '17 at 15:05
  • Yes, I downloaded some code from git, and I am trying to compile it. After installing curl package with NuGet tho, I get this problem. – Sedan Bircandam Sep 16 '17 at 15:10
  • Make sure that the folder that you added to your include paths (for the openssl library) for your compiler has a subfolder named openssl. – drescherjm Sep 16 '17 at 15:10
  • Yes, it has. Upon closer look, the problem isnt coming from the code I downloaded, but from the library itself. The included headers have included openssl/opensslconf.h, which cant be found. – Sedan Bircandam Sep 16 '17 at 15:15
  • Have you installed openssl also as nuget package? – Artemy Vysotsky Sep 16 '17 at 15:16
  • I have not. But it is included to the curl package (i can see it as well). Even after trying to install it, nothing new was added, the result was the same. – Sedan Bircandam Sep 16 '17 at 15:22

1 Answers1

0

Experienced similar problem. However, although the error looks like compiling error, this is actually a misleading by VS2017. The real problem to me was the linking problem, which generate build failure, and must trigger VS to try understand the error by doing a local compile, which make the misleading error.

What I've done to fix the problem, is to add the following Additional Options for the linker in that cross platform project:

-lssl -lcrypto

Weishan Yang
  • 428
  • 2
  • 5
  • 15