What I had to do was add "#include <string.h>" to both
src/main/cpp/inputstreamreader.cpp and
src/main/cpp/socketoutputstream.cpp.  This made both to compile fine. 

The next snag I ran into was in the examples and test directory.  They
had problems finding stdin:
creating stream
if g++ -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\"
-DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"log4cxx\"
-DVERSION=\"0.10.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1
-DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1
-DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1
-DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1  -I. -I.
-I../../../src/main/include -I../../../src/main/include  -DLINUX=2
-D_REENTRANT -D_GNU_SOURCE  -I/tmp/apr-1.3.9/include
-I/tmp/apr-util-1.3.9/include -I/tmp/apr-util-1.3.9/xml/expat/lib  -g
-O2 -MT console.o -MD -MP -MF ".deps/console.Tpo" -c -o console.o
console.cpp; \
        then mv -f ".deps/console.Tpo" ".deps/console.Po"; else rm -f
".deps/console.Tpo"; exit 1; fi
console.cpp: In function 'int main(int, char**)':
console.cpp:58: error: 'puts' was not declared in this scope
console.cpp:63: error: 'strcmp' was not declared in this scope
console.cpp:66: error: 'stderr' was not declared in this scope
console.cpp:66: error: 'stdout' was not declared in this scope
console.cpp:66: error: 'fputs' was not declared in this scope
console.cpp:69: error: 'stderr' was not declared in this scope
console.cpp:69: error: 'stdout' was not declared in this scope
console.cpp:102: error: 'stderr' was not declared in this scope
console.cpp:102: error: 'stdout' was not declared in this scope
console.cpp:104: error: 'stderr' was not declared in this scope
console.cpp:104: error: 'stdout' was not declared in this scope
console.cpp:107: error: 'stderr' was not declared in this scope
console.cpp:107: error: 'fputs' was not declared in this scope
console.cpp:110: error: 'fflush' was not declared in this scope
make[3]: *** [console.o] Error 1
make[3]: Leaving directory `/tmp/apache-log4cxx-0.10.0/src/examples/cpp'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/tmp/apache-log4cxx-0.10.0/src/examples'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/apache-log4cxx-0.10.0/src'
make: *** [all-recursive] Error 1

I decided instead of searching for which include was messed up, I'd just
remove the folder from the build.  I don't need either directory.  Both
of these makefiles are made when configure is called, is there any way
that we could add something like a --no-test and a --no-example flag to
the configure?  This would help speed up the build process.  I don't
mind helping hunt down this problem too.

:: Ryan Neal

-----Original Message-----
From: Curt Arnold [mailto:[email protected]] On Behalf Of Curt Arnold
Sent: Friday, January 15, 2010 6:49 PM
To: Log4CXX Dev
Subject: Re: Cross compiling Log4Cxx with APR/APU


On Jan 15, 2010, at 6:38 PM, NEAL, RYAN wrote:

>  
> Hello,
>  
> I am trying to cross compile log4cxx for the powerpc, and am running
into some build errors that I can't understand.
>  
> I am using APR/APU 1.3.9 - both compiled without issue.  I am having
the problem that the iconv in APU is not working.  To prove that this
all works I have started to try and just compile Log4cxx.  I first got
an error about the charsetdecoder.   I updated the APU to have the
-with-conv=/usr/include - allowing it to get the file iconv.h.   
>  
> Now under normal compilation (gcc 4.4) I get this error:
>         then mv -f ".deps/inputstreamreader.Tpo"
".deps/inputstreamreader.Plo"; else rm -f ".deps/inputstreamreader.Tpo";
exit 1; fi
>  g++ -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\"
-DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"log4cxx\"
-DVERSION=\"0.10.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1
-DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1
-DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1
-DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -I. -I.
-I../../../src/main/include -I../../../src/main/include -DLINUX=2
-D_REENTRANT -D_GNU_SOURCE -I/tmp/apr-1.3.9/include
-I/tmp/apr-util-1.3.9/include -I/tmp/apr-util-1.3.9/xml/expat/lib -g -O2
-MT inputstreamreader.lo -MD -MP -MF .deps/inputstreamreader.Tpo -c
inputstreamreader.cpp  -fPIC -DPIC -o .libs/inputstreamreader.o
> inputstreamreader.cpp: In member function 'virtual log4cxx::LogString
log4cxx::helpers::InputStreamReader::read(log4cxx::helpers::Pool&)':
> inputstreamreader.cpp:66: error: 'memmove' was not declared in this
scope
> make[3]: *** [inputstreamreader.lo] Error 1
> make[3]: Leaving directory `/tmp/apache-log4cxx-0.10.0/src/main/cpp'
> make[2]: *** [all-recursive] Error 1
> make[2]: Leaving directory `/tmp/apache-log4cxx-0.10.0/src/main'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/tmp/apache-log4cxx-0.10.0/src'
> make: *** [all-recursive] Error 1
>  
>  
> I can't seem to find a solution online to this.  Any ideas?
>  
> :: Ryan Neal
>  



Check where memmove is defined in your compile environment by doing
"grep memmove /usr/include".  On gcc 4.2.1 on Mac OS/X i386 it is in
string.h.  Try adding an explicit include of that file into
inputstreamreader.cpp and see if that resolves the problem.  Let the
list know and so we can patch.


Reply via email to