[RESOLVED] Error while statically linking Libsodium
It appears that I'm linking libsodium correctly, but I'm getting linker errors for _sodium_init, I'm using Visual Studio 2015, and the libsodium.lib (prebuilt) for msvc 140 (for vs2015). The project is c++.
This is how my setting look for linker: http://prntscr.com/ixv042
For additional includes, my settings look like this: http://prntscr.com/ixv0mg
The folder that the project resides in looks like this: http://prntscr.com/ixv0vw
I'm including sodium.h as so: http://prntscr.com/ixv1go
and of course, in main() I'm doing
I'm not sure why I would be getting linker errors, does anyone spot anything wrong with the code?
Re: Error while statically linking Libsodium
What linker errors are you getting?
Have you followed the instructions re defining the required macro?
Quote:
Note for Visual Studio
Projects willing to statically link Sodium must define a macro named SODIUM_STATIC. This will prevent symbol definitions from being referenced with __dllexport.
...
For static linking, Visual Studio users should define SODIUM_STATIC=1 and SODIUM_EXPORT=. This is not required on other platforms.
See https://download.libsodium.org/doc/installation/
https://download.libsodium.org/doc/usage/
Re: Error while statically linking Libsodium
Yes, I followed the instructions, but I also figured out what the issue was.
It was actually quite a foolish error on my part, I tried to link the x64 static library when the project was x86.
Thank you for your effort 2kaud!