I compiled Sage on two nearly identical machines at school.  One 
succeeded, the other failed building givaro (see make output below).

I did a quick Google search on the error message, and one author called 
this the "dangling extern "C" syndrome."  Sure enough, the givaro header 
<gmp++.h> (see below) has an extern "C" section enclosing an include of 
gmp.h -- which #include's C++ libraries.  I thought I had a decent 
knowledge of C/C++, and I don't see how this could have *worked* on the 
other machine.  I'm using GCC 4.1.2 on both machines.

Any help or hints are appreciated.  Thanks!

- Ryan

-- make output --
g++ -DHAVE_CONFIG_H -I. -I../../.. -I../../.. -DGMP_VERSION_3 
-I../../../src/kernel/memory -I../../../src/kernel/system 
-I/path/sage-4.1/local//include -fPIC -I/path/sage-4.1/local/include -MT 
gmp++_int_div.lo -MD -MP -MF .deps/gmp++_int_div.Tpo -c gmp++_int_div.C 
  -fPIC -DPIC -o .libs/gmp++_int_div.o
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/x86_64-redhat-linux/bits/c++locale.h:67:
 
error: template with C linkage
... (lots of similar errors)
make[5]: *** [gmp++_int_div.lo] Error 1
make[5]: Leaving directory 
`/path/sage-4.1/spkg/build/givaro-3.2.13rc2/src/src/kernel/gmp++
-- end make output --

Here is the source code that I think is causing the problem:

-- gmp++.h --
#ifdef __GIVARO_GMP_VERSION_3 

extern "C" { 

#endif 

 

#include "gmp.h" 

 

#ifdef __GIVARO_GMP_VERSION_3 

} 

#endif 

-- end gmp++.h snippet --

and then <gmp.h> has

-- gmp.h --
#if defined (__cplusplus) 

#include <iosfwd>   /* for std::istream, std::ostream, std::string */ 

#include <cstdio> 

#endif 

-- end gmp.h snippet --

My configuration:

-- shell --
$ g++ -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man 
--infodir=/usr/share/info --enable-shared --enable-threads=posix 
--enable-checking=release --with-system-zlib --enable-__cxa_atexit 
--disable-libunwind-exceptions --enable-libgcj-multifile 
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada 
--enable-java-awt=gtk --disable-dssi --enable-plugin 
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre 
--with-cpu=generic --host=x86_64-redhat-linux
Thread model: posix
gcc version 4.1.2 20080704 (Red Hat 4.1.2-44)

$ uname -srp
Linux 2.6.29-2 x86_64
-- end shell --

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to