Compiling spatialite-gui: problems with libpq-fe.h

38 views
Skip to first unread message

Tobias Schula

unread,
Feb 23, 2025, 8:08:48 AMFeb 23
to SpatiaLite Users
Hi everyone,

I'm trying to compile spatialite-gui on an up-to-date Tumbleweed installation. Opensuse provides all the dependencies, I just had to compile librasterlite2 and VirtualPG. 

Now, `configure` runs into a warning:
> checking for pg_config... /usr/bin/pg_config
> checking libpq-fe.h usability... yes
> checking libpq-fe.h presence... no
> configure: WARNING: libpq-fe.h: accepted by the compiler, rejected by the preprocessor!
> configure: WARNING: libpq-fe.h: proceeding with the compiler's result
> checking for libpq-fe.h... yes

And make fails:
> g++ -DHAVE_CONFIG_H -I.  -g -O2  -I/usr/include/pgsql -DOPENSSL_LOAD_CONF -I.   -I/usr/lib64/wx/include/gtk3-unicode-3.2 -I/usr/include/wx-3.2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE
_SOURCE= -DWXUSINGDLL -D__WXGTK__ -pthread -MT Dialogs.o -MD -MP -MF .deps/Dialogs.Tpo -c -o Dialogs.o Dialogs.cpp
> Dialogs.cpp: In member function ‘void LoadZipDbfDialog::LoadPKFields()’:
> Dialogs.cpp:2321:24: error: cannot convert ‘wxString’ to ‘const char*
> 2321 |   dbf = gaiaOpenZipDbf(ZipPath, filename, charset, "UTF-8");
>      |                        ^~~~~~~
>      |                        |
>      |                        wxString
> In file included from /usr/include/spatialite/gaiageo.h:72,
>                 from Classdef.h:48,
>                 from Dialogs.cpp:26:
> /usr/include/spatialite/gg_formats.h:1737:60: note:   initializing argument 1 of ‘gaiaDbf* gaiaOpenZipDbf(const char*, const char*, const char*, const char*)’
> 1737 |     GAIAGEO_DECLARE gaiaDbfPtr gaiaOpenZipDbf (const char *zip_path,
>      |                                                ~~~~~~~~~~~~^~~~~~~~
> Dialogs.cpp: In member function ‘void LoadZipShpDialog::LoadPKFields()’:
> Dialogs.cpp:3345:24: error: cannot convert ‘wxString’ to ‘const char*
> 3345 |   dbf = gaiaOpenZipDbf(ZipPath, dbf_name, charset, "UTF-8");
>      |                        ^~~~~~~
>      |                        |
>      |                        wxString
> /usr/include/spatialite/gg_formats.h:1737:60: note:   initializing argument 1 of ‘gaiaDbf* gaiaOpenZipDbf(const char*, const char*, const char*, const char*)’
> 1737 |     GAIAGEO_DECLARE gaiaDbfPtr gaiaOpenZipDbf (const char *zip_path,
     |                                                ~~~~~~~~~~~~^~~~~~~~
> make[2]: *** [Makefile:632: Dialogs.o] Fehler 1

Is it a problem with the libraries provided by Opensuse, do I need to pass some additional arguments to `configure` or did I something else wrong?


Best regards

Tobias

a.fu...@lqt.it

unread,
Feb 23, 2025, 10:19:38 AMFeb 23
to spatiali...@googlegroups.com
On Sat, 22 Feb 2025 23:36:45 -0800 (PST), Tobias Schula wrote:
> Hi everyone,
>
> I'm trying to compile spatialite-gui on an up-to-date Tumbleweed
> installation. Opensuse provides all the dependencies, I just had to
> compile librasterlite2 and VirtualPG. 
>
> Now, `configure` runs into a warning:
>> checking for pg_config... /usr/bin/pg_config> checking libpq-fe.h
> usability... yes
>> checking libpq-fe.h presence... no
>> configure: WARNING: libpq-fe.h: accepted by the compiler, rejected
> by the preprocessor!
>> configure: WARNING: libpq-fe.h: proceeding with the compiler's
> result
>> checking for libpq-fe.h... yes
>

Hi Tobias,

this is not an error, it's simply a completely harmless warning that
does not cause any discomfort.

it's completely normal that during configuration the compiler and the
processor have conflicting opinions, but this has no consequences
because it's enough that only one of the two is able to understand
where the searched package is.

libpq-fe.h has nothing to do with your issue, it has been correctly
configured; the real problem is the following one.


> Dialogs.cpp:2321:24: error: cannot convert ‘wxString’ to
> ‘const char*’
>> 2321 |   dbf = gaiaOpenZipDbf(ZipPath, filename, charset,
> "UTF-8");
>

It's precisely this fatal error that prevents the Dialogs.cpp
source from being compiled.
Your compiler reports a prohibited type conversion.

In my personal experience gained on Winows (minGW) and on Linux
(both Debian and Fedora) the g++ compiler, even the most recent
versions, have never reported anything odd for that instruction,
but on OpenSuse things could be different.

This is actually a someway "dirty" statement that is not entirely
correct, but which is very simple to fix.

open some text editor, go to line 2321 and just replace
"ZipPath" with "zip_path"; save and exit, the try again
to build ... it should finally work.

note: it would simply seem like a trivial oversight in
writing the code, given that the "zip_path" variable is
correctly set up but is then never used.

bye Sandro

Tobias Schula

unread,
Feb 23, 2025, 12:25:20 PMFeb 23
to spatiali...@googlegroups.com
Hi Sandro,

Am 23.02.25 um 16:19 schrieb a.fu...@lqt.it:
> the real problem is the following one.
>
>
>> Dialogs.cpp:2321:24: error: cannot convert ‘wxString’ to
>> ‘const char*’
>>> 2321 |   dbf = gaiaOpenZipDbf(ZipPath, filename, charset,
>> "UTF-8");
>>
>
> It's precisely this fatal error that prevents the Dialogs.cpp
> source from being compiled.
> Your compiler reports a prohibited type conversion.

> open some text editor, go to line 2321 and just replace
> "ZipPath" with "zip_path"; save and exit, the try again
> to build ... it should finally work.

many thanks! I changed "ZipPath" to "zip_path" in line 2321 *and* 3345.
Now make ran and I could install spatialite-gui.

However, I now get this warning:

> ./src/common/sizer.cpp(2286): assert "CheckSizerFlags(!((flags) & (wxALIGN_CENTRE_HORIZONTAL)))" failed in DoInsert(): wxALIGN_CENTRE_HORIZONTAL will be ignored in this sizer: only vertical alignment flags can be used in horizontal sizers
>
> DO NOT PANIC !!
>
> If you're an end user running a program not developed by you, please ignore this message, it is harmless, and please try reporting the problem to the program developers.
>
> You may also set WXSUPPRESS_SIZER_FLAGS_CHECK environment variable to suppress all such checks when running this program.
>
> If you're the developer, simply remove this flag from your code to avoid getting this message. You can also call wxSizerFlags::DisableConsistencyChecks() to globally disable all such checks, but this is strongly not recommended.

Spatialite-gui runs otherwise, though. I just have to confirm this
warning in a dialog box once.

Also, I had to `export "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/"` for
configure, since it would only check the paths for the libraries that
are installed by the package manager. I compiled and installed
librasterlite2 and VirtualPG to `/usr/local/`, since they are not in the
Tumbleweed repositories.


Best regards

Tobias

--
Tobias A Schula

Forestry Expert
geosp...@schula.org
OpenPGP_0x3B6BA2B3E91776FA.asc
OpenPGP_signature.asc

a.fu...@lqt.it

unread,
Feb 23, 2025, 1:53:16 PMFeb 23
to spatiali...@googlegroups.com
Hi Tobias,

> many thanks! I changed "ZipPath" to "zip_path" in line 2321 *and*
> 3345. Now make ran and I could install spatialite-gui.
>

all's well that ends well


> However, I now get this warning:
>
> assert "CheckSizerFlags(...)" failed in DoInsert()
> DO NOT PANIC !!
>
> Spatialite-gui runs otherwise, though. I just have to confirm this
> warning in a dialog box once.
>

This is a big annoyance introduced by the latest version of wxWidgets.
What had worked perfectly for more than a decade with all previous
versions now shows an alarm window every time it finds a slightly
ambiguous positioning in the widgets of a dialog window.

Note well: in functional terms absolutely nothing has changed,
simply now hundreds of useless messages come out.

Consider that correcting these small stretch marks is a decidedly
long job (and very boring as well), because we have many dozens
of dialog windows and there are hundreds and hundreds of widgets,
and for each one a different individual correction is needed on
a case-by-case basis.

I've been trying to fix everything for several months, but it's
a low priority task and I'm still not at all sure I've fixed all
issues.

For now the simplest solution is to kill the first message specifying
that you don't want to receive any more; don't worry, you'll see
that everything works fine.

Alternatively you can try to install the previous version of wxWidgets
which did not caused any problems.


> Also, I had to `export "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/"`
> for configure, since it would only check the paths for the libraries
> that are installed by the package manager. I compiled and installed
> librasterlite2 and VirtualPG to `/usr/local/`, since they are not in
> the Tumbleweed repositories.
>

Yes, this is normally required by all Linux variants; if you install
any package in some strange location (typically /usr/local) then
you have to manually adjust PKG_CONFIG_PATH
Is sounds absolutely familiar.

bye Sandro

Tobias Schula

unread,
Feb 23, 2025, 5:04:45 PMFeb 23
to spatiali...@googlegroups.com
Hi Sandro!

Am 23.02.25 um 19:53 schrieb a.fu...@lqt.it:
>> However, I now get this warning:
>>
>> assert "CheckSizerFlags(...)" failed in DoInsert()
>> DO NOT PANIC !!

> This is a big annoyance introduced by the latest version of wxWidgets.

> I've been trying to fix everything for several months, but it's
> a low priority task and I'm still not at all sure I've fixed all
> issues.

Thanks and take your time!

> For now the simplest solution is to kill the first message specifying
> that you don't want to receive any more; don't worry, you'll see
> that everything works fine.

Thank you, that's exactly what I did! Spatialite and spatialite-gui are
great, I'm glad I got it working again finally.
OpenPGP_0x3B6BA2B3E91776FA.asc
OpenPGP_signature.asc
Reply all
Reply to author
Forward
0 new messages