error LNK2019: 无法解析的外部符号 "__declspec(dllimport)
来源:互联网 发布:淘宝网红草宛儿服饰 编辑:程序博客网 时间:2024/05/18 20:07
我在VS2005下写C++的程序,采用一个工程生成DLL文件给另一个工程执行,但每次执行时都出现 error LNK2019: 无法解析的外部符号 "__declspec(dllimport)错误。检查了好几遍代码都觉得没有问题。
最后发现是字符集出现问题。生成DLL文件的字符集是Unicode而生成exe文件的字符集为默认的ASCII。
只要统一字符集即可解决问题:
VS2005的c++项目默认字符集是使用 Unicode 字符集,在项目属性->配置属性-->常规->项目默认值->字符集中设置字符集即可。
补充VC6.0是默认采用ASCII字符集的。
- error LNK2019: 无法解析的外部符号 "__declspec(dllimport)
- 【转】error LNK2019: 无法解析的外部符号 "__declspec(dllimport)
- error LNK2019: 无法解析的外部符号 "__declspec(dllimport)
- error LNK2019: 无法解析的外部符号 "__declspec(dllimport)
- error LNK2019: 无法解析的外部符号 "__declspec(dllimport)
- 字符集导致的 error LNK2019: 无法解析的外部符号 "__declspec(dllimport)
- error LNK2019: 无法解析的外部符号 "__declspec(dllimport) const HXmlParse::
- error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: static void __cdecl xercesc_2_8::XMLPlatfor
- error LNK2019: 无法解析的外部符号 "__declspec(dllimport) long __stdcall RtlGetVersion(struct _OSVERSIONINFOW
- MFC DLL报错:error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: __thiscall
- osg 多个error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public:
- VS2010封装DLL时报错:error LNK2019: 无法解析的外部符号 "__declspec(dllimport)
- error: LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: __cdecl QWidget::
- error LNK2001: 无法解析的外部符号 "__declspec(dllimport)
- error LNK2019: 无法解析的外部符号 "__declspec(dllimport) int add(int,int)" (__imp_?add@@YGHHH@Z)
- 新建Duilib工程,加入示例代码时,出现error LNK2019: 无法解析的外部符号 "__declspec(dllimport)
- mainwindow.obj:-1: 错误:LNK2019: 无法解析的外部符号 "__declspec(dllimport) public:
- error LNK2001: 无法解析的外部符号 "__declspec(dllimport) protected: __thiscall std::_Container_base_aux_allo
- 富人和穷人的12个经典差异
- 手机壳体的材料的怎么选用
- 利用Fedora DVD构建本地yum源
- "0XC0150002"应用程序初始化失败的解决办法_Visual
- 总结
- error LNK2019: 无法解析的外部符号 "__declspec(dllimport)
- sql2005里获取查询结果的行号
- 今天遇到的combox问题和动态显示时间问题
- 数据库基础:数据库范式
- 会mfc的高手帮看一下呀
- 日历实现
- PYQT4 + Python2.6 + eric4-4.3.10 的安装全过程
- main函数之前还有代码吗
- struts2路径问题