#include "stdafx.h"
#include "dlltest.h"
#include "dlltestDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
#include "AlgorithmFMS.h"
#pragma comment (lib, "algorithmdll.lib")
以上是我测试的代码 上面同一种颜色的代码是正常的包含,下面是我隐式调用自己写的一个库,
那么在编译时出现下列问题
先是一个warnning C4229: 使用了记时错误 : 忽略数据上的修饰符
然后是一大堆的错误
如 :C2365: “operator new”: 重定义;以前的定义是“函数”
C2491: "new":不允许dllimport数据的定义
解决问题办法:
#include "stdafx.h"
#include "dlltest.h"
#include "dlltestDlg.h"
#include "AlgorithmFMS.h"
#pragma comment (lib, "algorithmdll.lib")
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
头文件尽量放在文件的最前面具体原因也不是太清楚。欢迎指教!!
参考连接:
http://blog.youkuaiyun.com/zipper9527/article/details/6894289