Swift replit. problem with openssl

Hello. i try to write swift http server. but have problems with openssl.
https://replit.com/@DmitriyNikolin/TestSwiftServer?v=1

Building for debugging...
<module-includes>:1:10: note: in file included from <module-includes>:1:
#include "shim.h"
         ^
/home/runner/TestSwiftServer/.build/checkouts/OpenSSL/Sources/OpenSSL/shim.h:20:10: error: 'openssl/conf.h' file not found
#include <openssl/conf.h>
         ^
/home/runner/TestSwiftServer/.build/checkouts/BlueSSLService/Sources/SSLService/SSLService.swift:25:9: error: could not build C module 'OpenSSL'
        import OpenSSL
               ^
<module-includes>:1:10: note: in file included from <module-includes>:1:
#include "shim.h"
         ^
/home/runner/TestSwiftServer/.build/checkouts/OpenSSL/Sources/OpenSSL/shim.h:20:10: error: 'openssl/conf.h' file not found
#include <openssl/conf.h>
         ^
/home/runner/TestSwiftServer/.build/checkouts/BlueSSLService/Sources/SSLService/SSLService.swift:25:9: error: could not build C module 'OpenSSL'
        import OpenSSL
               ^
<module-includes>:1:10: note: in file included from <module-includes>:1:
#include "shim.h"
         ^
/home/runner/TestSwiftServer/.build/checkouts/OpenSSL/Sources/OpenSSL/shim.h:20:10: error: 'openssl/conf.h' file not found
#include <openssl/conf.h>
         ^
/home/runner/TestSwiftServer/.build/checkouts/BlueSSLService/Sources/SSLService/SSLService.swift:25:9: error: could not build C module 'OpenSSL'
        import OpenSSL

sudo not working also. so can’t install openssl manually

Try installing OpenSSL via nix

Also, see the documentation on how you can do this:
https://docs.replit.com/programming-ide/configuring-repl

1 Like

As @ReplitIronclad has said, install it using nix. I have encountered issues where my programs cannot find it even when it is installed, and I have to add the nix path to OpenSSL.out to the LD_LIBRARY_PATH.