Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

odbc_config missing

351 views
Skip to first unread message

Igor Korot

unread,
Jul 19, 2022, 10:50:05 PM7/19/22
to
Hi, ALL  
According to unixODBC maintainers, there is a script called odbc_config.

It looks like this script is missing in Debian.

I just tried to compile my program and got an error about it.

How should I handle it?

Thank you.

David Wright

unread,
Jul 19, 2022, 11:20:04 PM7/19/22
to
By typing the filename into a search engine. As if by magic,
someone has the same problem, and someone else supplies a copy.

Cheers,
David.

Igor Korot

unread,
Jul 20, 2022, 10:30:05 AM7/20/22
to
Hi,

Apparently it IS a known problem

Ubuntu installs it and wants debian to follow.
But then someone replied that they made pkg-config file and ask others to follow.

This I don't understand at all.

Thank you.


Cheers,
David.

Curt

unread,
Jul 20, 2022, 11:20:04 AM7/20/22
to
On 2022-07-20, Igor Korot <ikor...@gmail.com> wrote:
>
> Apparently it IS a known problem
>
> This - https://bugs.launchpad.net/ubuntu/+source/unixodbc/+bug/551701 -
> claims
> Ubuntu installs it and wants debian to follow.
> But then someone replied that they made pkg-config file and ask others to
> follow.


I guess because

# This script will query 'pkg-config' for the required cflags and
# ldflags.

https://github.com/r-dbi/odbc/blob/main/configure

Igor Korot

unread,
Jul 20, 2022, 11:50:05 AM7/20/22
to
Hi,

On Wed, Jul 20, 2022 at 10:13 AM Curt <cu...@free.fr> wrote:
>
> On 2022-07-20, Igor Korot <ikor...@gmail.com> wrote:
> >
> > Apparently it IS a known problem
> >
> > This - https://bugs.launchpad.net/ubuntu/+source/unixodbc/+bug/551701 -
> > claims
> > Ubuntu installs it and wants debian to follow.
> > But then someone replied that they made pkg-config file and ask others to
> > follow.
>
>
> I guess because
>
> # This script will query 'pkg-config' for the required cflags and
> # ldflags.
>
> https://github.com/r-dbi/odbc/blob/main/configure

I tried to run

pkg-config --libs unixodbc

and it fails.

Thank you.

Reco

unread,
Jul 20, 2022, 1:10:05 PM7/20/22
to
Hi.

On Wed, Jul 20, 2022 at 10:40:45AM -0500, Igor Korot wrote:
> I tried to run
>
> pkg-config --libs unixodbc
>
> and it fails.

apt install unixodbc-dev

Reco

Igor Korot

unread,
Jul 20, 2022, 1:50:05 PM7/20/22
to
Hi,
It is installed and its the latest version...

Thank you.

>
> Reco
>

David Wright

unread,
Jul 20, 2022, 2:50:05 PM7/20/22
to
On Wed 20 Jul 2022 at 12:41:03 (-0500), Igor Korot wrote:
> On Wed, Jul 20, 2022 at 12:09 PM Reco <recov...@enotuniq.net> wrote:
> > On Wed, Jul 20, 2022 at 10:40:45AM -0500, Igor Korot wrote:
> > > I tried to run
> > >
> > > pkg-config --libs unixodbc

>From a position of almost complete ignorance, I would have thought
that the software you're trying to configure is odbc, and that it
happens to be a unixodbc implementation that's packaged as unixodbc.

Package: unixodbc
Description-md5: dbef25e3cf8e980a394982ef6927a9ca
Description-en: Basic ODBC tools
UnixODBC is an implementation of the Open Database Connectivity standard,
a database abstraction layer that allows applications to be used with
many different relational databases by way of a single library.
.
This package contains isql, a command-line tool that allows SQL commands
to be entered interactively.

Package: unixodbc-dev
Description-md5: 810ff6350f7d3725bcea408feaf73610
Description-en: ODBC libraries for UNIX (development files)
This package contains the development files (headers and libraries) for
unixODBC, an implementation of the Open DataBase Connectivity interface
for Unix systems. You should not need to install this package unless
you intend to develop C language applications which use ODBC, or to
compile ODBC-using applications from source.

> > > and it fails.
> >
> > apt install unixodbc-dev
>
> It is installed and its the latest version...

BTW you could be a bit more forthcoming about what you've consulted,
what you've done, and what output you get. Writing "got an error about
it" and "it fails" doesn't exactly show that you're putting the work in.

Cheers,
David.

Igor Korot

unread,
Jul 20, 2022, 2:50:05 PM7/20/22
to
Hi, David,
This sentence from the OP:

[quote]
I just tried to compile my program and got an error about it.
[/quote]

shows what I'm doing (it doesn't reference unixODBC at all, does it?)
and the issue I'm facing.

Yes, it is about unixODBC that Debian neglects to install completely
and therefore people who want to build and run their software
on have problems with.

BTW, PostgreSQL configuration script and mySQL configuration script
are both installed and work fine. My program depends on all 3 and only unixODBC
fails.

Thank you.

>
> Cheers,
> David.
>

Greg Wooledge

unread,
Jul 20, 2022, 3:10:05 PM7/20/22
to
On Wed, Jul 20, 2022 at 01:48:34PM -0500, Igor Korot wrote:
> This sentence from the OP:
>
> [quote]
> I just tried to compile my program and got an error about it.
> [/quote]
>
> shows what I'm doing (it doesn't reference unixODBC at all, does it?)
> and the issue I'm facing.

No. It does not.

Here are two theoretical help requests. I would like you to compare
them:


The first one:
=========================================
Please help me! I'm trying to compile a program and it doesn't work!
I got an error!
=========================================


