Opened 15 years ago

Last modified 15 years ago

#3083 closed defect

configure: geos_c not found because C is used instead of C++ — at Version 1

Reported by: fgenolini Owned by: chaitanya
Priority: normal Milestone: 1.7.0
Component: ConfigBuild Version: svn-trunk
Severity: normal Keywords: geos
Cc: warmerdam

Description (last modified by warmerdam)

GEOS fails to be enabled in gdal configure because geos_c test compiled with C instead of C++ compiler

Linux hostname 2.6.28-13-generic #45-Ubuntu SMP Tue Jun 30 19:49:51 UTC 2009 i686 GNU/Linux Ubuntu 9.04

gdal obtained from SVN trunk on Tuesday 28th July 2009 VERSION 1.7.0

Running configure with the following parameters:

./configure --verbose --prefix=/usr/local --with-swig --with-python --with-geos=yes --with-threads --with-perl

issue (config.log output):

configure:27063: checking for GEOSversion in -lgeos_c
configure:27099: gcc -o conftest -I/usr/local/include   conftest.c -lgeos_c
       -L/usr/local/lib -lgeos_c >&5
/usr/local/lib/libgeos_c.so: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)@GLIBCXX_3.4.9'
/usr/local/lib/libgeos-3.1.1.so: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::basic_ostream<char, std::char_traits<char> >::_M_insert<long double>(long double)@GLIBCXX_3.4.9'
/usr/local/lib/libgeos-3.1.1.so: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::basic_ostream<char, std::char_traits<char> >::_M_insert<void const*>(void const*)@GLIBCXX_3.4.9'
/usr/local/lib/libgeos-3.1.1.so: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::basic_ostream<char, std::char_traits<char> >::_M_insert<unsigned long>(unsigned long)@GLIBCXX_3.4.9'
/usr/local/lib/libgeos-3.1.1.so: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::basic_ostream<char, std::char_traits<char> >::_M_insert<double>(double)@GLIBCXX_3.4.9'
collect2: ld returned 1 exit status
configure:27105: $? = 1
configure: failed program was:
| /* confdefs.h.  */
| #define PACKAGE_NAME ""
[... lots of lines removed for clarity]
| #define HAVE_JPEGLIB_H 1
| /* end confdefs.h.  */
|
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char GEOSversion ();
| int
| main ()
| {
| return GEOSversion ();
|   ;
|   return 0;
| }
configure:27123: result: no

kludge (not proper fix): modify configure at line 27059 and make the test run with C++ instead of C by changing the test compiler to CXX and the parser to CXXPP

ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'

this runs the test as C++ and the test now passes and GEOS is now enabled in gdal

Change History (1)

comment:1 by warmerdam, 15 years ago

Cc: warmerdam added
Description: modified (diff)
Keywords: geos added
Owner: changed from warmerdam to chaitanya

Chaitanya,

Please attempt to reproduce this problem, and if you can, apply the suggested fix - but properly in the configure.in file. Consider whether this belongs in 1.6 branch as well.

Note: See TracTickets for help on using tickets.