vlang / v

Simple, fast, safe, compiled language for developing maintainable software. Compiles itself in <1s with zero library dependencies. Supports automatic C => V translation. https://vlang.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

whiter001 opened this issue · 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。

Same error.
Window 11

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:

  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


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

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

Should be

  1. Install gcc from https://winlibs.com
ezoic increase your site revenue