Fix linking error due to __ImageBase when using MSYS2

__ImageBase should be declared outside of any (even anonymous)
namespaces, otherwise its name is getting mangled even in spite of it
being extern "C".

Closes #1266.
This commit is contained in:
Robert Adam
2025-08-13 17:49:34 +02:00
committed by Vadim Zeitlin
parent ce348126e7
commit 09f0cebc95

View File

@@ -23,6 +23,8 @@ using namespace soci::dynamic_backends;
#include <windows.h>
extern "C" IMAGE_DOS_HEADER __ImageBase;
namespace
{
@@ -44,8 +46,6 @@ private:
typedef HMODULE soci_dynlib_handle_t;
extern "C" IMAGE_DOS_HEADER __ImageBase;
std::string get_this_dynlib_path()
{
std::string path;