【发布时间】:2020-03-06 19:23:46
【问题描述】:
我在带有QMake 构建系统的MS-Windows 中使用带有MSVC2017 的QtCreator IDE。为了总结我的调试问题,我举个例子:
我使用以下文件创建了一个名为 library 的项目:
library.h
#ifndef A
#define A
#include <stdio.h>
#ifdef __cplusplus
extern "C"
#endif
__declspec(dllexport) void some_function(void);
#endif
library.c
#include "library.h"
void some_function(void)
{
printf("We are in the %s::%d\n", __FUNCTION__, __LINE__);
}
我从我的library 项目中创建了.dll 和.lib。我在另一个项目中使用过,当我尝试调试时,我可以看到 .dll 函数源代码:
main.cpp
#include "library.h"
int main (void)
{
some_function(); /* Put the break point right here,
* And i could see the source code
* while debugging.
*/
}
在上面的例子中一切都是正确的,调试时不让我看到我的.dll源代码有什么问题?
【问题讨论】:
-
“为了总结我的调试问题,我给你举个例子” ...“在上面的例子中一切都是正确的” 那么,问题是什么?
-
@IgorTandetnik "调试时不让我看到我的 .dll 源代码会有什么问题?",在另一个项目中我看不到
dll源代码调试时的代码,我知道什么是问题? -
您在问题中没有提到这一点。很可能,您没有该 DLL 的调试信息(.pdb 文件)。
标签: c++ c debugging visual-c++ dll