-
Notifications
You must be signed in to change notification settings - Fork 484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SOCI doesn't compile when using the UNICODE
flag on Windows
#1111
Comments
Why do you need to compile SOCI itself with |
I tried undefining In any case I was wondering whether it would make sense for SOCI to deal with this somehow - even if it is only a check whether this macro is defined and emitting an error stating that compiling SOCI with |
FWIW I agree that the simplest fix would be to use |
This should solve the problem. |
When defining the
UNICODE
preprocessor flag when compiling on Windows, SOCI fails to compile. The reason being that this flag causes functions calls to the Windows API that don't explicitly use theA
(Ansi) orW
(wide-string, aka: "unicode") flavor to switch to the latter and SOCI seems to expect to use the former.I guess the easiest fix would be to simply be explicit about using the
A
variants of functions such asLoadLibrary
(LoadLibraryA
).However, this wouldn't account for everything as e.g. ODBC seems to also take this setting into account causing it to use
SQLWCHAR
instead ofSQLCHAR
which then causes further compile errors.Maybe explicitly un-defining
UNICODE
in the affected source files might be enough to revert back to normal behavior?Another option would be to make
SOCI
itself adapt this "unicode"-weirdness (on Windows) and switch to wide-charracter representations. However, I think this is probably the least desirable way forward 👀The text was updated successfully, but these errors were encountered: