Reputation: 2604
I did:
cmd.exe
: perl Configure mingw shared --prefix=/c/opensslmake depand
make
make install
test.cpp:
#include <stdio.h>
#include <string.h>
#include <openssl/md4.h>
int main()
{
unsigned char digest[MD4_DIGEST_LENGTH];
char string[] = "hello world";
MD4((unsigned char*)&string, strlen(string), (unsigned char*)&digest);
char mdString[33];
for(int i = 0; i < MD4_DIGEST_LENGTH; i++)
sprintf(&mdString[i*2], "%02x", (unsigned int)digest[i]);
printf("md4 digest: %s\n", mdString);
return 0;
}
Tried to compile it and got this:
C:\cpp>g++ test.cpp -lcrypto
test.cpp:3:25: fatal error: openssl/md4.h: No such file or directory
compilation terminated.
What should I do now?
Upvotes: 3
Views: 4207
Reputation: 145899
Find the directory where the included file, openssl/md4.h
, is installed and include that directory in the command.
For example, if the full path of openssl/md4.h
is c:\openssl\include\openssl\md4.h
, your command would become:
g++ -Ic:\openssl\include tst.cpp -lcrypto
Upvotes: 3