libodbc++ linking problems

Bug #159991 reported by Jefim
8
Affects Status Importance Assigned to Milestone
libodbc++ (Baltix)
New
Undecided
Unassigned
libodbc++ (Ubuntu)
Confirmed
Low
Unassigned
Nominated for Hardy by Matthew Flaschen

Bug Description

The following code fails to link on ubuntu 7.04/7.10

#include <odbc++/preparedstatement.h>
#include <odbc++/resultsetmetadata.h>
#include <odbc++/databasemetadata.h>
#include <odbc++/drivermanager.h>
using namespace odbc;

#include <stdio.h>

int main(){
        odbc::Connection* dbConnection=DriverManager::getConnection("DSN=test" );

}

g++ test.cpp -lodbc++
/tmp/ccS5xAyl.o: In function `main':
test.cpp:(.text+0x3e): undefined reference to `odbc::DriverManager::getConnection(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'

The code does not have any problem to link against the library that is build from the libodbc++ sources.

Tags: packaging
Revision history for this message
Guido U. Draheim 2007 (guidod-2007-) wrote :

The ubuntu package has been compiled with an additional set of
DEB_CONFIGURE_EXTRA_FLAGS += --with-unicode --enable-threads

The "--with-unicode" will effectivly define -DODBCXX_UNICODE
which in turn will compile with ODBCXX_STRING=std::wstring !!
However neighter odbc++/config.h nor pkgconfig/libodcbc++.pc
will list the define such that ALL programs depending on the
libodbc++ package can not possibly link - the libodbc++-mt.so
does really contain symbol definitions with std_char_traits<wchar_t>.
You can check that by running
    objdump -TC /usr/lib/libodbc++-mt.so

All this is completely wrong - a normal Ubuntu user will
not want to compile with wchar_t anyway but using utf8-char
instead. Possibly the Ubuntu package maintainer was mistaken
by the --with-unicode option to enable utf8 but it does really
invoke utf16. The Ubuntu libodbc++ DOES NOT PROVIDE any variant
for common utf8 at all and it is hence improbable to be useful.

A small patch would be to add -DODBCXX_UNICODE into the pkgconfig
file and/or appending "#define ODBCXXX_UNICODE" to the installed
odbc++/config.h such that you would get compile errors instead of
linking errors. That would leave the binary *.so as is. - A better
approach would be to assume that the package is broken beyond all
repair so that bogues --with-unicode should be removed and a working
(but binary incompatible) libodbc++.so to be shipped.

Note that this is Ubuntu-only - the Debian package probably works.

Revision history for this message
Guido U. Draheim (guidod) wrote :

ubuntu-specific packaging error

no response => package is unmaintained?

Revision history for this message
Daniel T Chen (crimsun) wrote :

Is this symptom still reproducible in 8.10?

Changed in libodbc++:
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Matthew Flaschen (matthew-flaschen) wrote :

Can't confirm 8.10, but definitely 8.04 LTS. This is a serious problem that essentially makes the library unusable.

JC Hulce (soaringsky)
Changed in libodbc++ (Ubuntu):
status: Incomplete → New
Changed in libodbc++ (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.