1、把库文件放到一个文件夹下。
2、打开vs项目文件
保存到这个文件夹下
3、再把dll项目文件和test代码放到一个文件夹下
4、General设置
5、c/c++ General
添加这么一行
6、Linker
上面的选项保持默认,下面的改成框里的东西
7、引入头文件,记得加上命名空间,前面
8、在pch.h里加入
你需要在你的预编译文件里添加些代码
#include “targetver.h”
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions你需要在你的预编译文件里添加些代码#include “targetver.h”
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
报错的那一行可以注释掉
9、添加宏
添加这个宏
10、删除宏
如果宏里有USERDLL(大概是这个名字),将其删除
11.curve_dll里添加这个元素
md $(SolutionDir)include\Curve_dll
del /f /q /s $(SolutionDir)include\Curve_dll
xcopy /s /c /q /r /y *.h $(SolutionDir)include\Curve_dll\
12、curve_test output这么设置
13、curve_test additional include
14、这里这么设置 curve_test
15、引入dll里的头文件,加一个目录