Multiple definitions. Code issue

Pavel Roskin proski at gnu.org
Tue Apr 17 23:12:36 EDT 2007


On Tue, 2007-04-17 at 11:20 +0200, ahuguet at cttc.es wrote:
> First, I attach the errors when compiling:
> 
>   LD [M]  /usr/src/linux-source-2.6.17/drivers/net/wireless/hostap/hostap.o
> /usr/src/linux-source-2.6.17/drivers/net/wireless/hostap/hostap_80211_tx.o:(.bss+0x0):
> multiple definitions of `last_data_rx'
[skip]
> So, at hostap_80211.h I defined the following:
> 
> struct sk_buff *last_data_rx;
> 
> The line #endif /* HOSTAP_80211_H */ goes just after my declaration.

This means that every C file that includes that file will have its own
copy of last_data_rx.  Move it to one of the C files and use the
"extern" declaration in the header.

And if you want you code to work with more than one card, please avoid
global data altogether and put the new variables to the structure
specific to the card.  In case of hostap, it's struct local_info in
hostap_wlan.h.

-- 
Regards,
Pavel Roskin




More information about the HostAP mailing list