谁能告诉我这是个啥问题啊
报错 未解析的外部符号
我感觉我的动态链接库配置的没问题啊
报错:
#define BHDLL__
#include <stdio.h>
#include "SqStack.h" //**▲03 栈和队列**//
// 测试函数,打印元素
void PrintElem(SElemType e) {
printf("%d ", e);
}
int main() {
SqStack S;
int i;
SElemType e;
extern Boolean debug;
printf("████████ 函数 InitStack \n");
{
printf("█ 初始化顺序栈 S ...\n");
InitStack(&S);
}
PressEnterToContinue(debug);
printf("████████ 函数 StackEmpty \n");
{
StackEmpty(S) ? printf("█ S 为空!!\n") : printf("█ S 不为空!\n");
}
PressEnterToContinue(debug);
printf("████████ 函数 Push \n");
{
for(i = 1; i <= 6; i++) {
Push(&S, 2 * i);
printf("█ 将 \"%2d\" 压入栈 S ...\n", 2 * i);
}
}
PressEnterToContinue(debug);
printf("████████ 函数 StackTraverse \n");
{
printf("█ S 中的元素为:S = ");
StackTraverse(S, PrintElem);
}
PressEnterToContinue(debug);
printf("████████ 函数 StackLength \n");
{
i = StackLength(S);
printf("█ S 的长度为 %d \n", i);
}
PressEnterToContinue(debug);
printf("████████ 函数 Pop \n");
{
Pop(&S, &e);
printf("█ 栈顶元素 \"%d\" 出栈...\n", e);
printf("█ S 中的元素为:S = ");
StackTraverse(S, PrintElem);
}
PressEnterToContinue(debug);
printf("████████ 函数 GetTop \n");
{
GetTop(S, &e);
printf("█ 栈顶元素的值为 \"%d\" \n", e);
}
PressEnterToContinue(debug);
printf("████████ 函数 ClearStack \n");
{
printf("█ 清空 S 前:");
StackEmpty(S) ? printf(" S 为空!!\n") : printf(" S 不为空!\n");
ClearStack(&S);
printf("█ 清空 S 后:");
StackEmpty(S) ? printf(" S 为空!!\n") : printf(" S 不为空!\n");
}
PressEnterToContinue(debug);
printf("████████ 函数 DestroyStack \n");
{
printf("█ 销毁 S 前:");
S.base != NULL && S.top != NULL ? printf(" S 存在!\n") : printf(" S 不存在!!\n");
DestroyStack(&S);
printf("█ 销毁 S 后:");
S.base != NULL && S.top != NULL ? printf(" S 存在!\n") : printf(" S 不存在!!\n");
}
PressEnterToContinue(debug);
return 0;
}
不知道你这个问题是否已经解决, 如果还没有解决的话:回答:
这个错误提示"无法解析的外部命令_imp_debug",一般来说是由于找不到某个dll库文件或者某些库文件冲突引起的。您可以尝试以下几个步骤来解决问题:
dumpbin /dependents your_program.exe
set path
如果您想将某个dll文件添加到path环境变量中,可以使用以下命令行:
set path=%path%;C:\path\to\your\dll\file
注意,在path环境变量中添加dll文件路径时,路径的分割符是英文分号“;”。
如果您已经确定动态链接库的依赖没有问题,那么您可以考虑使用Process Monitor工具来跟踪程序运行时的文件、注册表等操作,从而找到程序出错的原因。您可以下载Process Monitor工具,然后启动程序,按照如下步骤进行设置:
在Filter菜单中选择“Filter…”选项;
在Filter对话框中设置以下两个筛选条件,然后点击Add按钮:
点击OK关闭Filter对话框;
当程序出错时,您可以查看Process Monitor的输出,查找错误信息。
希望以上建议可以解决您的问题,如还有帮助,请随时联系我。