[tlbuild] Compiling texk/dvisvgm/dvisvgm-1.2/src/dvisvgm/FileFinder.cpp under Solaris

Apostolos Syropoulos asyropoulos at gmail.com
Sun Mar 31 23:34:43 CEST 2013


Hello,

I have finally found what is wrong and why file FileFinder.cpp
of dvisvgm does not compile on Solaris with gcc 4.7.2. According to

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=1773

only recently g++ defined the symbol __cplusplus
to be equal to 199711L, something that SunStudio
did for quite some time. Now, when one includes
<string.h> this includes <iso/string_iso.h> which
does some "strange" things:

#ifdef	__cplusplus  extern "C" {
#endif#if __cplusplus >= 199711L  namespace std { // <-- This is line 55#endif

In order to "solve" the problem

And it is exactly this line that gives the following errors:

yy.cpp: In function ‘int main()’:
yy.cpp:13:3: σφάλμα: reference to ‘std’ is ambiguous
<built-in>:0:0: σφάλμα: candidates are: namespace std { }
In file included from /usr/include/string.h:33:0,
                 from c-memstr.h:26,
                 from yy.cpp:7:
/usr/include/iso/string_iso.h:55:15: σφάλμα:                 namespace
KPS::std { }
yy.cpp:13:3: σφάλμα: reference to ‘std’ is ambiguous
<built-in>:0:0: σφάλμα: candidates are: namespace std { }
In file included from /usr/include/string.h:33:0,
                 from c-memstr.h:26,
                 from yy.cpp:7:
/usr/include/iso/string_iso.h:55:15: σφάλμα:                 namespace
KPS::std { }
yy.cpp:13:15: σφάλμα: expected ‘;’ before ‘x’
yy.cpp:15:3: σφάλμα: reference to ‘std’ is ambiguous
<built-in>:0:0: σφάλμα: candidates are: namespace std { }
In file included from /usr/include/string.h:33:0,
                 from c-memstr.h:26,
                 from yy.cpp:7:
/usr/include/iso/string_iso.h:55:15: σφάλμα:                 namespace
KPS::std { }
yy.cpp:15:3: σφάλμα: reference to ‘std’ is ambiguous
<built-in>:0:0: σφάλμα: candidates are: namespace std { }
In file included from /usr/include/string.h:33:0,
                 from c-memstr.h:26,
                 from yy.cpp:7:
/usr/include/iso/string_iso.h:55:15: σφάλμα:                 namespace
KPS::std { }
yy.cpp:15:28: σφάλμα: ‘__cpluplus’ was not declared in this scope
yy.cpp:15:42: σφάλμα: reference to ‘std’ is ambiguous
<built-in>:0:0: σφάλμα: candidates are: namespace std { }
In file included from /usr/include/string.h:33:0,
                 from c-memstr.h:26,
                 from yy.cpp:7:
/usr/include/iso/string_iso.h:55:15: σφάλμα:                 namespace
KPS::std { }
yy.cpp:15:42: σφάλμα: reference to ‘std’ is ambiguous
<built-in>:0:0: σφάλμα: candidates are: namespace std { }
In file included from /usr/include/string.h:33:0,
                 from c-memstr.h:26,
                 from yy.cpp:7:
/usr/include/iso/string_iso.h:55:15: σφάλμα:                 namespace
KPS::std { }

The attached file contains a simple patch, which would not affect anyone
using any version of GCC prior to 4.7.2. Of course this enables me to
compile but I would like to understand why this happens.  Surprisingly,
when compiling the simple test source file that I have used to reproduce the
error with the SunStudio C++ compile I get the following error:

"yy.cpp", line 15: Error: __cpluplus is not defined.



Regards,
A.S.

-- 
Apostolos Syropoulos
Xanthi, GREECE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/tlbuild/attachments/20130401/5120994c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FileFinder.patch
Type: application/octet-stream
Size: 789 bytes
Desc: not available
URL: <http://tug.org/pipermail/tlbuild/attachments/20130401/5120994c/attachment.obj>


More information about the tlbuild mailing list