Linking error with recent libdc

Gaetan Bisson bisson at archlinux.org
Tue Jul 7 23:49:15 PDT 2015


[2015-07-08 08:40:04 +0200] Jef Driesen:
> On 2015-07-08 07:13, Gaetan Bisson wrote:
> >[2015-07-07 21:45:49 -0700] Dirk Hohndel:
> >>On Tue, Jul 07, 2015 at 05:59:00PM -1000, Gaetan Bisson wrote:
> >>> Linking CXX executable subsurface
> >>> libsubsurface_corelib.a(libdivecomputer.c.o): In function `do_libdivecomputer_import':
> >>> /build/subsurface-git/src/subsurface/libdivecomputer.c:932: undefined reference to `dc_device_custom_open'
> >>> libsubsurface_corelib.a(qtserialbluetooth.cpp.o): In function `dc_serial_qt_open':
> >>> /build/subsurface-git/src/subsurface/qtserialbluetooth.cpp:232: undefined reference to `dc_serial_init'
> >>> collect2: error: ld returned 1 exit status
> >>> CMakeFiles/subsurface.dir/build.make:281: recipe for target 'subsurface' failed
> >>
> >>So it's linking against the wrong libdivecomputer.
> >
> >So it seems I am building against the "right" one.
> >
> >Except the subsurface-libdc-git package I have built (from the proper
> >sources) contains references to, say, "dc_device_custom_open" in its
> >header files but not in the shared library...
> >
> >Is there anything new (dependency or otherwise) needed to properly build
> >libdc/Subsurface-testing? Or perhaps my build karma is not doing well...
> 
> I suspect the problem is that these functions are not listed in the
> src/libdivecomputer.symbols file. Only the functions that are listed there
> are exported in the shared library.

Right!

I was just noticing that if I do not throw away the static library the
linker indeed finds those functions there. The error only happens when
linking against the shared library.

Thanks.

-- 
Gaetan


More information about the subsurface mailing list