fatal error: 'sodium/version.h' file not found white setting up libsodium-go

1.4k Views Asked by At

I was working with the Github API in order create a script to transfer secrets from Gitlab.

While doing so I have been trying to setup the libsodium-go package to encrypt the secrets. Here is the link for reference https://github.com/GoKillers/libsodium-go

I have followed the steps mentioned on the page.

Pre-setup:

Please install Libsodium here https://download.libsodium.org/doc/installation/index.html
sudo ldconfig
sudo apt-get install pkg-config

Install libsodium-go:

go get -d github.com/GoKillers/libsodium-go
cd $GOPATH/src/github.com/GoKillers/libsodium-go
./build.sh

But for the pre setup have used brew install libsodium

When I run the ./build.sh

I get the following error

In file included from cryptohash/crypto_hash.go:5:
/usr/local/include/sodium.h:5:10: fatal error: 'sodium/version.h' file not found
#include "sodium/version.h"
         ^~~~~~~~~~~~~~~~~~
1 error generated.

Not sure how to resolve this. Any help would be appreciated!

1

There are 1 best solutions below

0
On

Was having the same issue, when I ran brew install libsodium, a warning was displayed stating that libsodium has been installed, it's just not linked. To link run brew link libsodium. If conflicting files are found, running brew link --overwrite libsodium resolved the problem.