DLL problem
-
I'm a newbie in creating DLL projects and can't seem to solve this problem. I am using a similar technique to Steve Driessen's article[^]. I'm trying to create a DLL that exports a couple of classes that uses some MFC collection objects, but I keep on getting this warning:
warning C4251: 'CGifParser::m_aData' : class 'CArray' needs to have dll-interface to be used by clients of class 'CGifParser'
(m_aData) is a CArray that is a member of CGifParser, the class I'm trying to export). The test program works correctly on a debug build, but not on a release build when testing the DLL. I'm just trying to create a simple library so that I can reuse the code in other projects easier. Visual Studio .Net complicates everything! I first attempted this by trying to create a static library (.lib) but I got all these duplicate declaration errors from the standard C++ libraries. I'm use to simple command line linkers on Unix =). Thanks. - Anatari -
I'm a newbie in creating DLL projects and can't seem to solve this problem. I am using a similar technique to Steve Driessen's article[^]. I'm trying to create a DLL that exports a couple of classes that uses some MFC collection objects, but I keep on getting this warning:
warning C4251: 'CGifParser::m_aData' : class 'CArray' needs to have dll-interface to be used by clients of class 'CGifParser'
(m_aData) is a CArray that is a member of CGifParser, the class I'm trying to export). The test program works correctly on a debug build, but not on a release build when testing the DLL. I'm just trying to create a simple library so that I can reuse the code in other projects easier. Visual Studio .Net complicates everything! I first attempted this by trying to create a static library (.lib) but I got all these duplicate declaration errors from the standard C++ libraries. I'm use to simple command line linkers on Unix =). Thanks. - AnatariThis means the base class (CArray) was not declared to be exported. Try adding a line like:
template class __declspec(dllexport) CArray<_Arraydata_, _Arraydata_>;
Hope that will fix it.. /moliate
The corners of my eyes catch hasty, bloodless motion - a mouse? Well, certainly a peripheral of some kind.
Neil Gaiman - Cold Colours