Under C++Builder, I am having an error at link step while trying to use static library libsodium.lib.
The test under Visual Studio works fine.
Any idea to help ?
This is my code :
// C++ Builder
//...
#define SODIUM_STATIC
extern "C" {
#include <sodium.h>
}
void __fastcall TForm1::FormShow(TObject *Sender)
{//
if (sodium_init() < 0) Edit1->Text = L"Failure"; else Edit1->Text = L"Success";
}
//=> Linker message = unresolved external symbol '_sodium_init'
// Visual C++
//...
#define SODIUM_STATIC
#include <sodium.h>
int main()
{//
if (sodium_init() < 0) {std::cout << "Failure" << std::endl; return 1;}
std::cout << "Success" << std::endl;
return 0;
}
=> Working fine !