The second one:
=========================================
Please help me! I'm trying to compile moon-lander 1.2. I'm following
the steps in the INSTALL file, but I get this error when I type make:

fred@zanzibar:~$ make
bash: make: command not found

What should I do?
=========================================


Try to put yourself in the position of someone reading your messages.
How would you react, upon reading your own message, which is almost
completely devoid of any useful information? How would you help yourself
based on that message?

At the very least you have to tell people what the error message says.
Do you think we can see your screen? We can't.

Reco

unread,
Jul 20, 2022, 3:30:04 PM7/20/22
to
I see the problem. What you should actually execute is:

pkg-config --libs odbc

Or maybe:

pkg-config --libs odbcinst

I'm not that familiar with ODBC to know the difference between those.

Reco

Igor Korot

unread,
Jul 20, 2022, 3:40:05 PM7/20/22
to
Hi,
How about a 3rd one?

[quote]
I am a developer and I'm trying to compile my own software.
The software depends on unixODBC.
Trying to compile I got an error that odbc_config is not found.
[/quote]

You are comparing apples and oranges here.

Like I said in the OP, I'm trying to compile my own program
not the one that has a package in the Debian distro.
>From the issue I would guess that the odbc_config script
that should tell the compiler where the include and library
should be searched is missing/not installed.

My first thought would be just like Reco, to ask if the unixODBC
or iODBC and its development package is installed on the system.

And then ask to check for pkg-config, because as a developer
those are 2 things that first come to mind.

So yes - I would help myself in that situation based on the OP message
I sent.

>

Igor Korot

unread,
Jul 20, 2022, 3:40:05 PM7/20/22
to
Hi,

On Wed, Jul 20, 2022 at 2:24 PM Reco <recov...@enotuniq.net> wrote:
>
> On Wed, Jul 20, 2022 at 12:41:03PM -0500, Igor Korot wrote:
> > Hi,
> >
> > On Wed, Jul 20, 2022 at 12:09 PM Reco <recov...@enotuniq.net> wrote:
> > >
> > > Hi.
> > >
> > > On Wed, Jul 20, 2022 at 10:40:45AM -0500, Igor Korot wrote:
> > > > I tried to run
> > > >
> > > > pkg-config --libs unixodbc
> > > >
> > > > and it fails.
> > >
> > > apt install unixodbc-dev
> >
> > It is installed and its the latest version...
>
> I see the problem. What you should actually execute is:
>
> pkg-config --libs odbc
>
> Or maybe:
>
> pkg-config --libs odbcinst

Will try them when I get home.

But that actually means that maintaining compatibility
between different distributions is a nightmare. ;-)
(No offense - I'm not trying to be rude)

Thank you.

David Wright

unread,
Jul 20, 2022, 6:00:06 PM7/20/22
to
On Wed 20 Jul 2022 at 14:35:37 (-0500), Igor Korot wrote:
> On Wed, Jul 20, 2022 at 2:24 PM Reco <recov...@enotuniq.net> wrote:
> > On Wed, Jul 20, 2022 at 12:41:03PM -0500, Igor Korot wrote:
> > > On Wed, Jul 20, 2022 at 12:09 PM Reco <recov...@enotuniq.net> wrote:
> > > > On Wed, Jul 20, 2022 at 10:40:45AM -0500, Igor Korot wrote:
> > > > > I tried to run
> > > > >
> > > > > pkg-config --libs unixodbc
> > > > >
> > > > > and it fails.
> > > >
> > > > apt install unixodbc-dev
> > >
> > > It is installed and its the latest version...
> >
> > I see the problem. What you should actually execute is:
> >
> > pkg-config --libs odbc
> >
> > Or maybe:
> >
> > pkg-config --libs odbcinst
>
> Will try them when I get home.
>
> But that actually means that maintaining compatibility
> between different distributions is a nightmare. ;-)
> (No offense - I'm not trying to be rude)

I wouldn't know. I just type a pkg-config command line into
a search engine, and it turned up "Guide to pkg-config -
FreeDesktop.Org" which points to:
https://people.freedesktop.org/~dbn/pkg-config-guide.html

That page says that each library comes with a <name>.pc file,
so I looked at the Debian packages page for unixodbc-dev
and saw that there were three .pc files. Perhaps these are
the names of the libraries that are being configured (or
is it 'quizzed about their configuration').

Cheers,
David.

David Wright

unread,
Jul 20, 2022, 6:30:04 PM7/20/22
to
You actually wrote:

I tried to run
pkg-config --libs unixodbc
and it fails.

but you haven't said much about which Debian packages you have
installed on your system, and whether you have taken any actions
as a result of reading the URLs that have been mentioned. And,
as I said, "it fails" is of no help.

> Like I said in the OP, I'm trying to compile my own program
> not the one that has a package in the Debian distro.
> From the issue I would guess that the odbc_config script
> that should tell the compiler where the include and library
> should be searched is missing/not installed.
>
> My first thought would be just like Reco, to ask if the unixODBC
> or iODBC and its development package is installed on the system.

I assumed that by today, you would already have checked that.
(I'm not sure how you would otherwise know that the file in
question was actually missing.)

But the said URLs refer to Debian bugs #422207 and #852676,
which seem to indicate some issues between the odbc_config file
and the Debian maintainer, so you might want to read them more
carefully than I have. (I don't know what the issue is.)

> And then ask to check for pkg-config, because as a developer
> those are 2 things that first come to mind.
>
> So yes - I would help myself in that situation based on the OP message
> I sent.

Cheers,
David.

Igor Korot

unread,
Jul 20, 2022, 8:00:06 PM7/20/22
to
Hi, guys,

Please compare:

In Gentoo:

[code]
igor@IgorReinCloud ~ $ odbc_config --libs
-L/usr/lib64 -lodbc
igor@IgorReinCloud ~ $
[/code]

In Debian:

[code]
igor@debian: ~ $ pkg-config --libs odbc
-lodbc
[/code]

Not good enough. ;-)

When someone tries to build something on Debian and then
test it it will fail because ldd will not be able to find the library.

Thank you.

Greg Wooledge

unread,
Jul 20, 2022, 8:30:05 PM7/20/22
to
On Wed, Jul 20, 2022 at 07:05:28PM -0500, Igor Korot wrote:
> Please compare:
>
> In Gentoo:
>
> [code]
> igor@IgorReinCloud ~ $ odbc_config --libs
> -L/usr/lib64 -lodbc
> igor@IgorReinCloud ~ $
> [/code]
>
> In Debian:
>
> [code]
> igor@debian: ~ $ pkg-config --libs odbc
> -lodbc
> [/code]

FINALLY! SOME ACTUAL DETAILS WE CAN WORK WITH!

> Not good enough. ;-)

