[ccan] autodata problem

PICCA Frédéric-Emmanuel frederic-emmanuel.picca at synchrotron-soleil.fr
Wed Mar 13 08:55:52 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);

---

from the configure 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 do not understand completly the section "magic" things so I can not debug this all by myself

Thanks for your help

Frederic


More information about the ccan mailing list