Compiler warnings with MySQL++ with release configuration
For some reason I get some warnings about "non dll-interface class" when building with a release configuration, but not debug.
I've compared the release and debug configurations, and my ones with the MySQL++ example ones, however I cant see which setting is causing these warnings.
1>c:sqlmysql 5.0mysql++-3.0.9libqparms.h(49) : warning C4275: non dll-interface class 'std::_Container_base_aux' used as base for dll-interface class 'std::_Container_base_aux_alloc_real<_Alloc>'
1> with
1> [
1> _Alloc=std::allocator<mysqlpp::SQLTypeAdapter>
1> ]
1> C:appsMicrosoft Visual Studio 9.0VCincludexutility(377) : see declaration of 'std::_Container_base_aux'
1>c:sqlmysql 5.0mysql++-3.0.9libresult.h(212) : warning C4275...
Code snippet from the warning:
class MYSQLPP_EXPORT SQLQueryParms : public std::vector<SQLTypeAdapter>
{
...
The obvious thing to me seems to be that I'm not using a dll version of the CRT, however since I am ("Multi-threaded DLL (/MD)" for release) this cant be the problem, so must be somewhere else...
MYSQLPP_EXPORT is defined as "__declspec(dllexport)"
Compiler command line, I made some of the paths shorter for readability, however all the flags etc are the same.
/O2 /Oi /GL /I "C:SQLMySQL 5.0include" /I "C:SQLMySQL 5.0mysql++-3.0.9lib" /D "NDEBUG" /D "_WIN32" /D "_MBCS" /FD /EHsc /MD /Gy /Yu"precompiled.h" /Fp"C:...server.pch" /Fo"C:..." /Fd"C:...vc90.pdb" /W3 /nologo /c /Zi /TP /errorReport:prompt
And for a MySQL++ example.
/Od /I "C:SQLMySQL 5.0include" /I "..lib" /D "_CONSOLE" /D "UNICODE" /D "_UNICODE" /FD /EHsc /MD /Fo"C:SQLMySQL 5.0mysql++-3.0.9vc2008Releasesimple1" /Fd"C:SQLMySQL 5.0mysql++-3.0.9vc2008Releasesimple1.pdb" /W3 /nologo /c /TP /errorReport:prompt
The obvious thing to me seems to be that I'm not using a dll version of the CRT, however since I am ("Multi-threaded DLL (/MD)" for release) this cant be the problem, so must be somewhere else...
1>c:sqlmysql 5.0mysql++-3.0.9libqparms.h(49) : warning C4275: non dll-interface
class 'std::_Container_base_aux' used as base for dll-interface class 'std::_Container_base_aux_alloc_real<_Alloc>'
This is a warning we ignore safely along with C4251 when dealing with code that sends STL across DLL boundaries. The warning is letting you know that if the other dll was built with some other STL version (which it can't figure out off hand) than the footprint of the class is going to differ between the imported/exported versions of the class.
I know you are using VS 2008, but MSDN seems to hint that for 2005 your exact situation can be safely ignored:
C4275 can be ignored in Microsoft Visual C++ 2005 if you are deriving from a type in the Standard C++ Library, compiling a debug release (/MTd) and where the compiler error message refers to _Container_base.
Notice the reference to "debug release" and _Container_base
链接地址: http://www.djcxy.com/p/27952.html上一篇: Debug.Assert()已停止在我的项目中工作
下一篇: 带有发布配置的MySQL ++编译器警告