From cmusch at gmx.at Wed May 4 11:19:58 2022 From: cmusch at gmx.at (Friedrich Haven) Date: Wed May 4 11:16:08 2022 Subject: Aw: Re: [odb-users] strategies for dealing with blocking behaviour (postgresql) In-Reply-To: References: Message-ID: Hi, sorry for the late reply. We have settled now on a way to deal with the situation, which I want to outline below for reference of future readers. > While we are not against supporting non-blocking API in principle, > I am not sure the amount of complexity the inversion of control will > introduce will be justifiable in this case (AFAIR, you are the first > asking for such a feature). Actually I would have been surprised to learn about such plans, given the amount of questions this would raise. But still I needed to ask :) What we actually want to achieve is to have a blocking API, but returning from a blocking call (unsuccessfully) if a database failover happens (so a database reconnect can be triggered). We now achieve this with the help of two threads (in addition to the main thread): - a "worker thread" which interacts with the database, and calls blocking ODB functions. The main thread dispatches every single DB operation into this worker thread, and waits on a condition variable until the work has been done or a failover is detected. - a "monitoring thread" which checks the health / identity of the database. In case a failover is detected, this monitoring thread also wakes the main thread via the CV. If a failover is detected, the still blocking worker thread is put into a "zombie state" and replaced with a new thread, ready to establish a new connection. In the end, the zombie thread will finish and be cleaned up. Of course this is an elaborate and brittle solution, we are not super-happy about it, but that is the best we came up with... looking forward to your thoughts christian From boris at codesynthesis.com Mon May 9 08:51:07 2022 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon May 9 08:47:08 2022 Subject: [odb-users] strategies for dealing with blocking behaviour (postgresql) In-Reply-To: References: Message-ID: Friedrich Haven writes: > We have settled now on a way to deal with the situation, which I want to > outline below for reference of future readers. Thanks, appreciated. > What we actually want to achieve is to have a blocking API, but > returning from a blocking call (unsuccessfully) if a database failover > happens (so a database reconnect can be triggered). > > We now achieve this with the help of two threads (in addition to the > main thread): > > - a "worker thread" which interacts with the database, and calls > blocking ODB functions. The main thread dispatches every single DB > operation into this worker thread, and waits on a condition variable > until the work has been done or a failover is detected. > > - a "monitoring thread" which checks the health / identity of the > database. In case a failover is detected, this monitoring thread > also wakes the main thread via the CV. > > If a failover is detected, the still blocking worker thread is put > into a "zombie state" and replaced with a new thread, ready to > establish a new connection. In the end, the zombie thread will finish > and be cleaned up. Hm, I believe in case of PG, given a connection handle (which you can obtain from the odb::pgsql::connection object) you can get hold of the underlying socket file descriptor (fd). Based on that, I wonder if you could get way with just the monitoring thread by having it close the underlying fd if it detects a failover. I believe (but haven't tested myself), in this case the blocked main thread will by unblocked with the connection_lost exception. The ODB connection_factory interface should be flexible enough to allow you do arrange for this (i.e., "register" an active connection with the monitoring thread) without having any special calls in the main thread. If you decide to give it a try, I would appreciate a note on how it panned out. From sebastian.groth at enervision.de Wed May 11 08:46:10 2022 From: sebastian.groth at enervision.de (Sebastian Groth) Date: Wed May 11 09:12:03 2022 Subject: [odb-users] possible regression in odb 2.5 beta with composite values Message-ID: We discovered the following issue in odb 2.5: When composite values are used in views, wrong column names are being generated for select statements. Using example from the documentation (removed undescores as we do not append them to members): #pragma db value class Name { ... std::string first; std::string last; }; #pragma db object class Person { ... #pragma db id auto unsigned long id; ??Name name; }; #pragma db view table("Person") class ViewPerson { ? ? ... ? ? ?#pragma db column("name") ? ? ?Name name; }; This will generate a table with the columns: id, name_first, name_last odb 2.4 generates a select statement for the view with column names name_first and name_last odb 2.5 generates a?select statement for the view with column names namefirst and namelast The missing underscores cause database exception, because the columns do not exist. Mit freundlichen Gr??en Sebastian Groth -------------------------------------------- sebastian.groth@enervision.de enervision GmbH Lothringer Str. 53, D-52070 Aachen Tel +49-241-51568-16 Fax +49-241-51568-29 Amtsgericht Aachen, HRB 7577 Gesch?ftsf?hrer: Christian M?llering From boris at codesynthesis.com Thu May 12 01:46:38 2022 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu May 12 01:42:37 2022 Subject: [odb-users] possible regression in odb 2.5 beta with composite values In-Reply-To: References: Message-ID: Sebastian Groth writes: > #pragma db value > class Name > { > std::string first; > std::string last; > }; > > #pragma db object > class Person > { > #pragma db id auto > unsigned long id; > > Name name; > }; > > > #pragma db view table("Person") > class ViewPerson > { > #pragma db column("name") > Name name; > }; > > This will generate a table with the columns: id, name_first, name_last > > odb 2.4 generates a select statement for the view with column names name_first and name_last > odb 2.5 generates a select statement for the view with column names namefirst and namelast This is actually a bug fix[1] that makes the column name derivation consistent across objects and views. Consider how the two versions behave if you add an explicit column prefix in Person: #pragma db object class Person { #pragma db id auto unsigned long id; #pragma db column("name") Name name; }; To fix your original example would need to add the underscore in ViewPerson: #pragma db view table("Person") class ViewPerson { #pragma db column("name_") Name name; }; [1] https://scm.codesynthesis.com/cgit/odb/odb/commit/?id=de130e93d8b2c026732211e67b6f31157f1b7e87 From luca.paganotti at gmail.com Fri May 13 09:13:16 2022 From: luca.paganotti at gmail.com (luca paganotti) Date: Fri May 13 09:09:59 2022 Subject: [odb-users] odb on windows platform Message-ID: Hi all, I'm trying to setup a development environment to use odb compiler possibly with boost profile and date-time profile an to connect to MS Sql Server databases. I'm using VisualStudio 2019. I would like to build for 32 bit and 64 bit architecture. I woud like to use boost 1.78. I downloaded libodb-2.4.0.zip, libodb-boost-2.4.0.zip, libodb-mssql-2.4.0.zip and odb-2.4.0-i686-windows.zip. All these files were decompressed at the same directory folder level and each one of them in a proper subfolder. Let's say that subfolders libodb-2.4.0, libodb-boost-2.4.0, libodb-mssql-2.4.0 are all in c:\root folder and that the boost distribution is in C:\root\boost_1_78_0\x32 for the x32 boost distribution and C:\root\boost_1_78_0\x64 for the x64 one, each one with the usual folder tree. I wrote a simple .hxx file containing the definition of a db object, let's this be karla_entities.hxx When I issue the command from the folder containing the .hxx file: odb.exe --std c++11 -I"C:\root\libodb-2.4.0" -I"C:\root\boost_1_78_0\x32" --database mssql --profile boost/smart-ptr -q -e karla_entities.hxx I got this error: In file included from C:\root\boost_1_78_0\x32/boost/config/detail/select_stdlib_config.hpp:24:0, from C:\root\boost_1_78_0\x32/boost/config.hpp:44, from C:\root\boost_1_78_0\x32/boost/smart_ptr/bad_weak_ptr.hpp:20, from C:\root\boost_1_78_0\x32/boost/smart_ptr/detail/shared_count.hpp:25, from C:\root\boost_1_78_0\x32/boost/smart_ptr/shared_ptr.hpp:17, from C:\root\boost_1_78_0\x32/boost/shared_ptr.hpp:17, from karla_entities.hxx:14: C:\root\libodb-2.4.0/version:1:1: error: too many decimal points in number 2.4.0 ^ and then a bunch of other errors that i can reproduce if needed. Do I need some specific definition (-D ) when calling odb.exe? So my question is: how do I setup a correct environment to be able to use odb.exe and then to link against libodb-2.4.0, libodb-boost-2.4.0 and libodb-mssql-2.4.0? I will try now with the person example that is in the manual. I searched also among the examples in odb-examples-2.4.0.zip but I didn't find any example call to odb.exe in order to generate the "glue" database code. Probably it's a trivial mistake by my side but currently I'm not able to get it. Any help will be appreciated. Thanks. ---------------------------------------------------------------- -- Dott. Ing. Luca Paganotti -- Via Baroffio 4 -- 21040 Vedano Olona (VA) -- 393 1346898 ---------------------------------------------------------------- -- softech s.r.l. email: -- luca.paganotti@softechweb.it -- luca.paganotti@gmail.com -- https://github.com/lucapaganotti -- sourceforge email: -- lucapaganotti@users.sourceforge.net -- skype name: luca.paganotti [image: http://it.linkedin.com/in/lucapaganotti] -- --------------------------------------------------------------- -- Mistakes are portals of discovery - JAAJ --- -------------------------------------------------------------- From luca.paganotti at gmail.com Fri May 13 09:36:53 2022 From: luca.paganotti at gmail.com (luca paganotti) Date: Fri May 13 09:33:35 2022 Subject: [odb-users] Re: odb on windows platform In-Reply-To: References: Message-ID: ok, running odb.exe this way odb.exe --std c++11 -IC:\dev\softech\sara5\saraserver\server\vcc\tools\karla2sara\libs\boost_1_78_0\x32 --profile boost/smart-ptr --database mssql --generate-query --generate-session karla_entities.hxx generates the some files, now I should be able to use karla-entities-odb.?xx in my code and linking against the desired libraries. Sorry for the noise. ---------------------------------------------------------------- -- Dott. Ing. Luca Paganotti -- Via Baroffio 4 -- 21040 Vedano Olona (VA) -- 393 1346898 ---------------------------------------------------------------- -- softech s.r.l. email: -- luca.paganotti@softechweb.it -- luca.paganotti@gmail.com -- https://github.com/lucapaganotti -- sourceforge email: -- lucapaganotti@users.sourceforge.net -- skype name: luca.paganotti [image: http://it.linkedin.com/in/lucapaganotti] -- --------------------------------------------------------------- -- Mistakes are portals of discovery - JAAJ --- -------------------------------------------------------------- On Fri, May 13, 2022 at 3:13 PM luca paganotti wrote: > Hi all, > > I'm trying to setup a development environment to use odb compiler possibly > with boost profile and date-time profile an to connect to MS Sql Server > databases. I'm using VisualStudio 2019. I would like to build for 32 bit > and 64 bit architecture. > > I woud like to use boost 1.78. > > I downloaded libodb-2.4.0.zip, libodb-boost-2.4.0.zip, > libodb-mssql-2.4.0.zip and odb-2.4.0-i686-windows.zip. > All these files were decompressed at the same directory folder level and > each one of them in a proper subfolder. > > Let's say that subfolders libodb-2.4.0, libodb-boost-2.4.0, > libodb-mssql-2.4.0 are all in c:\root folder and that the boost > distribution is in C:\root\boost_1_78_0\x32 for the x32 boost distribution > and C:\root\boost_1_78_0\x64 for the x64 one, each one with the > usual folder tree. > > I wrote a simple .hxx file containing the definition of a db object, let's > this be karla_entities.hxx > > When I issue the command from the folder containing the .hxx file: > > odb.exe --std c++11 -I"C:\root\libodb-2.4.0" -I"C:\root\boost_1_78_0\x32" > --database mssql --profile boost/smart-ptr -q -e karla_entities.hxx > > I got this error: > > In file included from > C:\root\boost_1_78_0\x32/boost/config/detail/select_stdlib_config.hpp:24:0, > from C:\root\boost_1_78_0\x32/boost/config.hpp:44, > from > C:\root\boost_1_78_0\x32/boost/smart_ptr/bad_weak_ptr.hpp:20, > from > C:\root\boost_1_78_0\x32/boost/smart_ptr/detail/shared_count.hpp:25, > from > C:\root\boost_1_78_0\x32/boost/smart_ptr/shared_ptr.hpp:17, > from C:\root\boost_1_78_0\x32/boost/shared_ptr.hpp:17, > from karla_entities.hxx:14: > C:\root\libodb-2.4.0/version:1:1: error: too many decimal points in number > 2.4.0 > ^ > > and then a bunch of other errors that i can reproduce if needed. Do I need > some specific definition (-D ) when calling odb.exe? > > So my question is: how do I setup a correct environment to be able to use > odb.exe and then to link against libodb-2.4.0, libodb-boost-2.4.0 and > libodb-mssql-2.4.0? > > I will try now with the person example that is in the manual. > > I searched also among the examples in odb-examples-2.4.0.zip but I didn't > find any example call to odb.exe in order to generate the "glue" database > code. Probably it's a trivial mistake by my side but currently I'm not able > to get it. > > Any help will be appreciated. > > Thanks. > > ---------------------------------------------------------------- > -- Dott. Ing. Luca Paganotti > -- Via Baroffio 4 > -- 21040 Vedano Olona (VA) > -- 393 1346898 > ---------------------------------------------------------------- > -- softech s.r.l. email: > -- luca.paganotti@softechweb.it > -- luca.paganotti@gmail.com > -- https://github.com/lucapaganotti > -- sourceforge email: > -- lucapaganotti@users.sourceforge.net > -- skype name: luca.paganotti > [image: http://it.linkedin.com/in/lucapaganotti] > > -- --------------------------------------------------------------- > -- Mistakes are portals of discovery - JAAJ > --- -------------------------------------------------------------- > From luca.paganotti at gmail.com Tue May 17 11:40:59 2022 From: luca.paganotti at gmail.com (luca paganotti) Date: Tue May 17 11:38:58 2022 Subject: [odb-users] MSSQL NUMERIC Message-ID: Hi all, I'm trying to map a NUMERIC(18,0) field in a MSSQL table to some datatype, reading the docs I found that there's no direct mapping, do I have to build my own mapping? Could someone give some hint on how to map this data type? Thanks. ---------------------------------------------------------------- -- Dott. Ing. Luca Paganotti -- Via Baroffio 4 -- 21040 Vedano Olona (VA) -- 393 1346898 ---------------------------------------------------------------- -- softech s.r.l. email: -- luca.paganotti@softechweb.it -- luca.paganotti@gmail.com -- https://github.com/lucapaganotti -- sourceforge email: -- lucapaganotti@users.sourceforge.net -- skype name: luca.paganotti [image: http://it.linkedin.com/in/lucapaganotti] -- --------------------------------------------------------------- -- Mistakes are portals of discovery - JAAJ --- -------------------------------------------------------------- From ratkaisut at gmail.com Wed May 18 03:09:06 2022 From: ratkaisut at gmail.com (Sten Kultakangas) Date: Wed May 18 03:05:18 2022 Subject: [odb-users] MSSQL NUMERIC In-Reply-To: References: Message-ID: Hi If you just access the table and do not use schema creation/migration code, then you can just define NUMERIC(18,0) as "long long" in your C++ code. For example, #pragma db object schema("Foo.dbo") struct Bar { #pragma db id auto long long ID = 0; } The actual type of the ID field can safely be NUMERIC(18,0). In most cases there is no problem in conversion between BIGINT and NUMERIC(18,0). Alternatively, you can implement your own odb::mssql::value_traits, id_decimal> specialization. Best regards, Sten Kultakangas On Tue, May 17, 2022 at 6:43 PM luca paganotti wrote: > Hi all, > > I'm trying to map a NUMERIC(18,0) field in a MSSQL table to some datatype, > reading the docs I found that there's no direct mapping, do I have to > build my own mapping? Could someone give some hint on how to map this data > type? > > Thanks. > > ---------------------------------------------------------------- > -- Dott. Ing. Luca Paganotti > -- Via Baroffio 4 > -- 21040 Vedano Olona (VA) > -- 393 1346898 > ---------------------------------------------------------------- > -- softech s.r.l. email: > -- luca.paganotti@softechweb.it > -- luca.paganotti@gmail.com > -- https://github.com/lucapaganotti > -- sourceforge email: > -- lucapaganotti@users.sourceforge.net > -- skype name: luca.paganotti > [image: http://it.linkedin.com/in/lucapaganotti] > > -- --------------------------------------------------------------- > -- Mistakes are portals of discovery - JAAJ > --- -------------------------------------------------------------- > From tlytle123 at gmail.com Tue May 24 19:15:05 2022 From: tlytle123 at gmail.com (Tyler Lytle) Date: Wed May 25 07:00:54 2022 Subject: [odb-users] Cannot Compile ODB Compiler on RHEL 8.5 Message-ID: Hello, This is my first time using a mailing list so please be gentle. I am trying to compile ODB 2.4.0 (the most recent version listed in the downloads section of the codesynthesis.com website). I downloaded and untarred the odb-2.4.0.tar.gz. In the INSTALL file, it says to ensure that gcc plugin support is enabled. Here is the output to verify that gcc plugin report is enabled: [tlytle@localhost odb-2.4.0]$ g++ -v Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-redhat-linux Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --disable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux Thread model: posix gcc version 8.5.0 20210514 (Red Hat 8.5.0-3) (GCC) The INSTALL directions then say to ensure that the plugin headers are installed. It is normally called something like "gcc-plugin-dev". Looking at the RHEL 8.5 repository, the closest thing that I could find is this: gcc-toolset-11-gcc-plugin-devel-11.2.1-1.1.el8.x86_64 I installed that RPM from the RHEL 8.5 repository. I then run "./configure" and I get the following error: checking whether to install ODB plugin into default GCC plugin directory... no checking for GCC plugin headers... no configure: error: GCC plugin headers not found; consider installing GCC plugin development package Is this a compatibility issue since the INSTALL file is mentioning GCC 4.4 and RHEL 8.5 is on GCC 8.5? Are there any workarounds or should I just use one of the pre-packaged ODB binaries available on the website? Thank you for any help. -- Tyler Lytle E-Mail: tlytle123@gmail.com From boris at codesynthesis.com Wed May 25 07:18:01 2022 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed May 25 07:13:50 2022 Subject: [odb-users] Cannot Compile ODB Compiler on RHEL 8.5 In-Reply-To: References: Message-ID: Tyler Lytle writes: > [tlytle@localhost odb-2.4.0]$ g++ -v > > [...] > > gcc version 8.5.0 20210514 (Red Hat 8.5.0-3) (GCC) > > The INSTALL directions then say to ensure that the plugin headers are > installed. It is normally called something like "gcc-plugin-dev". Looking > at the RHEL 8.5 repository, the closest thing that I could find is > this: gcc-toolset-11-gcc-plugin-devel-11.2.1-1.1.el8.x86_64 > > I installed that RPM from the RHEL 8.5 repository. I then run "./configure" > and I get the following error: > > checking for GCC plugin headers... no Can you run: $ g++ --print-file-name=plugin If that prints a directory, can you check that it contains the include/ subdirectory and a bunch of header files (.h) inside? If this all checks out, then it's most likely GCC 8 is too new for ODB 2.4.0 and I suggest that you try to build the latest pre-release of ODB 2.5.0 (which is known to work with GCC 8) by following these instructions: https://codesynthesis.com/products/odb/doc/install-build2.xhtml From acsvln at disroot.org Thu May 26 05:37:50 2022 From: acsvln at disroot.org (acsvln) Date: Thu May 26 07:22:24 2022 Subject: [odb-users] Got "locally defined symbol imported" with pkg-config and dynamic linking In-Reply-To: <37295df3-d549-248b-165f-51754f371397@disroot.org> References: <37295df3-d549-248b-165f-51754f371397@disroot.org> Message-ID: <1dd7f76d-4b6a-e82e-f133-b5e04f850944@disroot.org> Hello! I am trying to link qmake project with odb lib's dynamically, and stucked with linking process, got lots of warning messages like: A-odb.obj : warning LNK4049: locally defined symbol ??3shared_base@details@odb@@SAXPEAX@Z (public: static void __cdecl odb::details::shared_base::operator delete(void *)) imported B-odb.obj : warning LNK4049: locally defined symbol ??3shared_base@details@odb@@SAXPEAX@Z (public: static void __cdecl odb::details::shared_base::operator delete(void *)) imported C-odb.obj : warning LNK4049: locally defined symbol ??3shared_base@details@odb@@SAXPEAX@Z (public: static void __cdecl odb::details::shared_base::operator delete(void *)) imported My .pro file looks like: ... CONFIG += link_pkgconfig PKGCONFIG += libicuuc.shared libicui18n.shared libodb.shared libodb-qt.shared libodb-sqlite.shared libodb-pgsql.shared libpq.shared libcrypto.shared libssl.shared libz.shared ... i looked at my install folder and found there .lib files and dll.lib lib-files: crypto.dll.lib crypto.lib odb-pgsql.dll.lib odb-pgsql.lib odb-qt.dll.lib odb-qt.lib odb-sqlite.dll.lib odb-sqlite.lib odb.dll.lib odb.lib pq.dll.lib pq.lib sqlite3.dll.lib sqlite3.lib ssl.dll.lib ssl.lib z.dll.lib z.lib Manually checked what pkg-config returns: C:\Windows\System32>pkg-config libodb-pgsql.static --cflags --libs --msvc-syntax -DLIBODB_PGSQL_BUILD2 -DLIBODB_PGSQL_STATIC -IC:\\Temp\\dependencies\\install\\x64\\build2\\libodb-pgsql\\release\\include? /libpath:C:\\Temp\\dependencies\\install\\x64\\build2\\libodb-pgsql\\release\\lib odb-pgsql.lib odb.lib C:\Windows\System32>pkg-config libodb-pgsql.shared --cflags --libs --msvc-syntax -DLIBODB_PGSQL_BUILD2 -DLIBODB_PGSQL_SHARED -IC:\\Temp\\dependencies\\install\\x64\\build2\\libodb-pgsql\\release\\include? /libpath:C:\\Temp\\dependencies\\install\\x64\\build2\\libodb-pgsql\\release\\lib odb-pgsql.lib odb.lib After that, i manually fixed pkg-config files, to link with .dll.lib files? e.x: From: Name: libcrypto Version: 1.1.1+16 Description: C library providing general cryptography and X.509 support URL:https://www.openssl.org/ Cflags: -IC:\\Temp\\dependencies\\install\\x64\\build2\\libodb-pgsql\\release\\include Libs: -LC:\\Temp\\dependencies\\install\\x64\\build2\\libodb-pgsql\\release\\lib -lcrypto To: Name: libcrypto Version: 1.1.1+16 Description: C library providing general cryptography and X.509 support URL:https://www.openssl.org/ Cflags: -IC:\\Temp\\dependencies\\install\\x64\\build2\\libodb-pgsql\\release\\include Libs: -LC:\\Temp\\dependencies\\install\\x64\\build2\\libodb-pgsql\\release\\lib -lcrypto.dll And now it working! Wanna to ask, is that bug and what i must do in my situation? My environment: Windows 10 MSVC: 19.16.27045 Qt: 5.14.2 pkg-config: 0.26, from https://download.gnome.org/binaries/win32/dependencies/ build2-toolchain: 0.14 From boris at codesynthesis.com Thu May 26 08:45:29 2022 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu May 26 08:41:19 2022 Subject: [odb-users] Got "locally defined symbol imported" with pkg-config and dynamic linking In-Reply-To: <1dd7f76d-4b6a-e82e-f133-b5e04f850944@disroot.org> References: <37295df3-d549-248b-165f-51754f371397@disroot.org> <1dd7f76d-4b6a-e82e-f133-b5e04f850944@disroot.org> Message-ID: acsvln writes: > i looked at my install folder and found there .lib files and dll.lib Right, .lib are static libraries and .dll.lib are DLL import libraries. > Manually checked what pkg-config returns: > > C:\Windows\System32>pkg-config libodb-pgsql.static --cflags --libs --msvc-syntax > > -DLIBODB_PGSQL_BUILD2 -DLIBODB_PGSQL_STATIC -IC:\\Temp\\dependencies\\install\\x64\\build2\\libodb-pgsql\\release\\include? /libpath:C:\\Temp\\dependencies\\install\\x64\\build2\\libodb-pgsql\\release\\lib odb-pgsql.lib odb.lib > > C:\Windows\System32>pkg-config libodb-pgsql.shared --cflags --libs --msvc-syntax > > -DLIBODB_PGSQL_BUILD2 -DLIBODB_PGSQL_SHARED -IC:\\Temp\\dependencies\\install\\x64\\build2\\libodb-pgsql\\release\\include? /libpath:C:\\Temp\\dependencies\\install\\x64\\build2\\libodb-pgsql\\release\\lib odb-pgsql.lib odb.lib > > > After that, i manually fixed pkg-config files, to link with .dll.lib files > e.x: > From: > > [...] > > Libs: -LC:\\Temp\\dependencies\\install\\x64\\build2\\libodb-pgsql\\release\\lib -lcrypto > > To: > > [...] > > Libs: -LC:\\Temp\\dependencies\\install\\x64\\build2\\libodb-pgsql\\release\\lib -lcrypto.dll > > > And now it working! > > Wanna to ask, is that bug and what i must do in my situation? Good question (and nice investigation). I think my answer is that the translation of the UNIX-centric pkg-config semantics to Windows is under-specified and, as a result, different build systems translate the UNIX model to Windows in their own ways. Especially the part on how the same .pc file maps to static/shared libraries. In case of build2, we always put a UNIX-style -l into the .pc file and leave it to the build system to map it to the concrete static or shared library, or both, depending on what's available on the file system. Also, on Windows, we've decided to follow the MinGW lead and name import libraries as .dll.lib so that they can co-exist in the same directory, similar to UNIX. As a result, a build system that doesn't follow the same mapping, will unfortunately have a difficult time using build2-generated .pc files. As for what to do, the only two options that I can think of are to fixup the .pc files like you did (maybe with a help of a script) or to not use the .pc files at all (i.e., install everything into a single location and manually provide the necessary -I/-L options plus, potentially, additional libraries to link). Well, I guess there is a third options: switch from qmake to build2 ;-).