Closed GoogleCodeExporter closed 9 years ago
glog-0.3.0 failed to build using g++ 4.2 on Mac OS X 10.6.2. error message: /bin/sh ./libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H - I. -I./src -I./src -Wall -Wwrite-strings -Woverloaded-virtual -Wno- sign-compare -DNO_FRAME_POINTER -DNDEBUG -g -O2 -MT libglog_la- logging.lo -MD -MP -MF .deps/libglog_la-logging.Tpo -c -o libglog_la- logging.lo `test -f 'src/logging.cc' || echo './'`src/logging.cc g++ - DHAVE_CONFIG_H -I. -I./src -I./src -Wall -Wwrite-strings -Woverloaded- virtual -Wno-sign-compare -DNO_FRAME_POINTER -DNDEBUG -g -O2 - MT libglog_la-logging.lo -MD -MP -MF .deps/libglog_la-logging.Tpo -c src/logging.cc -fno-common -DPIC -o .libs/libglog_la-logging.o src/logging.cc: In function ‘int google::posix_strerror_r(int, char*, size_t)’’: src/logging.cc:1758: error: cast from ‘char*’ to ‘int’ loses precision srmake: *** [libglog_la-logging.lo] Error 1 this issue is related to #13 and #34. quick and dirty fix for this could be: --- src/logging.cc.orig 2010-02-22 17:40:24.000000000 +0900 +++ src/logging.cc 2010-02-22 17:40:35.000000000 +0900 @@ -1755,7 +1755,7 @@ } else { buf[0] = '\000'; #if defined(OS_MACOSX) || defined(OS_FREEBSD) || defined(OS_OPENBSD) - if (reinterpret_cast<int>(rc) < sys_nerr) { + if (reinterpret_cast<long int>(rc) < sys_nerr) { // This means an error on MacOSX or FreeBSD. return -1; } Even though it makes compilation successful, link phase still fails. /bin/sh ./libtool --tag=CXX --mode=link g++ -D_THREAD_SAFE - I/usr/local/include -Wall -Wwrite-strings -Woverloaded-virtual -Wno- sign-compare -DNO_FRAME_POINTER -g -O2 -D_THREAD_SAFE -o logging_unittest logging_unittest-logging_unittest.o libglog.la - L/usr/local/lib -lgtest -lpthread g++ -D_THREAD_SAFE -I/usr/local/include -Wall -Wwrite-strings - Woverloaded-virtual -Wno-sign-compare -DNO_FRAME_POINTER -g -O2 -D_THREAD_SAFE -o .libs/logging_unittest logging_unittest- logging_unittest.o -Wl,-bind_at_load ./.libs/libglog.dylib -L/usr/local/lib /usr/local/lib/libgtest.dylib -lpthread ld: warning: in /usr/local/lib/libgtest.dylib, file was built for i386 which is not the architecture being linked (x86_64) Undefined symbols: "testing::internal::AssertHelper::operator=(testing::Message const&) const", referenced from: CheckNOTNULL_Simple_Test::TestBody() in logging_unittest- logging_unittest.o LogWithLevels(int, int, bool, bool)in logging_unittest-logging_unittest.o LogWithLevels(int, int, bool, bool)in logging_unittest-logging_unittest.o LogWithLevels(int, int, bool, bool)in logging_unittest-logging_unittest.o LogWithLevels(int, int, bool, bool)in logging_unittest-logging_unittest.o LogWithLevels(int, int, bool, bool)in logging_unittest-logging_unittest.o LogWithLevels(int, int, bool, bool)in logging_unittest-logging_unittest.o LogWithLevels(int, int, bool, bool)in logging_unittest-logging_unittest.o LogWithLevels(int, int, bool, bool)in logging_unittest-logging_unittest.o LogWithLevels(int, int, bool, bool)in logging_unittest-logging_unittest.o ...
Original issue reported on code.google.com by mootoh on 22 Feb 2010 at 8:44
mootoh
Original issue reported on code.google.com by
mootoh
on 22 Feb 2010 at 8:44