warning C4273 And LNK4049:
来源:互联网 发布:淘宝推广工具排名 编辑:程序博客网 时间:2024/05/01 18:03
//DownNet.h
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifdef DOWNNET_DLL
#pragma message (" export DownNet ")
#define DownAPI __declspec(dllexport)
#else
#pragma message (" import DownNet ")
#define DownAPI __declspec(dllimport)
#endif
#pragma comment(lib,"DownNet .lib")
BOOL DownAPI DownloadFile( HWND hWnd, // 下载对话框的句柄,用于发送消息
int nDownMode, // 下载模式:1为比对下载 2为快速修复 3为修复游戏
LPTSTR lpszGameSort, // 所点击游戏的游戏分类
LPTSTR lpszClickName // 点击游戏名
);
BOOL DownAPI DownloadFile( HWND hWnd, // 下载对话框的句柄,用于发送消息
int nDownMode, // 下载模式:1为比对下载 2为快速修复 3为修复游戏
LPTSTR lpszFullGameName // 所点击的游戏(游戏分类+名称)
);
// DownCoreApp.h
#ifdef DOWNNET_DLL
#pragma message (" export DownNet dll. udknight")
#define DOWNNETSDK_API __declspec(dllexport)
#else
#pragma message (" import DownNet dll. udknight")
#define DOWNNETSDK_API __declspec(dllimport)
#endif
class CTimerThread;
class DOWNNETSDK_API DownCoreApp
{
.............
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifdef DOWNNET_DLL
#pragma message (" export DownNet ")
#define DownAPI __declspec(dllexport)
#else
#pragma message (" import DownNet ")
#define DownAPI __declspec(dllimport)
#endif
#pragma comment(lib,"DownNet .lib")
BOOL DownAPI DownloadFile( HWND hWnd, // 下载对话框的句柄,用于发送消息
int nDownMode, // 下载模式:1为比对下载 2为快速修复 3为修复游戏
LPTSTR lpszGameSort, // 所点击游戏的游戏分类
LPTSTR lpszClickName // 点击游戏名
);
BOOL DownAPI DownloadFile( HWND hWnd, // 下载对话框的句柄,用于发送消息
int nDownMode, // 下载模式:1为比对下载 2为快速修复 3为修复游戏
LPTSTR lpszFullGameName // 所点击的游戏(游戏分类+名称)
);
// DownCoreApp.h
#ifdef DOWNNET_DLL
#pragma message (" export DownNet dll. udknight")
#define DOWNNETSDK_API __declspec(dllexport)
#else
#pragma message (" import DownNet dll. udknight")
#define DOWNNETSDK_API __declspec(dllimport)
#endif
class CTimerThread;
class DOWNNETSDK_API DownCoreApp
{
.............
}
: warning C4273: 'GetGameVersion' : inconsistent dll linkage. dllexport assumed.: warning C4273: 'GetGameDownloadPath' : inconsistent dll linkage. dllexport assumed.
reason:
warning C4273 means that you've probably "double declared" these (as the same type, but with different linkages). The compiler is assuming you meant to export them.
DLL 导出函数中有重载函数,我的工程中没有必要,所以将其中一个DownloadFile删除即可消除,但是还有 warning LNK4049:
另外一个主要的是类DownCoreApp定义已经将成员函数导出,两处文件导出,所以导致了warning LNK4049:
如果不想让人用这个类,让调用者直接调函数的话,将DownCoreApp定义前的DOWNNETSDK_API直接删除即可消除警告
0 0
- warning C4273 And LNK4049:
- warning C4273 And LNK4049:
- warning c4273: inconsistent dll linkage
- warning C4273: dll链接不一致
- warning c4273: inconsistent dll linkage
- warning C4273: dll链接不一致
- warning C4273: dll链接不一致
- warning C4273: dll 链接不一致 的解决方法
- warning c4273: inconsistent dll linkage 的解决方法
- warning c4273: inconsistent dll linkage 的解决方法
- 由dll调用中的warning C4273和Link2019想到的
- 关于vc2005编译时的warning C4273 …… inconsistent dll linkage问题
- C:\Users\Dll1\Dll1.cpp(5) : warning C4273: 'add' : inconsistent dll linkage. dllexport assumed.
- 关于vc6.0使用libxml库编译遇警告warning LNK4049: 已导入本地定义的符号 _xmlFree的解决方法
- Use strict and warning
- #warning and #error
- LNK2005 LNK1169 Error and LNK4098 Warning LINK : warning LNK4075:
- warning: backslash and newline separated by space
- 工作之余的胡思乱想
- DLL导出类的问题
- mingw编译boost
- 如何安装Minimal SYStem(MSYS)
- vi命令
- warning C4273 And LNK4049:
- Linux Find命令
- Linux SSH
- DLL注入程序的一般步骤
- vs2008 warning C4251
- Cron 表达式
- Codeforces Round #219 (Div. 2)
- Linux auto-mount
- 如何解决VC中的警告warning C4251 needs to have dll-interface