我用VC建立了一个win32DLL的工程,但是我在我的类里面用了其他的非导出类就会有warning,就是弄不掉。 高手,帮帮忙吧。 5555 谢谢了。举个例子如下:
我的代码是:
// test.cpp : Defines the entry point for the DLL application.
//#include "stdafx.h"
#include "test.h"
#include <vector>
using namespace std;BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
class __declspec(dllexport) baby
{
public:
baby() {}
private:
vector<int> a;
};
然后会出现warning:
warning C4251: 'a' : class 'std::vector<int,class std::allocator<int> >' needs to have dll-interface to be used by clients of class 'baby'
我的代码是:
// test.cpp : Defines the entry point for the DLL application.
//#include "stdafx.h"
#include "test.h"
#include <vector>
using namespace std;BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
class __declspec(dllexport) baby
{
public:
baby() {}
private:
vector<int> a;
};
然后会出现warning:
warning C4251: 'a' : class 'std::vector<int,class std::allocator<int> >' needs to have dll-interface to be used by clients of class 'baby'
解决方案 »
- Atl 控件中 使用scroll (滚动条)的问题。(100分求助)
- 如何通过运行时的错误地址,查找代码行?通过MAP文件,调试高手请进!急!(图)
- 装了Windows Plantform SDK sp1还是找不到atlimage.h
- >>>>>>>>>>> 200分 >>>>>>>>>>>>>>UP有分,做过PPPOE的朋友们进来献计献策!
- 中国程序员们进来听听吧。中华民族要发奋途强啊。
- 帮我解决一下!
- 求助随机地图相关的程序
- 求MFC开发例子资料
- 急求助:使用窗口后无法弹出对话框为什么?
- 如何用调用全局的枚举类型?
- 请教高手:一个奇怪的LoadLibrary加载Dll失败问题
- 求助MFC中鼠标滚轮事件的实现
HOWTO: Exporting STL Components Inside & Outside of a Class
http://support.microsoft.com/default.aspx?scid=KB;en-us;q172396
PRB: Access Violation When Accessing STL Object in DLL