我在带有MSVC2017
构建系统的MS-Windows中将QtCreator IDE与QMake
一起使用。为了总结调试问题,我举一个例子:
我使用以下文件创建一个名为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__);
}
然后我从.dll
项目中分别制作了.lib
和library
。我在另一个项目中使用过,而在尝试调试时,我可以看到.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
源代码可能有问题吗?