[maemo-developers] Help getting round compiler a error (compiling CLN)

From: Simon Pickering S.G.Pickering at bath.ac.uk
Date: Tue Nov 13 18:07:18 EET 2007
Thank you both for your ideas,

> > Duplicate symbols during linking is normally cause by 
> having code/functions 
> > with the same name in to different object files. This could 
> again be caused 
> > in general having problems with code in headers or wrong 
> includes, like for 
> > example having functions in headers that are not marked as 
> inline or using 
> > defines that contain whole functions or similar... 

Yes, the function is implemented in more than one source module, this is
because there are different implementations for different input variable
types (e.g. integer, floating point, very large).

I don't know what level of trickery should be needed to get this to work (or
not in this case) but in the CLN thread they were talking about a compiler
error to do with the "inline" keyword.

> If that fails, see that the Makefile does not list any object 
> file more
> than once per link target ... had that happen once, too, and it took
> quite a long time figure out, because the Makefile was generated by
> autotools (or more specifically configure).

No object file is listed more than once. Thanks for the tip though.

If I compile the library statically, which was one of the suggestions of how
to get round this problem, whatever I try to link against this library will
only pull out and link the individual object files it needs to use. I
suppose my problem comes because it uses more than one object file with the
same function definition (i.e. one for integers one for floating point

I thought that the use of the "inline" keyword for a function should
completely remove any mention of such a function from the relocation table?
Can anyone think why such a function would end up in the relocation table
(and then start causing these duplicated symbol errors)? From the CLN
mailing list it appears that the same thing happens on Darwin (MacOS). Is
this likely to be a compiler bug?



More information about the maemo-developers mailing list