folly icon indicating copy to clipboard operation
folly copied to clipboard

openssl/opensslv.h file not found

Open Romick2005 opened this issue 2 years ago • 3 comments

Got this 'openssl/opensslv.h' file not found build error on case sensitive file system (macOS Monterey 12.4)

image

Romick2005 avatar Jul 13 '22 07:07 Romick2005

@Romick2005 I am also getting same issue, have you solved this issue. Please help me on this.

gnagaraja323 avatar Feb 16 '23 05:02 gnagaraja323

So all you need to do is to create a symlink for openssl to OpenSSL. I have added this into ios/Podfile:

target '[Name]' do
  ...
  post_install do |installer|
    ...
    ## Fix openssl incompatibility on case-sensitive fs. The real directory is Pods. In case-sensitive file systems the file won't exists.
      unless File.exist? "pods"
        system("cd Pods/OpenSSL-Universal/Frameworks/OpenSSL.xcframework/ios-arm64_armv7 && ln -sfh OpenSSL.framework openssl.framework")
    end
    ...
  end
end

PS. There are multiple plaforms inside OpenSSL.xcframework folder, so you need to select one depending on your architecture.

Romick2005 avatar Feb 16 '23 06:02 Romick2005

My system information: MacOS 13.3.1 (22E261)

For me, since I installed openssl using brew, from line 27 to line 29 in CMakeLists.txt, I have to set the OPENSSL_ROOT_DIR, OPENSSL_LIBRARIES, OPENSSL_INCLUDE_DIR to the followings:

set(OPENSSL_ROOT_DIR "/opt/homebrew/opt/[email protected]" ) set(OPENSSL_LIBRARIES "/opt/homebrew/opt/[email protected]/lib" ) set(OPENSSL_INCLUDE_DIR "/opt/homebrew/opt/[email protected]/include" )

I also discovered that sometimes CMAKE_SYSTEM_NAME failed to detect my system as "Darwin", so I also have to manually set the above variables in the ELSE() block of the CMakeLists.txt.

So I think you should check the installation directory of your ssl and check whether they match with the paths set in the CMakeLists.txt.

faithk7 avatar May 11 '23 00:05 faithk7