[fdo-internals] Please review: VS 2015 migration - Generic Rdbms provider
Karsten Winter
karsten.winter at autodesk.com
Tue Aug 18 08:08:57 PDT 2015
Hi all
I'm currently migrating the projects to Visual Studio 2015.
Some errors occur with the new compiler for which I would like to get a review for the solution. The third part is about FDO generic Rdbms provider.
Providers\GenericRdbms\Src\UnitTest\Common\FdoUpdateTest.cpp
Providers\GenericRdbms\Src\UnitTest\Common\MessageTest.cpp
Error:
The concatenation of adjacent wide or raw string literals (L"Hello"L"World") will require a space to be inserted (L"Hello" L"World"), because the prefix for the second string is now treated as a user-defined literal suffix.
Solution:
-> add spaces between concatenated strings
Providers\GenericRdbms\Src\Fdo\stdafx.h
error C2338: <hash_map> is deprecated and will be REMOVED. Please use <unordered_map>. You can define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS to acknowledge that you have received this warning
Solution:
-> remove include of no required <hash_map>
Providers\GenericRdbms\Src\Fdo\Connection\FdoRdbmsConnection.cpp
error C2137: The illegal empty character constant L'' was used.
Solution:
-> Instantiate the wchar_t string with L"" instead of the first character with L''
Providers\GenericRdbms\Src\Util\trace.cpp
error C2065: 'PATH_MAX': undeclared identifier
Solution:
-> PATH_MAX is not defined anymore in VC++ 2015
-> Add a new header file which contains this new constant (\Fdo\Unmanaged\Inc\Common\FdoLimits.h)
-> see "limits.h" from VC++ 2012
-> add additional inlcude path "(FDO)/Unmanaged/Inc" to the project
Providers\GenericRdbms\Src\ODBC\Odbc.vcxproj
Providers\GenericRdbms\Src\UnitTest\UnitTestOdbc.vcxproj
(odbccp32.lib(dllload.obj) : error LNK2019: unresolved external symbol _vsnwprintf_s referenced in function StringCchPrintfW)
This is a breaking change in the Visual C++ runtime libraries in Visual Studio 2015. Mixing-and-matching object files compiled with different major versions of the Visual C++ libraries headers is not supported.
For several releases, the STL headers have enforced this via a #pragma detect_mismatch. The CRT headers have not enforced this, but it is nonetheless not supported.
In general, in cases where you want to support multiple major versions of Visual C++, we advise building libraries into DLLs in order to encapsulate CRT dependencies.
_vsnwprintf_s and other functions are not exported in appcrt140.dll, breaking linkage of static libraries. Add new library "legacy_stdio_definitions.lib" until it's fixed
https://connect.microsoft.com/VisualStudio/feedback/details/1134693/vs-2015-ctp-5-c-vsnwprintf-s-and-other-functions-are-not-exported-in-appcrt140-dll-breaking-linkage-of-static-libraries
Solution:
-> Add new library "legacy_stdio_definitions.lib"
Best regards
Karsten
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/fdo-internals/attachments/20150818/2ff00a05/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Providers_GenericRdbms_Src_UnitTest_Common_MessageTest.cpp.patch
Type: application/octet-stream
Size: 687 bytes
Desc: Providers_GenericRdbms_Src_UnitTest_Common_MessageTest.cpp.patch
URL: <http://lists.osgeo.org/pipermail/fdo-internals/attachments/20150818/2ff00a05/attachment-0007.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Providers_GenericRdbms_Src_UnitTest_Common_FdoUpdateTest.cpp.patch
Type: application/octet-stream
Size: 1053 bytes
Desc: Providers_GenericRdbms_Src_UnitTest_Common_FdoUpdateTest.cpp.patch
URL: <http://lists.osgeo.org/pipermail/fdo-internals/attachments/20150818/2ff00a05/attachment-0008.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Providers_GenericRdbms_Src_Fdo_stdafx.h.patch
Type: application/octet-stream
Size: 259 bytes
Desc: Providers_GenericRdbms_Src_Fdo_stdafx.h.patch
URL: <http://lists.osgeo.org/pipermail/fdo-internals/attachments/20150818/2ff00a05/attachment-0009.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Providers_GenericRdbms_Src_Fdo_Connection_FdoRdbmsConnection.cpp.patch
Type: application/octet-stream
Size: 386 bytes
Desc: Providers_GenericRdbms_Src_Fdo_Connection_FdoRdbmsConnection.cpp.patch
URL: <http://lists.osgeo.org/pipermail/fdo-internals/attachments/20150818/2ff00a05/attachment-0010.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Providers_GenericRdbms_Src_Util_trace.cpp.patch
Type: application/octet-stream
Size: 4404 bytes
Desc: Providers_GenericRdbms_Src_Util_trace.cpp.patch
URL: <http://lists.osgeo.org/pipermail/fdo-internals/attachments/20150818/2ff00a05/attachment-0011.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Providers_GenericRdbms_Src_ODBC_Odbc.vcxproj.patch
Type: application/octet-stream
Size: 6376 bytes
Desc: Providers_GenericRdbms_Src_ODBC_Odbc.vcxproj.patch
URL: <http://lists.osgeo.org/pipermail/fdo-internals/attachments/20150818/2ff00a05/attachment-0012.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Providers_GenericRdbms_Src_UnitTest_UnitTestOdbc.vcxproj.patch
Type: application/octet-stream
Size: 9731 bytes
Desc: Providers_GenericRdbms_Src_UnitTest_UnitTestOdbc.vcxproj.patch
URL: <http://lists.osgeo.org/pipermail/fdo-internals/attachments/20150818/2ff00a05/attachment-0013.obj>
More information about the fdo-internals
mailing list