[EMAIL PROTECTED] wrote:
>Marc Wilhelm Kuester wrote:
>
>
>
>>Your analysis seems to me highly plausible, especially since the
>>application compiles and links OK under Linux with a newer gcc 4 (4.0.2
>>as opposed to Apple's 4.0.0 20041026). However, adding the public
>>member functions etc. did not cure the situation and I'm still groping
>>in the dark :-(
>>
>>
>
>According to a post here:
>
> http://blog.gmane.org/gmane.os.apple.fink.general/month=20050701
>
>...these errors may also happen when linking libraries or objects compiled
>with g++ 4.0 to ones compiled with g++ 3.3. There has been a standard on
>name mangling since g++ 3.0, I believe, but the details of that
>specification and its implementation do still vary a bit from release to
>release. So make sure you're using the exact same compiler version for
>libpqxx and your own application.
>
>
>
>
Thanks for the hint! That may be the case. Fink, for some reasons
unknown to me, does compile libpqxx with g++ 3.3.
>>I downloaded the 2.6.0 version, but ran into a compile-time error:
>>
>>-------
>>util.cxx: In function `const char* pqxx::internal::strerror_wrapper(int,
>>char*, size_t)':
>>util.cxx:727: error: invalid conversion from 'int' to 'const char*'
>>make[1]: *** [util.lo] Error 1
>>-------
>>
>>
>
>Aieee! This one has to do with a really, really nasty problem. There are
>at least three different kinds of strerror_r() about:
>
> * the AIX version, which is no big problem and so I'll ignore it here;
> * the Single Unix Specification or SUS one, which returns int;
> * the GNU version, which returns char *.
>
>Detecting the difference between the latter two at build time is really
>hard because they take the exact same arguments! This wouldn't be a
>problem if we could afford to ignore the returned value, but with the GNU
>version, we can't. We need special-case code for these, selected at build
>time.
>
>In your case, the configure script guessed (incorrectly!) that you have
>the GNU version--or at least that you don't have the SUS version. The
>guessing logic is supposed to check for situations where both checks fail,
>perhaps for entirely unrelated reasons such as compiler warnings, but
>perhaps this is a case that snuck through.
>
>Could you post the include/pqxx/config-compiler-internal.h and config.log
>(just the part that mentions strerror_r will do--the whole file would be a
>bit large) as generated for your system by the configure script?
>
>
>
Of course --- thanks for taking the time to look into the issue. Please
find the extracts attached to this mail (I hope that this list supports
attachments).
Best regards,
Marc
#define HAVE_SYS_TYPES_H 1
#define HAVE_UNISTD_H 1
#define PQXX_HAVE_COUNT_IF 1
#define PQXX_HAVE_C_NAN 1
#define PQXX_HAVE_GCC_VISIBILITY 1
#define PQXX_HAVE_LOCALE 1
#define PQXX_HAVE_NAN 1
#define PQXX_HAVE_QUIET_NAN 1
#define PQXX_HAVE_SLEEP 1
#define PQXX_HAVE_STRERROR_R 1
#define PQXX_HAVE_STRING_CLEAR 1
#define PQXX_HAVE_SYS_SELECT_H 1
#define PQXX_SELECT_ACCEPTS_NULL 1
#define PQXX_STRERROR_R_INT 1
configure:21853: g++ -c -g -O2 -Werror conftest.cc >&5
configure:21859: $? = 0
configure:21862: test -z || test ! -s conftest.err
configure:21865: $? = 0
configure:21868: test -s conftest.o
configure:21871: $? = 0
configure:21886: result: yes
configure:21891: checking for strerror_r
configure:21911: g++ -c -g -O2 -Werror conftest.cc >&5
configure:21917: $? = 0
configure:21920: test -z || test ! -s conftest.err
configure:21923: $? = 0
configure:21926: test -s conftest.o
configure:21929: $? = 0
configure:21939: result: yes
configure:21960: checking for SUSv3-style strerror_r returning int
configure:21979: g++ -c -g -O2 -Werror conftest.cc >&5
configure:21985: $? = 0
configure:21988: test -z || test ! -s conftest.err
configure:21991: $? = 0
configure:21994: test -s conftest.o
configure:21997: $? = 0
configure:22007: result: yes
configure:22011: checking for GNU-style strerror_r returning char *
configure:22030: g++ -c -g -O2 -Werror conftest.cc >&5
conftest.cc: In function `int main()':
conftest.cc:42: error: invalid conversion from 'int (*)(int, char*, size_t)' to
'char* (*)(int, char*, size_t)'
configure:22036: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "libpqxx"
| #define PACKAGE_TARNAME "libpqxx"
| #define PACKAGE_VERSION "2.6.0"
| #define PACKAGE_STRING "libpqxx 2.6.0"
| #define PACKAGE_BUGREPORT "Jeroen T. Vermeulen <[EMAIL PROTECTED]>"
| #define PACKAGE "libpqxx"
| #define VERSION "2.6.0"
| #ifdef __cplusplus
| extern "C" void exit (int);
| #endif
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_DLFCN_H 1
| #define PQXX_HAVE_GCC_VISIBILITY 1
| #define PGSTD std
| #define PQXX_HAVE_IOS 1
| #define PQXX_HAVE_STREAMBUF 1
| #define PQXX_HAVE_LOCALE 1
| #define PQXX_HAVE_CHAR_TRAITS 1
| #define PQXX_HAVE_CPP_PRAGMA_MESSAGE 1
| #define STDC_HEADERS 1
| #define HAVE_LIBPQ 1
| #define HAVE_LIBPQ 1
| #define HAVE_LIBPQ 1
| #define PQXX_HAVE_LO_TELL 1
| /* end confdefs.h. */
| #include <cstring>
| using namespace std;
| int
| main ()
| {
| char*(*f)(int,char*,size_t)=strerror_r;f(0,0,0)
| ;
| return 0;
| }
configure:22058: result: no
configure:22171: checking for long double
configure:22190: g++ -c -g -O2 -Werror conftest.cc >&5
_______________________________________________
Libpqxx-general mailing list
[email protected]
http://gborg.postgresql.org/mailman/listinfo/libpqxx-general