[ccan] autodata problem

picca picca at synchrotron-soleil.fr
Wed Mar 13 21:25:02 EST 2013


Hello, first thanks for your ccan project.
It saves my days...

I would like to ask a question about autodata

I create a shared library which use this module with a code like this

---
#include <hkl/ccan/autodata/autodata.h>

#include <hkl/hkl-geometry-factory.h>

AUTODATA_TYPE(geometries, HklGeometryConfig);

#define HKL_REGISTER_GEOMETRY(config) AUTODATA(geometries, (config))

static HklGeometryConfig twoC = {
	.name = "TwoC",
	.type = HKL_GEOMETRY_TYPE_TWOC_VERTICAL,
	.description = HKL_GEOMETRY_TWOC_DESCRIPTION
};
HKL_REGISTER_GEOMETRY(&twoC);

---

so it seems to me that I followed the _info exemple.

from the config.h generated from configurator.c I have HAVE_SECTION_START_STOP 1

now the library compile fine but when I try to link it.
I got this message


g-ir-scanner: link: /bin/bash ../libtool --mode=link --tag=CC gcc -o /home/picca/Projets/hkl/hkl/tmp-introspectjUVqQt/Hkl-5.0 -export-dynamic /home/picca/Projets/hkl/hkl/tmp-introspectjUVqQt/Hkl-5.0.o -L. libhkl.la -pthread -Wl,--export-dynamic -lgio-2.0 -lgthread-2.0 -lgmodule-2.0 -lrt -lgobject-2.0 -lglib-2.0
libtool: link: gcc -o /home/picca/Projets/hkl/hkl/tmp-introspectjUVqQt/.libs/Hkl-5.0 /home/picca/Projets/hkl/hkl/tmp-introspectjUVqQt/Hkl-5.0.o -pthread -Wl,--export-dynamic -Wl,--export-dynamic  -L. ./.libs/libhkl.so -lgio-2.0 -lgthread-2.0 -lgmodule-2.0 -lrt -lgobject-2.0 -lglib-2.0 -pthread
./.libs/libhkl.so: undefined reference to `__start_autodata_geometries'
./.libs/libhkl.so: undefined reference to `__stop_autodata_geometries'
collect2: error: ld returned 1 exit status
linking of temporary binary failed: Command '['/bin/bash', '../libtool', '--mode=link', '--tag=CC', 'gcc', '-o', '/home/picca/Projets/hkl/hkl/tmp-introspectjUVqQt/Hkl-5.0', '-export-dynamic', '/home/picca/Projets/hkl/hkl/tmp-introspectjUVqQt/Hkl-5.0.o', '-L.', 'libhkl.la', '-pthread', '-Wl,--export-dynamic', '-lgio-2.0', '-lgthread-2.0', '-lgmodule-2.0', '-lrt', '-lgobject-2.0', '-lglib-2.0']' returned non-zero exit status 1

so now the question: to your opinion what can be wrong with my code ?  I
I do not understand completly the section "magic" things so I can not
debug this all by myself.

Thanks for your help

Frederic

-- 
GPG public key 4096R/4696E015 2011-02-14
    fingerprint = E92E 7E6E 9E9D A6B1 AA31  39DC 5632 906F 4696 E015
uid  Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>

GPG public key 1024D/A59B1171 2009-08-11
    fingerprint = 1688 A3D6 F0BD E4DF 2E6B  06AA B6A9 BA6A A59B 1171
uid  Picca Frédéric-Emmanuel <picca at debian.org>


More information about the ccan mailing list