Why not?

According to packages.debian.org, the libodbc.so file is in:

File Packages
/usr/lib/aarch64-linux-gnu/libodbc.so unixodbc-dev [arm64]
/usr/lib/arm-linux-gnueabi/libodbc.so unixodbc-dev [armel]
/usr/lib/arm-linux-gnueabihf/libodbc.so unixodbc-dev [armhf]
/usr/lib/i386-linux-gnu/libodbc.so unixodbc-dev [i386]
/usr/lib/mips-linux-gnu/libodbc.so unixodbc-dev [mips]
/usr/lib/mips64el-linux-gnuabi64/libodbc.so unixodbc-dev [mips64el]
/usr/lib/mipsel-linux-gnu/libodbc.so unixodbc-dev [mipsel]
/usr/lib/powerpc64le-linux-gnu/libodbc.so unixodbc-dev [ppc64el]
/usr/lib/s390x-linux-gnu/libodbc.so unixodbc-dev [s390x]
/usr/lib/x86_64-linux-gnu/libodbc.so unixodbc-dev [amd64]

Assuming you're on amd64, the /usr/lib/x86_64-linux-gnu/ directory is
already in the linker's search path, right? So you don't *need*
an extra -L option.

unicorn:~$ gcc -print-search-dirs
install: /usr/lib/gcc/x86_64-linux-gnu/10/
programs: =/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/10/../../../../x86_64-linux-gnu/bin/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/10/../../../../x86_64-linux-gnu/bin/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/10/../../../../x86_64-linux-gnu/bin/
libraries: =/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/10/../../../../x86_64-linux-gnu/lib/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/10/../../../../x86_64-linux-gnu/lib/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/10/../../../../x86_64-linux-gnu/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib/:/lib/x86_64-linux-gnu/10/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/10/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/10/../../../../x86_64-linux-gnu/lib/:/usr/lib/gcc/x86_64-linux-gnu/10/../../../:/lib/:/usr/lib/

It's in there.

> When someone tries to build something on Debian and then
> test it it will fail because ldd will not be able to find the library.

Can you show us the linker command that you ran, and its error message?

Igor Korot

unread,
Jul 20, 2022, 8:50:04 PM7/20/22
to
Hi,
This is the command generated on Gentoo:

[code]
/bin/sh ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I.
-I/home/igor/dbhandler/libodbc -I.. -I../../dbinterface -DUNICODE
-DUNIXODBC -I`odbc_config --cflags` -g -O0 -MT
libodbc_lib_la-database_odbc.lo -MD -MP -MF
.deps/libodbc_lib_la-database_odbc.Tpo -c -o
libodbc_lib_la-database_odbc.lo `test -f 'database_odbc.cpp' || echo
'/home/igor/dbhandler/libodbc/'`database_odbc.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I.
-I/home/igor/dbhandler/libodbc -I.. -I../../dbinterface -DUNICODE
-DUNIXODBC -I-DHAVE_UNISTD_H -DHAVE_PWD_H -DHAVE_SYS_TYPES_H
-DHAVE_LONG_LONG -DSIZEOF_LONG_INT=8 -I/usr/include -g -O0 -MT
libodbc_lib_la-database_odbc.lo -MD -MP -MF
.deps/libodbc_lib_la-database_odbc.Tpo -c
/home/igor/dbhandler/libodbc/database_odbc.cpp -fPIC -DPIC -o
.libs/libodbc_lib_la-database_odbc.o
libtool: compile: g++ -DHAVE_CONFIG_H -I.
-I/home/igor/dbhandler/libodbc -I.. -I../../dbinterface -DUNICODE
-DUNIXODBC -I-DHAVE_UNISTD_H -DHAVE_PWD_H -DHAVE_SYS_TYPES_H
-DHAVE_LONG_LONG -DSIZEOF_LONG_INT=8 -I/usr/include -g -O0 -MT
libodbc_lib_la-database_odbc.lo -MD -MP -MF
.deps/libodbc_lib_la-database_odbc.Tpo -c
/home/igor/dbhandler/libodbc/database_odbc.cpp -o
libodbc_lib_la-database_odbc.o >/dev/null 2>&1
mv -f .deps/libodbc_lib_la-database_odbc.Tpo
.deps/libodbc_lib_la-database_odbc.Plo
/bin/sh ../libtool --tag=CXX --mode=link g++ -I../../dbinterface
-DUNICODE -DUNIXODBC -I`odbc_config --cflags` -g -O0 -L../dbinterface
-ldbinterface `odbc_config --libs` -lodbcinst -o libodbc_lib.la
-rpath /usr/local/lib libodbc_lib_la-database_odbc.lo
libtool: link: g++ -fPIC -DPIC -shared -nostdlib
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../lib64/crti.o
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/crtbeginS.o
.libs/libodbc_lib_la-database_odbc.o -L../dbinterface -ldbinterface
-L/usr/lib64 -lodbc -lodbcinst
-L/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0
-L/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../lib64
-L/lib/../lib64 -L/usr/lib/../lib64
-L/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/lib
-L/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../.. -lstdc++ -lm -lc
-lgcc_s /usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/crtendS.o
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../lib64/crtn.o -g
-O0 -Wl,-soname -Wl,libodbc_lib.so.0 -o .libs/libodbc_lib.so.0.0.0
libtool: link: (cd ".libs" && rm -f "libodbc_lib.so.0" && ln -s
"libodbc_lib.so.0.0.0" "libodbc_lib.so.0")
libtool: link: (cd ".libs" && rm -f "libodbc_lib.so" && ln -s
"libodbc_lib.so.0.0.0" "libodbc_lib.so")
libtool: link: ar cru .libs/libodbc_lib.a libodbc_lib_la-database_odbc.o
libtool: link: ranlib .libs/libodbc_lib.a
libtool: link: ( cd ".libs" && rm -f "libodbc_lib.la" && ln -s
"../libodbc_lib.la" "libodbc_lib.la" )
[/code]

