DLL 中命名空间的有关问题
DLL 中命名空间的问题
---------------DLL-------------
namespace MySpace
{
void _declspec(dllexport) fun()
{
........
}
}
-------------EXE---------------
using namespace MySpace;
extern void fun();
---------ERROR--------------------
error C2653: 'MySpace' : is not a class or namespace name
----------HELP------------------------
这种情况下,我的 EXE 中怎么才能使用到 fun 函数?
------解决方案--------------------
导入的话头文件可不是export了,注意做对应的变化。
export改import,头文件包含进来,using解出来就可以了。
---------------DLL-------------
namespace MySpace
{
void _declspec(dllexport) fun()
{
........
}
}
-------------EXE---------------
using namespace MySpace;
extern void fun();
---------ERROR--------------------
error C2653: 'MySpace' : is not a class or namespace name
----------HELP------------------------
这种情况下,我的 EXE 中怎么才能使用到 fun 函数?
------解决方案--------------------
导入的话头文件可不是export了,注意做对应的变化。
export改import,头文件包含进来,using解出来就可以了。