[Gambas-devel] linkage errors with updated gcc-4.1 versions

José L. Redrejo Rodríguez jredrejo at ...101...
Thu Jul 13 17:05:47 CEST 2006


El jue, 13-07-2006 a las 14:54 +0200, Benoit Minisini escribió:
> On Thursday 13 July 2006 11:35, José L. Redrejo Rodríguez wrote:
> > Hi, Benoît, Compiling gambas 1.9.33 with current gcc-4.1 versions causes
> > the compilation fail due to some restrictions in the scope of the
> > variables declaration.
> > The fails are explained here:
> > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27227#c8
> >
> > The errors I get are:
> > gstring.h: At global scope:
> > gstring.h:32: error: previous declaration of 'GB_INTERFACE GB' with 'C
> > ++' linkage
> > main.cpp:48: error: conflicts with new declaration with 'C' linkage
> > gstring.h:33: error: previous declaration of 'QT_INTERFACE QT' with 'C
> > ++' linkage
> > main.cpp:49: error: conflicts with new declaration with 'C' linkage
> > make[6]: *** [main.lo] Error 1
> >
> >
> > According to the above link, it seems that the new versions of gcc are
> > applying this restriction:
> > The standard says in 7.5/5: "If two declarations of the same function or
> > object
> > specify different linkage-specifications [...] the program is ill-formed if
> > the declarations appear in the same translation unit [...]"
> >
> > Maybe this problem will appear in more parts of the code...
> 
> Is it better with this 'gstring.h' file ?

almost ;-). gstring.h is ok, but the same error has appeared in garray.h
& main.h in the same directory. Doing the fix you applied to gstring.h
has compiled ok.

Attached is the complete patch file to fix all the errors.

Thanks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 05_fix_scope.patch
Type: text/x-patch
Size: 1092 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/devel/attachments/20060713/97494793/attachment.bin>


More information about the Devel mailing list