with the following Makefile.am:

[code]
## Process this file with automake to produce Makefile.in


lib_LTLIBRARIES = \
libodbc_lib.la

libodbc_lib_la_SOURCES = \
database_odbc.cpp \
database_odbc.h

libodbc_lib_la_CXXFLAGS = -I../../dbinterface \
-DUNICODE \
-DUNIXODBC \
-I`odbc_config \
--cflags`

libodbc_lib_la_LDFLAGS = -L../dbinterface \
-ldbinterface \
`odbc_config \
--libs` \
-lodbcinst
[/code]

Thank you.

>

Greg Wooledge

unread,
Jul 20, 2022, 9:00:05 PM7/20/22
to
On Wed, Jul 20, 2022 at 07:46:43PM -0500, Igor Korot wrote:
> On Wed, Jul 20, 2022 at 7:28 PM Greg Wooledge <gr...@wooledge.org> wrote:
> > Can you show us the linker command that you ran, and its error message?
>
> This is the command generated on Gentoo:

How is that relevant to DEBIAN?

> [code]
> /bin/sh ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I.
> -I/home/igor/dbhandler/libodbc -I.. -I../../dbinterface -DUNICODE
> -DUNIXODBC -I`odbc_config --cflags` -g -O0 -MT
[...]

That's all noise as far as Debian is concerned.

> with the following Makefile.am:
>
> [code]
> ## Process this file with automake to produce Makefile.in
>
>
> lib_LTLIBRARIES = \
> libodbc_lib.la
>
> libodbc_lib_la_SOURCES = \
> database_odbc.cpp \
> database_odbc.h
>
> libodbc_lib_la_CXXFLAGS = -I../../dbinterface \
> -DUNICODE \
> -DUNIXODBC \
> -I`odbc_config \
> --cflags`
>
> libodbc_lib_la_LDFLAGS = -L../dbinterface \
> -ldbinterface \
> `odbc_config \
> --libs` \
> -lodbcinst
> [/code]

It looks like you've made some false assumptions about this library.
Apparently it has different linker options and library filenames on
different platforms, and moreover, different *means of learning those
names*.

Sounds like a real bitch to work with. Oh right, it's ODBC, so it's
always going to be horrible, isn't it.

Good luck!

Igor Korot

unread,
Jul 20, 2022, 10:20:05 PM7/20/22
to
And those are what was made on Debian with the same Makefile.am:

/bin/bash ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H
-I. -I../../libodbc -I.. -I../../dbinterface -DUNICODE -DUNIXODBC
-I`odbc_config --cflags` -g -O0 -MT libodbc_lib_la-database_odbc.lo
-MD -MP -MF .deps/libodbc_lib_la-database_odbc.Tpo -c -o
libodbc_lib_la-database_odbc.lo `test -f 'database_odbc.cpp' || echo
'../../libodbc/'`database_odbc.cpp
/bin/bash: line 1: odbc_config: command not found
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../../libodbc -I..
-I../../dbinterface -DUNICODE -DUNIXODBC -I -g -O0 -MT
libodbc_lib_la-database_odbc.lo -MD -MP -MF
.deps/libodbc_lib_la-database_odbc.Tpo -c
../../libodbc/database_odbc.cpp -fPIC -DPIC -o
.libs/libodbc_lib_la-database_odbc.o
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../../libodbc -I..
-I../../dbinterface -DUNICODE -DUNIXODBC -I -g -O0 -MT
libodbc_lib_la-database_odbc.lo -MD -MP -MF
.deps/libodbc_lib_la-database_odbc.Tpo -c
../../libodbc/database_odbc.cpp -o libodbc_lib_la-database_odbc.o
>/dev/null 2>&1
mv -f .deps/libodbc_lib_la-database_odbc.Tpo
.deps/libodbc_lib_la-database_odbc.Plo
/bin/bash ../libtool --tag=CXX --mode=link g++ -I../../dbinterface
-DUNICODE -DUNIXODBC -I`odbc_config --cflags` -g -O0 -L../dbinterface
-ldbinterface `odbc_config --libs` -lodbcinst -o libodbc_lib.la
-rpath /usr/local/lib libodbc_lib_la-database_odbc.lo
/bin/bash: line 1: odbc_config: command not found
/bin/bash: line 1: odbc_config: command not found
libtool: link: g++ -fPIC -DPIC -shared -nostdlib
/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/crti.o
/usr/lib/gcc/x86_64-linux-gnu/10/crtbeginS.o
.libs/libodbc_lib_la-database_odbc.o -L../dbinterface -ldbinterface
-lodbcinst -L/usr/lib/gcc/x86_64-linux-gnu/10
-L/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu
-L/usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib
-L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu
-L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/10/../../.. -lstdc++
-lm -lc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/10/crtendS.o
/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/crtn.o -g
-O0 -Wl,-soname -Wl,libodbc_lib.so.0 -o .libs/libodbc_lib.so.0.0.0
libtool: link: (cd ".libs" && rm -f "libodbc_lib.so.0" && ln -s
"libodbc_lib.so.0.0.0" "libodbc_lib.so.0")
libtool: link: (cd ".libs" && rm -f "libodbc_lib.so" && ln -s
"libodbc_lib.so.0.0.0" "libodbc_lib.so")
libtool: link: ar cr .libs/libodbc_lib.a libodbc_lib_la-database_odbc.o
libtool: link: ranlib .libs/libodbc_lib.a
libtool: link: ( cd ".libs" && rm -f "libodbc_lib.la" && ln -s
"../libodbc_lib.la" "libodbc_lib.la" )
igor@debian:~/dbhandler/Debug/libodbc$

