[vdr] [OT] Linker Problem
udo_richter at gmx.de
Mon Jan 9 14:42:36 CET 2006
> Hi all,
> after splitting my autosort.c into several [hc]-files i ran into trouble
> with ld.
> can anybody give me a hint how to solve this??
> autogroup.o(.bss+0x0):../../../include/vdr/tools.h:217: multiple
> definition of `AutoGroups'
> first defined here
well... you can have only one (exported, non-static) AutoGroups variable
across all modules, just as the error says. Currently, autogroup.o and
autosort.o export a symbol named 'AutoGroups', and the linker doesn't
know which one to prefer. Hard to guess whats wrong without seeing the code.
My guess, you've copied the declaration
into the header file. If you want to declare global variables in a
header file, you have to declare
extern cAutoGroups AutoGroups;
in the .h file (for import and forward declaration) and another
in the .c file (the actual declaration).
More information about the vdr