tvdburgt / go-argon2

Go bindings for Argon2
MIT License
135 stars 13 forks source link

fatal error: 'argon2.h' file not found #11

Open Milivoje422 opened 5 years ago

Milivoje422 commented 5 years ago

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

      ^~~~~~~~~~

1 error generated. Is there any way to fix this?

decentralgabe commented 2 years ago

Bumping here, is there a workaround? @tvdburgt

ufukty commented 2 years ago

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"
ufukty commented 2 years ago

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
decentralgabe commented 2 years ago

thanks @ufukty I avoided this by using the impl in the go std lib 😄

ufukty commented 2 years ago

@decentralgabe how you compare std lib implementation against this one? is there any difference in usage?

decentralgabe commented 2 years ago

@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

ufukty commented 2 years ago

@decentralgabe thanks for answer 👍