As you can see the build succeeded.

But after running "make install" trying to load that library will fail
because the library
libodbc.so will not be found.

Thank you.

Igor Korot

unread,
Jul 20, 2022, 10:30:06 PM7/20/22
to
Hi,

On Wed, Jul 20, 2022 at 7:55 PM Greg Wooledge <gr...@wooledge.org> wrote:
>
> On Wed, Jul 20, 2022 at 07:46:43PM -0500, Igor Korot wrote:
> > On Wed, Jul 20, 2022 at 7:28 PM Greg Wooledge <gr...@wooledge.org> wrote:
> > > Can you show us the linker command that you ran, and its error message?
> >
> > This is the command generated on Gentoo:
>
> How is that relevant to DEBIAN?

Because I'm comparing the output of 2 "-config" files.
I sent the output the Debian generated. Sorry for the delay.
Debian is set on the VM.
Don't make any presumption.
Just check what Debian is generating.

>
> Sounds like a real bitch to work with. Oh right, it's ODBC, so it's
> always going to be horrible, isn't it.

Why?
It's still going to be libodbc.so and libodbcinst.so, isn't it?

Thank you.

>
> Good luck!
>

Greg Wooledge

unread,
Jul 20, 2022, 10:40:05 PM7/20/22
to
On Wed, Jul 20, 2022 at 09:12:51PM -0500, Igor Korot wrote:
> And those are what was made on Debian with the same Makefile.am:

OK!

[...]
> /bin/bash ../libtool --tag=CXX --mode=link g++ -I../../dbinterface
> -DUNICODE -DUNIXODBC -I`odbc_config --cflags` -g -O0 -L../dbinterface
> -ldbinterface `odbc_config --libs` -lodbcinst -o libodbc_lib.la
> -rpath /usr/local/lib libodbc_lib_la-database_odbc.lo
> /bin/bash: line 1: odbc_config: command not found
> /bin/bash: line 1: odbc_config: command not found

You're missing -lodbc here. Presumably that should have come from
your backtick command, which obviously failed, because it's not the
correct command substitution for this platform.

You either need to find a command substitution that works on ALL of your
platforms, or you need to put something in ./configure which tries
all known commands and selects the one that appears to work, or else you
need to just throw all the commands into one big ugly horrible linker
invocation, something like:

../libtool --tag=CXX --mode=link g++ ... \
$(odbc_config --libs 2>/dev/null) \
$(pkg-config --libs whatever 2>/dev/null) \
...

Or ask an ODBC developers' support channel how you're supposed to do it
on all the platforms you wish to support.

> As you can see the build succeeded.
>
> But after running "make install" trying to load that library will fail
> because the library
> libodbc.so will not be found.

I believe that's caused by the missing -lodbc linker argument. But please
bear in mind that I haven't done serious C development work in many years,
and I've never worked with ODBC in this way before.

Igor Korot

unread,
Jul 21, 2022, 1:00:05 AM7/21/22
to
Hi,

On Wed, Jul 20, 2022 at 9:32 PM Greg Wooledge <gr...@wooledge.org> wrote:
>
> On Wed, Jul 20, 2022 at 09:12:51PM -0500, Igor Korot wrote:
> > And those are what was made on Debian with the same Makefile.am:
>
> OK!
>
> [...]
> > /bin/bash ../libtool --tag=CXX --mode=link g++ -I../../dbinterface
> > -DUNICODE -DUNIXODBC -I`odbc_config --cflags` -g -O0 -L../dbinterface
> > -ldbinterface `odbc_config --libs` -lodbcinst -o libodbc_lib.la
> > -rpath /usr/local/lib libodbc_lib_la-database_odbc.lo
> > /bin/bash: line 1: odbc_config: command not found
> > /bin/bash: line 1: odbc_config: command not found
>
> You're missing -lodbc here. Presumably that should have come from
> your backtick command, which obviously failed, because it's not the
> correct command substitution for this platform.

Do you mean to say that the backticks are not supported on Debian?
Or that there is no odbc_config installed when it should?

