v
v copied to clipboard
builder error: 'openssl/rand.h' not found maybe with net.websocket?
**V version: V 0.2.4 e505fcd **OS: windows 11 专业版;21H2
What did you do? v .\v\examples\websocket\ping.v
What did you expect to see?
What did you see instead? builder error: 'openssl/rand.h' not found
after winget install OpenSSL
The error still exists。
Same error.
Window 11
https://stackoverflow.com/questions/71945395/builder-error-openssl-rand-h-not-found-windows-10
Same error; Windows 7
Same on mint 20.3
same on Ubuntu 22.04
same on Ubuntu 22.04
Solved with $ sudo apt install libssh-dev
For windows it should be something along this:
- Install openssl https://slproweb.com/products/Win32OpenSSL.html
- Install gcc from https://winlibs.com/ (edited)
- Add the following 2 lines after the first line to the file v/vlib/net/openssl/c.v - adjust the path if necessary #flag windows -I C:\Program Files\OpenSSL-Win64\include #flag windows -L C:\Program Files\OpenSSL-Win64\lib
- Rebuild V with the
v selfcommand
Credits: https://discord.com/channels/592103645835821068/592294828432424960/975457897075081276
At some point in the future this windows workaround won't be necessary anymore - see here:
sorry about that windows + openssl is tough, we'll embed openssl into 3rdparty soon https://discord.com/channels/592103645835821068/592114487759470596/975724192592953355
2. Install Winlibs https://winlibs.com/
Should be
- Install gcc from https://winlibs.com