[odb-users] Warnings in Visual Studio 2015
Boris Kolpackov
boris at codesynthesis.com
Sun Jan 17 09:18:06 EST 2016
Hi Marcel,
Marcel Nehring <mne at qosmotec.com> writes:
> when compiling code that uses ODB 2.4.0 with Visual Studio 2015 one gets
> many warnings like:
>
> C4275 non - DLL-interface classkey class "std::exception" used as base
> for DLL-interface classkey struct "odb::exception" \odb\exception.hxx 19
I did some research[1] and apparently in VS 2015 std::exception is no
longer exported. Can you add the following two lines at the end of
libodb/odb/compilers/vc/pre.hxx and see if that helps:
#pragma warning (disable:4275) // "C4251 is essentially noise and can be
// silenced" - Stephan T. Lavavej
> Furthermore when linking everything together I get the warning
>
> LNK4006 __NULL_IMPORT_DESCRIPTOR already defined in "odb-d.lib(odb-d.dll);
> second definition ignored. odb-oracle-d.lib(odb-oracle-d.dll) 1
This one is strange. Apparently[2][3], it is issued if you link a static
library twice though I don't see how this can happen here (there are no
static libraries involved). Also your error looks quite a bit different
compared to theirs. Can you send the complete linker command line (from
Projects->...->Linker Command Line) as well as the complete diagnostics
output? I don't even know what is being linked here: odb-oracle-d.dll,
your application, something else..?
[1] http://stackoverflow.com/questions/24511376/how-to-dllexport-a-class-derived-from-stdruntime-error
[2] http://stackoverflow.com/questions/24103488/lnk4006-lnk4221-warnings-when-using-static-library-that-includes-another-static
[3] https://social.msdn.microsoft.com/forums/windowsapps/en-us/5d79a108-6516-42d9-9626-05c622d2a007/want-to-fix-a-linker-warning
Boris
More information about the odb-users
mailing list