>
> You either need to find a command substitution that works on ALL of your
> platforms, or you need to put something in ./configure which tries
> all known commands and selects the one that appears to work, or else you
> need to just throw all the commands into one big ugly horrible linker
> invocation, something like:
>
> ../libtool --tag=CXX --mode=link g++ ... \
> $(odbc_config --libs 2>/dev/null) \
> $(pkg-config --libs whatever 2>/dev/null) \

That's definitely ugly.

> ...
>
> Or ask an ODBC developers' support channel how you're supposed to do it
> on all the platforms you wish to support.

The way to do it is by using odbc_config.
I already asked and that's why I'm using it.

>
> > As you can see the build succeeded.
> >
> > But after running "make install" trying to load that library will fail
> > because the library
> > libodbc.so will not be found.
>
> I believe that's caused by the missing -lodbc linker argument. But please
> bear in mind that I haven't done serious C development work in many years,
> and I've never worked with ODBC in this way before.

You are presumably right.
Trouble is - I'm doing it correctly and it's Debian who is at fault
(see above)..

Now, it is possible that odbc_config is just called pkg-config where available
or vice versa.
But the official way from upstream is to use odbc_config.

Thank you.


>

Greg Wooledge

unread,
Jul 21, 2022, 7:00:05 AM7/21/22
to
> > > /bin/bash ../libtool --tag=CXX --mode=link g++ -I../../dbinterface
> > > -DUNICODE -DUNIXODBC -I`odbc_config --cflags` -g -O0 -L../dbinterface
> > > -ldbinterface `odbc_config --libs` -lodbcinst -o libodbc_lib.la
> > > -rpath /usr/local/lib libodbc_lib_la-database_odbc.lo
> > > /bin/bash: line 1: odbc_config: command not found
> > > /bin/bash: line 1: odbc_config: command not found
> >
> > You're missing -lodbc here. Presumably that should have come from
> > your backtick command, which obviously failed, because it's not the
> > correct command substitution for this platform.
>
> Do you mean to say that the backticks are not supported on Debian?

No. I'm saying that the command

odbc_config --libs

is not supported on Debian. Apparently Debian uses a different command
(pkg-config) for this purpose.

> Or that there is no odbc_config installed when it should?

What does "should" mean?

You seriously need to find the mailing list, web forum, IRC channel,
Discord server, or WHATEVER it is, where this libodbc thing is supported.
Ask them how it's supposed to be done. I've given you my best guesses
and workarounds.

If the MAINTAINERS OF LIBODBC ITSELF say that odbc_config is supposed
to be installed and present, then it's a bug in Debian and you can
pursue that theough the Bug Tracking System.

This is the end user mailing list. Here, you get our best guesses.

But hey, would you like another workaround? OK. Go install a shell
script named odbc_config in /usr/local/bin and have it print the values
you need it to print. I bet the thing on Gentoo is a shell script.
Just don't have it print the values that Gentoo's script prints. Have
it print the correct values for Debian. They are not the same.

David Wright

unread,
Jul 21, 2022, 10:10:05 AM7/21/22
to
I thought that was what the attached was (actually for Ubuntu AIUI).
As I originally wrote, "As if by magic, […] someone else supplies a copy."

Cheers,
David.
odbc_config

Greg Wooledge

unread,
Jul 21, 2022, 10:20:05 AM7/21/22
to
On Thu, Jul 21, 2022 at 09:06:53AM -0500, David Wright wrote:
> I thought that was what the attached was (actually for Ubuntu AIUI).
> As I originally wrote, "As if by magic, […] someone else supplies a copy."
>
> Cheers,
> David.

> #! /bin/sh
>
> # This shell script saves various pieces of information about the
> # installed version of unixODBC. Packages that interface to
> # unixODBC can use it to configure their build.
> # This file replaces the standard odbc_config, which is not
> # relocatable
> #
> # Author: Alberto Di Meglio <alberto....@cern.ch>
> # Public domain
>
> me=`basename $0`
> mydir=`dirname $0`
> mydir=${mydir%/bin}
>
> # stored configuration values
> val_prefix="$mydir"
> val_bindir="$mydir/bin"
> val_includedir="$mydir/include"
> val_libdir="$mydir/lib"
> val_libs="-L$mydir/lib -lodbc"
> val_version='2.2.11'

This is not going to give the correct linker arguments. It's going to
spit out a -L option which is totally unneeded, and worse, the *content*
of that -L option is going to depend on where the operating system thinks
the script has been "installed".

If the script is "installed" in /usr/local/bin/odbc_config, it's going
to spit out -L/usr/local/lib -lodbc.

As the script itself says,

> # This file replaces the standard odbc_config

So, why not use the "standard odbc_config", whatever that is?

Again, this really needs to be taken up with the upstream maintainers of
the library, and with the Debian maintainer(s) of the Debian packages of
the library.

Igor Korot

unread,
Jul 21, 2022, 11:30:05 AM7/21/22
to
Hi,
I agree.
When asked Nick Gorham (the official maintainer of unixODBC) how to identify
the options in the host software for unixODBC he pointed me out to odbc_config.
No mentions of pkg-config or any other script were given.

[quote]
On Fri, Jul 15, 2022 at 3:28 AM Nick Gorham <nick....@easysoft.com> wrote:
>
> On 15/07/2022 03:07, Igor Korot wrote:
> > Hi,
> > Is there a way to identify where unixODBC is installed (headers/libraries)
> > and what libraries to link against?
> >
> > Some kind of `pkg-config unixodbc` command...
> >
> > Thank you.
>
> Thats what odbc_config is aimed at
>
> odbc_config --libs
> -L/usr/local/lib -lodbc
>
> odbc_config --include-prefix
> /usr/local/include
>
> odbc_config --prefix
> /usr/local
>
> odbc_config --version
> 2.3.12pre
[/quote]

