SOCI / soci

Official repository of the SOCI - The C++ Database Access Library
http://soci.sourceforge.net/
Boost Software License 1.0
1.41k stars 477 forks source link

SOCI_DEBUG_POSTFIX not work at linux/macos #1003

Closed hgyxbll closed 1 year ago

hgyxbll commented 1 year ago

when set SOCI_DEBUG_POSTFIX at linux/macos, it will Failed to find shared library for backend sqlite3.

cause: at source backend-loader.cpp:

#ifdef _WIN32   ->only win32 will add SOCI_DEBUG_POSTFIX
  #ifndef NDEBUG
    #define LIBNAME(x) (SOCI_LIB_PREFIX + x + "_" SOCI_ABI_VERSION SOCI_DEBUG_POSTFIX SOCI_LIB_SUFFIX)
  #else
    #define LIBNAME(x) (SOCI_LIB_PREFIX + x + "_" SOCI_ABI_VERSION SOCI_LIB_SUFFIX)
  #endif
#else   -> other os not add SOCI_DEBUG_POSTFIX
#ifdef __APPLE__
#define LIBNAME(x) (SOCI_LIB_PREFIX + x + "." SOCI_ABI_VERSION SOCI_LIB_SUFFIX)
#else
#define LIBNAME(x) (SOCI_LIB_PREFIX + x + SOCI_LIB_SUFFIX "." SOCI_ABI_VERSION)
#endif
#endif
vadz commented 1 year ago

Sorry for the obvious question but why do you set SOCI_DEBUG_POSTFIX for non-Windows systems when it only makes sense for Windows?

I.e. something probably should be improved/fixed there, but the simplest thing to do right now is to just not set it there.

hgyxbll commented 1 year ago

I want to debug soci when use it. so I build debug version and install to /usr/local/lib to test. when publish, i will build release version, than install to /usr/local/lib to test. they are conflict. So if not use SOCI_DEBUG_POSTFIX, how can meet these two requirements?

vadz commented 1 year ago

There is no support for installing multiple versions of SOCI in parallel under Unix. You need to either use different installation prefixes or use it without installing it at all. In any case, the debug suffix thing is Windows-specific and doesn't make any sense under Unix, so it won't be ever supported there.