-2
我已編譯.so庫,並將其複製到我的新項目。我也從源文件夾複製.h文件。C++。 .so和.h的用法。什麼參數'主要'想要?
現在我試着使用它。
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <iostream>
#include "md5.h"
using namespace std;
int main (int argc, char *argv[]) {
md5_init();
md5_append();
md5_finish();
return 0;
}
在輸出我得到了一個錯誤:太少參數的功能«無效md5_init(md5_state_t *)»
和.h文件:
typedef unsigned char md5_byte_t; /* 8-bit byte */
typedef unsigned int md5_word_t; /* 32-bit word */
/* Define the state of the MD5 Algorithm. */
typedef struct md5_state_s {
md5_word_t count[2]; /* message length in bits, lsw first */
md5_word_t abcd[4]; /* digest buffer */
md5_byte_t buf[64]; /* accumulate block */
} md5_state_t;
#ifdef __cplusplus
extern "C"
{
#endif
/* Initialize the algorithm. */
#ifdef WIN32
_declspec(dllexport)
#endif
void md5_init(md5_state_t *pms);
/* Append a string to the message. */
#ifdef WIN32
_declspec(dllexport)
#endif
void md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes);
/* Finish the message and return the digest. */
#ifdef WIN32
_declspec(dllexport)
#endif
void md5_finish(md5_state_t *pms, md5_byte_t digest[16]);
#ifdef __cplusplus
} /* end extern "C" */
#endif
庫已獲得弗羅姆這site 。請參閱C++實現。
我誤解了什麼?
你看了所有的文檔,頁眉和例子? – PlasmaHH