fatal error: 'argon2.h' file not found
Milivoje422 opened this issue ยท 7 comments
After trying to install argon2 on macbook, i get message:
MacBook-Air:project-go admin$ go get
github.com/tvdburgt/go-argon2
../github.com/tvdburgt/go-argon2/argon2.go:12:11: fatal error: 'argon2.h' file not found
#include <argon2.h>
^~~~~~~~~~
1 error generated.
Is there any way to fix this?
Bumping here, is there a workaround? @tvdburgt
Same issue but I use alpine O.S. Hope helps to you.
For my setup; dynamic library files are created under /usr/lib/x86_64-linux-gnu
by libargon2 make install
(see) which is different folder than gcc looks for to find dynamic library files (/usr/lib
). So, creating symbolic links worked for me:
ln -s "/usr/lib/x86_64-linux-gnu/libargon2.a" "/usr/lib/libargon2.a"
ln -s "/usr/lib/x86_64-linux-gnu/libargon2.so" "/usr/lib/libargon2.so"
ln -s "/usr/lib/x86_64-linux-gnu/libargon2.so.1" "/usr/lib/libargon2.so.1"
It looks like under default settings make install
tries to access /usr/share
on mac os which is protected by System Integrity Protection and fails after it.
One way around is running install script with custom path like sudo make install PREFIX=/usr/local
After process ends, those files should be created
/usr/local/bin/argon2
/usr/local/lib/libargon2.a
/usr/local/lib/libargon2.dylib
/usr/local/lib/libargon2.1.dylib
thanks @ufukty I avoided this by using the impl in the go std lib ๐
@decentralgabe how you compare std lib implementation against this one? is there any difference in usage?
@decentralgabe how you compare std lib implementation against this one? is there any difference in usage?
the API is a little different, but functionally the same https://pkg.go.dev/golang.org/x/crypto/argon2
@decentralgabe thanks for answer ๐