[Gambas-devel] linkage errors with updated gcc-4.1 versions
Benoit Minisini
gambas at ...1...
Thu Jul 13 14:51:56 CEST 2006
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...
All XX_INTERFACE variable must be declared with a "C" linkage. So it is just a
matter of adding some 'extern "C"' to each interface declaration.
I will do it for the next release.
Regards,
--
Benoit Minisini
More information about the Devel
mailing list