v icon indicating copy to clipboard operation
v copied to clipboard

builder error: 'openssl/rand.h' not found maybe with net.websocket?

Open whiter001 opened this issue 3 years ago • 6 comments

**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。

whiter001 avatar Jun 21 '22 10:06 whiter001

Same error.
Window 11

ngocbd avatar Jun 23 '22 10:06 ngocbd

https://stackoverflow.com/questions/71945395/builder-error-openssl-rand-h-not-found-windows-10

JalonSolov avatar Jun 23 '22 11:06 JalonSolov

Same error; Windows 7

ghosttk avatar Jul 19 '22 01:07 ghosttk

Same on mint 20.3

nerkn avatar Jul 21 '22 04:07 nerkn

same on Ubuntu 22.04

nsauzede avatar Jul 28 '22 17:07 nsauzede

same on Ubuntu 22.04

Solved with $ sudo apt install libssh-dev

nsauzede avatar Jul 28 '22 17:07 nsauzede

For windows it should be something along this:

  1. Install openssl https://slproweb.com/products/Win32OpenSSL.html
  2. Install gcc from https://winlibs.com/ (edited)
  3. 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
  4. Rebuild V with the v self command

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

7underlines avatar Aug 17 '22 12:08 7underlines

2. Install Winlibs https://winlibs.com/

Should be

  1. Install gcc from https://winlibs.com

JalonSolov avatar Aug 17 '22 18:08 JalonSolov