类导出DLL时的C4273警告

ming6424 2005-08-22 03:00:56
warning C4273: 'IsTextFile' : inconsistent dll linkage. dllexport assumed.

我写了一个类,想把它导出,供其他同事使用。
但在生成Dll时,每个成员函数都有如上所示的警告。

请问这个问题应该如何解决???

#ifdef DLLDIR_EX
#define DLLDIR __declspec(dllexport) // export DLL information
#else
#define DLLDIR __declspec(dllimport) // import DLL information
#endif
//-----------------------------------------------------------------------------
class DLLDIR CMyClass
{
...
};
...全文
92 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
DentistryDoctor 2005-08-22
  • 打赏
  • 举报
回复
Visual C++ Concepts: Building a C/C++ Program

Compiler Warning (level 1) C4273'function' : inconsistent DLL linkage
Two definitions in a file differ in their use of dllimport.
The following sample generates C4273:
// C4273.cpp
// compile with: /W1
char __declspec(dllimport) c;
char c; // C4273, delete this line or the line above to resolve

int main()
{
}

15,471

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 进程/线程/DLL
社区管理员
  • 进程/线程/DLL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