diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2023-02-24 11:38:03 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2023-02-24 17:05:49 +0000 |
commit | 3fc2c054c505b8c99c3f8e64561de242bcd7d3b3 (patch) | |
tree | 220b287e6957e97f448c693336086ee261425d27 /dbaccess | |
parent | 1786ddbde4b44575321aa6b9d9d367a964969063 (diff) |
Fix build in a specific VS2022 environment
Building Executable_odbcconfig using VS2022 failed for me reproducibly
for some time, with
mt.exe : general error c101008d: Failed to write the updated manifest to the resource of file "C:/lo/src/build/instdir/program/odbcconfig.exe". The file or directory is corrupted and unreadable.
make[1]: *** [C:/lo/src/core/dbaccess/Executable_odbcconfig.mk:10: C:/lo/src/build/instdir/program/odbcconfig.exe] Error 139
It is caused by linking odbccp32, and legacy_stdio_definitions required
by the latter with current versions of UCRT.
It seems to work OK for others; but being unable to find what's different
on my system, I have this workaround, using run-time loading instead.
Change-Id: Iab1fe7747ca6e677d89a120778ca805465a05611
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147627
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/Executable_odbcconfig.mk | 5 | ||||
-rw-r--r-- | dbaccess/win32/source/odbcconfig/odbcconfig.cxx | 12 |
2 files changed, 6 insertions, 11 deletions
diff --git a/dbaccess/Executable_odbcconfig.mk b/dbaccess/Executable_odbcconfig.mk index 862c77b3b5af..2156128469e3 100644 --- a/dbaccess/Executable_odbcconfig.mk +++ b/dbaccess/Executable_odbcconfig.mk @@ -15,11 +15,6 @@ $(eval $(call gb_Executable_use_libraries,odbcconfig,\ comphelper \ )) -$(eval $(call gb_Executable_use_system_win32_libs,odbcconfig,\ - legacy_stdio_definitions \ - odbccp32 \ -)) - $(eval $(call gb_Library_use_sdk_api,odbcconfig)) $(eval $(call gb_Executable_add_exception_objects,odbcconfig,\ diff --git a/dbaccess/win32/source/odbcconfig/odbcconfig.cxx b/dbaccess/win32/source/odbcconfig/odbcconfig.cxx index 0cc48725c5e1..127d840c839e 100644 --- a/dbaccess/win32/source/odbcconfig/odbcconfig.cxx +++ b/dbaccess/win32/source/odbcconfig/odbcconfig.cxx @@ -18,11 +18,9 @@ */ -#if !defined WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -#endif -#include <windows.h> -#include <odbcinst.h> +#include <sal/config.h> + +#include <systools/win32/odbccp32.hxx> // displays the error text for the last error (GetLastError), and returns this error value static int displayLastError() @@ -102,7 +100,9 @@ extern "C" int APIENTRY wWinMain( HINSTANCE _hAppInstance, HINSTANCE, LPWSTR, in if ( !IsWindow( hAppWindow ) ) return displayLastError(); - if (!SQLManageDataSources(hAppWindow)) + // Have a odbccp32 variable, to not call FreeLibrary before displayLastError + sal::systools::odbccp32 odbccp32; + if (!odbccp32.SQLManageDataSources(hAppWindow)) return displayLastError(); return 0; |