Now, last night I tried to check.
Turns out sometime ago unixODBC introduced pkg-config:

[quote]
19.Mar.20182.3.6 Released

Single bug fix that ws a possible security issue so I have pushed a
version out.

As always, any problems just let me know.

Fix order of arguments in SQLWriteFileDSN.c, fix unwanted free() in iusql.c
Add pkg-config files
[/quote]

But Nick still points to the odbc_config as the official way to get the build
options into your software.
However according to Mr. Langacek, odbc_config should be thrown away and
pkg-config should be used all around, because apparently it's output
is wrong (re. https://linux.debian.bugs.dist.narkive.com/JqZh4ioW/bug-422207-unixodbc-dev-install-odbc-config).

I would question Mr. Langacek here as he is not an upstream maintainer
of ubnixODBC and so does not know better. ;-)

Now, I asked Nick what the deal is with pkg-config and will update as soon as
I get a reply.

Thank you.


>
>

David Wright

unread,
Jul 21, 2022, 11:40:06 AM7/21/22
to
On Thu 21 Jul 2022 at 10:15:43 (-0400), Greg Wooledge wrote:
> On Thu, Jul 21, 2022 at 09:06:53AM -0500, David Wright wrote:
> > I thought that was what the attached was (actually for Ubuntu AIUI).
> > As I originally wrote, "As if by magic, […] someone else supplies a copy."
> >
>
Yes, there's a hint in the file: "This file replaces the standard
odbc_config, which is not relocatable". It may be that this script
is sensitive to where it is placed, even though that was not the
intention. That alone might cause it, or something else, to fail.

It's also quite possible that the OP copied it into …/pkg-config,
ran that, and reported "it fails." Who knows?, hence my complaint:
"whether you have taken any actions as a result of reading the
URLs that have been mentioned".

> As the script itself says,
>
> > # This file replaces the standard odbc_config
>
> So, why not use the "standard odbc_config", whatever that is?

We're told that it's not part of the Debian distribution.

> Again, this really needs to be taken up with the upstream maintainers of
> the library, and with the Debian maintainer(s) of the Debian packages of
> the library.

I think it kind of was, in the Debian BTS that I referenced and
advised the OP to read carefully. I can say no more because,
unlike you, my experience of compiling C runs to not much more
than including a couple of libraries and producing an a.out.
(Two decades ago, I compiled kernels, but kernel-package made
that trivial apart from deciding which items to include.)

Cheers,
David.

Igor Korot

unread,
Jul 21, 2022, 11:50:06 AM7/21/22
to
Hi,
I do not copy anything.
Its all started because I tried to build my software on freshly installed
copy of the Debian OS + unixODBC + unixODBC-dev packages.

NOTHING ELSE.

Please check the Makefile.am I posted above. I did the addition of
odbc_config based on the suggestion of Nick Gorham, who is
official maintainer of unixODBC and whose reply I quoted.

I didn't even know that the script of that nature existed.

Now, of course I tried to look at the "possible solution/workaround"
suggested in this thread. But they all are just that - workarounds.

>
> > As the script itself says,
> >
> > > # This file replaces the standard odbc_config
> >
> > So, why not use the "standard odbc_config", whatever that is?
>
> We're told that it's not part of the Debian distribution.

Also, please see Mr. Langacek's reply in the URL I posted.

Thank you.

David Wright

unread,
Jul 21, 2022, 4:00:04 PM7/21/22
to
Fine. I know that now. But you posted, for example, that you ran
pkg-config, without saying what it was or where you got it.
(As well as any scripts that might be floating around, there are
at least two programs with that name in Debian.)

> Please check the Makefile.am I posted above. I did the addition of
> odbc_config based on the suggestion of Nick Gorham, who is
> official maintainer of unixODBC and whose reply I quoted.
>
> I didn't even know that the script of that nature existed.

And I see no mention of Gorham earlier than when I wrote my post.
Everything I've written has been based on what was in the thread
at that time and I've no interest in how each of my posts relates
to anything posted after it was written.

> Now, of course I tried to look at the "possible solution/workaround"
> suggested in this thread. But they all are just that - workarounds.

Yes, and I can't divine where your priorities lie without being told.
We trade in workarounds on this list, as well as tracking down bugs
and suggesting fixes for Debian.

> > > As the script itself says,
> > > > # This file replaces the standard odbc_config
> > > So, why not use the "standard odbc_config", whatever that is?
> >
> > We're told that it's not part of the Debian distribution.
>
> Also, please see Mr. Langacek's reply in the URL I posted.

Sure, I've read that, now that it's in the thread, and I had already
quoted #422207 earlier. I don't know how to reconcile the recent
six word reply with what's said in that bug, nor where their
odbc_config came from (and I'll admit that I'm not trying very
hard, either).

But you're not advancing your cause by taking umbrage at my
criticism of your earlier posts for being scant on information.

Igor Korot

unread,
Jul 21, 2022, 4:00:05 PM7/21/22
to
Hi,

On Thu, Jul 21, 2022 at 10:31 AM David Wright <deb...@lionunicorn.co.uk> wrote:
>
So, I got a reply from Nick Gorham (maintainer of unixODBC).

In the E-mail he said:

[quote]
I think pkg-config is made during the build time to match the distribution"
[/quote]

Which means that I will be needing something in the configure
to check if odbc_config exists, use it if it is and if not - use
pkg-config.

It still feels wrong however, that the distro maintainers dictate
to upstream packages how to do their business.

It should be the other way around.

Thank you.

BTW
1. vWhere can I file the bug about missing odbc_config?
2. Is there a ML/forum/whatever to discuss the issues like this?
This forum is for users of the OS, not people who wants to develop
software on the OS.

