It looks like gcc cannot learn the headers within the embody folder of OpeenSSL. Should not the flags I added within the ~/.zprofile assist with discovering that, although?
What am I lacking?


Unique Process

Compile this C program. It can use OpenSSL to encrypt/decrypt utilizing AES-256-GCB.

Difficulty

When I attempt to run

gcc Evp-gcm-encrypt.c -o Evp-gcm-encrypt

I get

Evp-gcm-encrypt.c:1:10: deadly error: openssl/conf.h: No such file or listing
1 | #embody <openssl/conf.h>
  |          ^~~~~~~~~~~~~~~~
compilation terminated.

What I attempted

  1. I put in OpenSSL by way of House-brew.

    brew replace
    brew set up openssl@1.1
    
  2. Added such strains each in my ~/.zprofile and ~/.zshrc

    export PATH="/usr/native/decide/openssl@1.1/bin:$PATH"
    export LDFLAGS="-L/usr/native/decide/openssl@1.1/lib"
    export CPPFLAGS="-I/usr/native/decide/openssl@1.1/embody"
    
  3. Eliminated and re-installed the Xcode command-line-tools

    sudo rm -rf /Library/Developer/CommandLineTools                           
    xcode-select --install
    
  4. Deactivated Anaconda’s OpenSSL (it was being executed earlier than the home-brew model)

    conda deactivate
    
  5. Linking OpenSSL

    brew hyperlink --force openssl                                            
    

    however I get

    Error: No such keg: /usr/native/Cellar/openssl
    
  6. Linking OpenSSL@1.1

     brew hyperlink --force openssl@1.1                                           
    

    however I get

     Warning: Refusing to hyperlink macOS supplied/shadowed software program: openssl@1.1
     If it is advisable to have openssl@1.1 first in your PATH, run:
     echo 'export PATH="/usr/native/decide/openssl@1.1/bin:$PATH"' >> ~/.zshrc
    
     For compilers to seek out openssl@1.1 you might must set:
     export LDFLAGS="-L/usr/native/decide/openssl@1.1/lib"
     export CPPFLAGS="-I/usr/native/decide/openssl@1.1/embody"
    
     For pkg-config to seek out openssl@1.1 you might must set:
     export PKG_CONFIG_PATH="/usr/native/decide/openssl@1.1/lib/pkgconfig"
    

System information

  1. MacOS 12.5.1 (Monterey)
  2. MacBook Air (Retina, 13-inch, 2018)
  3. SIP disabled
  4. Safety set to none

You could log in to reply this query.