Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » libpq-fe.h in Alpine Linux
libpq-fe.h in Alpine Linux [message #55654] Sat, 28 November 2020 04:40 Go to next message
Novo is currently offline  Novo
Messages: 1363
Registered: December 2006
Ultimate Contributor
libpq-fe.h in Alpine Linux is located in /usr/include.
This means it has to be included via #include <libpq-fe.h>.
Current POSIX version looks like #include <postgresql/libpq-fe.h>.
This breaks compilation.
It would be great to get this fixed.

TIA


Regards,
Novo
Re: libpq-fe.h in Alpine Linux [message #55661 is a reply to message #55654] Sat, 28 November 2020 18:38 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1363
Registered: December 2006
Ultimate Contributor
__GNU_LIBRARY__ is undefined in Alpine Linux.

Regards,
Novo
Re: libpq-fe.h in Alpine Linux [message #55688 is a reply to message #55661] Mon, 30 November 2020 17:22 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1363
Registered: December 2006
Ultimate Contributor
This is the only problem with Alpine Linux. It can be easily fixed with the code below.
#ifdef __GNU_LIBRARY__
#include <postgresql/libpq-fe.h>
#else
#include <libpq-fe.h>
#endif

Instead of
#ifdef PLATFORM_WIN32
#include <libpq-fe.h>
#elif defined(PLATFORM_POSIX)
#include <postgresql/libpq-fe.h>
#endif


TIA


Regards,
Novo
Re: libpq-fe.h in Alpine Linux [message #55689 is a reply to message #55661] Mon, 30 November 2020 18:15 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13984
Registered: November 2005
Ultimate Member
Novo wrote on Sat, 28 November 2020 18:38
__GNU_LIBRARY__ is undefined in Alpine Linux.


OH, ok, but I feel a bit uneasy to rely on that...

Interesting that pkg-config does not work...

Mirek
Re: libpq-fe.h in Alpine Linux [message #55690 is a reply to message #55689] Mon, 30 November 2020 18:40 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1363
Registered: December 2006
Ultimate Contributor
[quote title=mirek wrote on Mon, 30 November 2020 12:15]Novo wrote on Sat, 28 November 2020 18:38

Interesting that pkg-config does not work...

Mirek

IMHO, the problem is unrelated to pkg-config. pkg-config doesn't fix cpp code ...
And __GNU_LIBRARY__ is undefined because Alpine doesn't use glibc ...


Regards,
Novo
Re: libpq-fe.h in Alpine Linux [message #55693 is a reply to message #55689] Mon, 30 November 2020 19:42 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1363
Registered: December 2006
Ultimate Contributor
mirek wrote on Mon, 30 November 2020 12:15

Interesting that pkg-config does not work...

Actually, pkg-config works just fine. I just double-checked that.
I do not need to add an include path and a library to a build method.


Regards,
Novo
Re: libpq-fe.h in Alpine Linux [message #55694 is a reply to message #55693] Mon, 30 November 2020 20:17 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1363
Registered: December 2006
Ultimate Contributor
Useful c++17 feature: __has_include Preprocessor Expression

Regards,
Novo
Re: libpq-fe.h in Alpine Linux [message #55701 is a reply to message #55693] Tue, 01 December 2020 18:23 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13984
Registered: November 2005
Ultimate Member
Novo wrote on Mon, 30 November 2020 19:42
mirek wrote on Mon, 30 November 2020 12:15

Interesting that pkg-config does not work...

Actually, pkg-config works just fine. I just double-checked that.
I do not need to add an include path and a library to a build method.


So maybe we just need to change to

#include <libpq-fe.h>

everywhere?

Mirek
Re: libpq-fe.h in Alpine Linux [message #55702 is a reply to message #55701] Tue, 01 December 2020 18:34 Go to previous message
Novo is currently offline  Novo
Messages: 1363
Registered: December 2006
Ultimate Contributor
mirek wrote on Tue, 01 December 2020 12:23

So maybe we just need to change to

#include <libpq-fe.h>

everywhere?

Mirek

I checked that in Ubuntu.
It works Smile
IMHO, we should do that.


Regards,
Novo
Previous Topic: Changing Database [Solved]
Next Topic: Some queries return incorrect datatypes with SqLite
Goto Forum:
  


Current Time: Thu Jun 13 19:46:39 CEST 2024

Total time taken to generate the page: 0.02640 seconds