关于md5编译出错 急需高手解决

ztzt 2003-09-15 12:05:25
我在 CDlgMain.cpp中
的程序如下
int CDlgMain::con_md5(char * username, char * passwd,char *tmstr, char * auth)
{dpl_md5_ctx_t c;
char empty[9];
memset(empty,0,9);
if (auth == NULL)

return -1;
LPTSTR lpusername =(LPTSTR)(LPCTSTR)username;
LPTSTR lppasswd =(LPTSTR)(LPCTSTR)passwd;

dpl_MD5Init(&c);
dpl_MD5Update(&c, (const unsigned char*)lpusername, strlen(username));
dpl_MD5Update(&c, (const unsigned char*)empty, sizeof(empty));
dpl_MD5Update(&c, (const unsigned char*)lppasswd, strlen(lppasswd));
dpl_MD5Update(&c, (const unsigned char*)tmstr, strlen(tmstr));
dpl_MD5Final((unsigned char*)auth, &c);
return 0;
}

//CDlgMain.h中的声明为:
public:
int con_md5(char * username,char * passwd,char *tmstr, char * auth);

CDlgMain.cpp可以编译通过,没有错误
为什么在rebuild all 时编译不过去错误提示为
Linking...
DlgMain.obj : error LNK2001: unresolved external symbol _dpl_MD5Final
DlgMain.obj : error LNK2001: unresolved external symbol _dpl_MD5Update
DlgMain.obj : error LNK2001: unresolved external symbol _dpl_MD5Init
Debug/sms.exe : fatal error LNK1120: 3 unresolved externals

在CDlgMain.CPP的开头加了#include "dpl_md5.h"
dpl_md5.h中定义了dp1_MD5Final、dp1_MD5Update、dp1_MD5Init这三个函数
...全文
36 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
ztzt 2003-09-17
  • 打赏
  • 举报
回复
已经在dpl_md5.h中定义了
#ifndef DPL_MD5_H
#define DPL_MD5_H

#ifdef __cplusplus
extern "C" {
#endif

foobar 2003-09-17
  • 打赏
  • 举报
回复
md5c.c中对应的函数名有没有加上dpl前缀?
foobar 2003-09-16
  • 打赏
  • 举报
回复
如果你的md5的源文件为.c
在dpl_md5.h中添加
#ifdef __cplusplus
extern "C" {
#endif

// old prototype here

#ifdef __cplusplus
}
#endif
ztzt 2003-09-15
  • 打赏
  • 举报
回复
CDlgMain.cpp中#include dpl_md5.h
test09test 2003-09-15
  • 打赏
  • 举报
回复
可能是头文件dpl.md5.h没找到或没在调用的cpp里,include
klbt 2003-09-15
  • 打赏
  • 举报
回复
关注,帮你顶。

790

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 其他移动相关
社区管理员
  • 移动开发其他问题社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