coin-or / CppAD

A C++ Algorithmic Differentiation Package: Home Page
https://cppad.readthedocs.io
Other
446 stars 94 forks source link

Fix build issue with LoadLibrary on windows when building with UNICODE #168

Closed walbourn closed 1 year ago

walbourn commented 1 year ago

Per the UTF-8 Everywhere Manifesto, it's best to not rely on the legacy ANSI .vs UNICODE macros for Win32 functions that take strings. Since you explicitly use a const char* for the call to LoadLibrary you should explicitly use the LoadLibraryA method.

This causes problems when trying to build your library using vcpkg manager when the setup adds the recommended UNICODE _UNICODE defines.

CLAassistant commented 1 year ago

CLA assistant check
All committers have signed the CLA.