'builder error: 'openssl/rand.h' not found [Windows 10]

I'm learning Vlang and I want to make a simple discord bot with it, so I tried with https://github.com/Terisback/discord.v but I had error I fixed.

But finally I can't use the module, because:

builder error: 'openssl/rand.h' not found

I noticed it was because I'm on Windows, how to fix this without installing another os ?



Solution 1:[1]

You can install OpenSSL from here: https://slproweb.com/products/Win32OpenSSL.html
Then at the top of the V file you're working in you need to put this.

#flag windows -I pathto/sslfoldername/include -L pathto/sslfoldername/lib -lssl -lcrypto

Or you can include it when you compile with v run -cflags "-I/path/to/openssl" myproject.v.

Note that as of just this morning, the lead developer said in the Discord community that they were planning to start shipping new builds of vlang with openssl embedded. Given some time, this error will not occur anymore.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Adam Oates