Thank you.

>
> Cheers,
> David.
>

to...@tuxteam.de

unread,
Jul 22, 2022, 12:00:05 AM7/22/22
to
On Thu, Jul 21, 2022 at 11:47:58AM -0500, Igor Korot wrote:

[...]

> It still feels wrong however, that the distro maintainers dictate
> to upstream packages how to do their business.

which is... distributing and integrating the software? (after all,
that's what those *-config are supposed to do, aren't they?)

You gotta have the last word, haven't you ;-)

Cheers... and cheer up
--
t
signature.asc

Igor Korot

unread,
Jul 22, 2022, 1:10:06 AM7/22/22
to
Hi,

On Thu, Jul 21, 2022 at 10:57 PM <to...@tuxteam.de> wrote:
>
> On Thu, Jul 21, 2022 at 11:47:58AM -0500, Igor Korot wrote:
>
> [...]
>
> > It still feels wrong however, that the distro maintainers dictate
> > to upstream packages how to do their business.
>
> which is... distributing and integrating the software? (after all,
> that's what those *-config are supposed to do, aren't they?)

Yes, because surprisingly enough I didn't have any issues with PostgreSQL
library config script and neither mySQL library config script.

Does unixODBC have more love than everything else? ;-)

Or there is something else going on?

The maintainers just needs to decide whether everything should use
"pkg-config" or everything should use "own config" file.

And if its me - I'd vote for letter - less maintenance burden for me.
If something bad happens - lets upstream deal with the issues.

Wouldn't you?

Thank you.

to...@tuxteam.de

unread,
Jul 22, 2022, 1:20:05 AM7/22/22
to
On Fri, Jul 22, 2022 at 12:03:46AM -0500, Igor Korot wrote:
> Hi,
>
> On Thu, Jul 21, 2022 at 10:57 PM <to...@tuxteam.de> wrote:
> >
> > On Thu, Jul 21, 2022 at 11:47:58AM -0500, Igor Korot wrote:
> >
> > [...]
> >
> > > It still feels wrong however, that the distro maintainers dictate
> > > to upstream packages how to do their business.
> >
> > which is... distributing and integrating the software? (after all,
> > that's what those *-config are supposed to do, aren't they?)
>
> Yes, because surprisingly enough I didn't have any issues with PostgreSQL
> library config script and neither mySQL library config script.
>
> Does unixODBC have more love than everything else? ;-)

Most probably just a different maintainer. Too lazy to look it up
right now.

> Or there is something else going on?
>
> The maintainers just needs to decide whether everything should use
> "pkg-config" or everything should use "own config" file.

There are few things which get decided top-down in Debian. That's one
of the most salient points of this distro. That's what I appreciate
in it.

> And if its me - I'd vote for letter - less maintenance burden for me.
> If something bad happens - lets upstream deal with the issues.
>
> Wouldn't you?

Not necessarily. The foo-config (for foo in PostgreSQL, sqlite, MariaDB)
all behave probably slightly differently. That's why pkg-config entered
the scene, after all. So there are arguments for both sides,

Such transitions sometimes work, sometimes they don't.

Cheers
--
t
signature.asc

Igor Korot

unread,
Jul 22, 2022, 2:00:05 AM7/22/22
to
But enough this flame war.
I will probably bake somethig that will identify the presence of odbc_config
and put it in the configure.ac/configure...

Thank you.

On Fri, Jul 22, 2022 at 12:59 AM Igor Korot <ikor...@gmail.com> wrote:
>
> Hi
> And here is the other point:
>
> [code]
> igor@IgorReinCloud /usr/local/lib $ pkg-config --libs odbc
> -lodbc
> igor@IgorReinCloud /usr/local/lib $ odbc_config --libs
> -L/usr/lib64 -lodbc
> igor@IgorReinCloud /usr/local/lib $
> [/code]
>
> I am not familiar with Debian and how it handles different packages
> but I have Gentoo 64-bit installed and running odbc_config
> my program will pick up libraries from 64 bit install.
> If I ever need 32-bit unixODBC it will pick up the library
> from the /usr/lib.
>
> I as a developer wouldn't care, because I will not know all this.
> But when I use pkg-config it looks like all it will show is the library
> I'm supposed to link with. And if someone decides to install both 32
> and 64 bit libraries...
>
> Someimes its not even possible to create a pkg-config. ;-)
>
> But you giuys making it hard
> >
> > Cheers
> > --
> > t

Igor Korot

unread,
Jul 22, 2022, 2:00:05 AM7/22/22
to
Hi

David Wright

unread,
Jul 25, 2022, 9:50:05 PM7/25/22
to
I don't know what the significance of such a one-line quote is.
I can only note that there are two Debian packages that already
include /usr/bin/pkg-config programs.

> Which means that I will be needing something in the configure
> to check if odbc_config exists, use it if it is and if not - use
> pkg-config.
>
> It still feels wrong however, that the distro maintainers dictate
> to upstream packages how to do their business.

I wasn't aware that they did. Distributions have policies, and AFAIK,
maintainers use patches to modify the upstream sources to fit in with
those policies.

> 1. vWhere can I file the bug about missing odbc_config?

Presumably in the Debian BTS, under the package that you're reporting
it's missing from.

> 2. Is there a ML/forum/whatever to discuss the issues like this?
> This forum is for users of the OS, not people who wants to develop
> software on the OS.

The unixodbc homepage mentions a mailing list that has been migrated
and fixed, but the entry's timestamp (2008) doesn't inspire confidence
that it's still active. Did the Debian maintainer not mention it?

Cheers,
David.
0 new messages