logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Sewell" <David.Sew...@Citihub.com>
Subject RE: log4cxx-CVS with stlport-4.6 application build fails
Date Wed, 22 Jun 2005 16:40:47 GMT
Andreas,
 
I'm using the following build processes.
 
With the packages and test app installed in the following directories:
 
log4cxx-CVS = ./log4cxx
stlport-4.6 = ./stlport
test app = ./log4cxx_sample
 
log4cxx build process (I had to upgrade autoconf to 2.59):
cd log4cxx; ant build
 
stlport build process (using gcc.mak file, gcc-linux.mak fails):
cd ../stlport/src; make -f gcc.mak
 
I have not successfully integrated stlport with the log4cxx build process, I've tried using
the automake approach which may allow me to add the stlport support via CXXFLAGS the LDFLAGS
environment variables but the configure process fails in config.status (another problem I
can't solve). This is probably the root cause of my problems. Does stlport support need to
be built into the log4cxx libraries?
 
Once log4cxx and stlport are built I can build the test application. Source and makefile are
attached below.
 
e.g.
cd ../log4cxx_sample; make
 
Thanks,
David
 
/************************************************
 * file: main.cpp
 ************************************************/
#include <log4cxx/logger.h>
#include <log4cxx/basicconfigurator.h>
#include <log4cxx/helpers/exception.h>
using namespace log4cxx;
using namespace log4cxx::helpers;
LoggerPtr logger(Logger::getLogger("Test"));
int main(int argc, char **argv)
{
 int result = EXIT_SUCCESS;
 try
 {
  BasicConfigurator::configure();
  LOG4CXX_INFO(logger, "Entering application");
  LOG4CXX_INFO(logger, "Exiting application");
 }
 catch(Exception&)
 {
  result = EXIT_FAILURE;
 }
 
 return result;
}

#################################################

# file: Makefile

#################################################

SHELL=/bin/bash

LOG4CXX_LINK_PREFIX=../log4cxx
STLPORT_LINK_PREFIX=../stlport

CXX=g++
CXX_FLAGS=-g -Wall -DLINUX -Wno-ctor-dtor-privacy
INCLUDES=-I$(LOG4CXX_LINK_PREFIX)/include -I${STLPORT_LINK_PREFIX}/stlport
LIBS=-L$(STLPORT_LINK_PREFIX)/lib -lstlport_gcc
LOG4CXX_LIBS=-L$(LOG4CXX_LINK_PREFIX)/build/debug/shared -llog4cxx
SRCS := $(wildcard ./*.cpp)
OBJS := $(patsubst %.cpp,%.o,$(SRCS))

%.o: %.cpp
 @if [ `uname` = "SunOS" ]; \
        then \
                $(CXX) $(CXX_FLAGS) $(INCLUDES) -o $@ -c $<; \
        else \
                $(CXX) $(CXX_FLAGS) $(INCLUDES) -DLINUX -o $@ -c $<; \
        fi

all: log4cxx_sample

clean_all: clean all

log4cxx_sample: $(OBJS)
 $(CXX) $(CXX_FLAGS) $(INCLUDES) $(LOG4CXX_LIBS)  $(LIBS) -o log4cxx_sample $(OBJS)

clean:
 rm log4cxx_sample *.o



________________________________

From: Andreas Fester [mailto:Andreas.Fester@gmx.de]
Sent: Wed 22/06/2005 16:40
To: Log4CXX User; David Sewell
Subject: Re: log4cxx-CVS with stlport-4.6 application build fails



David,

I would be interested in running a build test :-)
I run Debian GNU/Linux 3.1, but lets see if I can
reproduce the issue.

Can you provide some more information how you configured
log4cxx? Do you use the ant build (and if so, how do you
integrate stlport) or the automake approach (and also,
if so, how do you integrate stlport)?

Regards,

        Andreas

David Sewell wrote:
> I am trying to integrate log4cxx-CVS with an application that uses
> stlport-4.6 on Linux (redhat es3) using g++ (3.2.3), however when I
> add the stlport support to the compile line, the build fails with
> "undefined reference" errors from the log4cxx library.
>
> I have rebuilt both log4cxx and stlport numerous times, as a test
> case I have used the BasicConfigurator example from the log4cxx
> documentation. This compiles and runs without the
> '-I../stlport/stlport' flag but fails with the below error when the
> flag is present. I can compile and run other applications using
> stlport with no problems.
>
> I have searched all bug/support archives for both log4cxx and
> stlport, the only documented issues that reference both libraries
> don't seem to be relevant. I'm now at a loss as to what to do.
>
> Can someone confirm if log4cxx-CVS is known to work with stlport-4.6
> on Linux?
>
> Any suggestions for what may be wrong and how I can resolve the
> problem would be appreciated.
>
> I can include my test case source code and makefile if anyone has a
> suitable environment and is interested in running a build test.
>
> Thanks, David
>
> Example Compile Failure:
>
> g++ -g -Wall -DLINUX -Wno-ctor-dtor-privacy -I../log4cxx/include
> -I../stlport/stlport -L../log4cxx/build/debug/shared -llog4cxx  -o
> log4cxx_sample main.o com/foo/bar.o  -L../stlport/lib -lstlport_gcc
> main.o(.text+0x97): In function `main':
> ../log4cxx/include/log4cxx/helpers/objectptr.h:88: undefined
> reference to
> `log4cxx::Logger::forcedLog(log4cxx::helpers::ObjectPtrT<log4cxx::Level>
> const&, _STL::basic_string<char, _STL::char_traits<char>,
> _STL::allocator<char> > const&, log4cxx::spi::LocationInfo const&)'
> main.o(.text+0x1a0): In function `main':
> /disk2/data/eclipse/workspace/log4cxx_sample/main.cpp:23: undefined
> reference to
> `log4cxx::Logger::forcedLog(log4cxx::helpers::ObjectPtrT<log4cxx::Level>
> const&, _STL::basic_string<char, _STL::char_traits<char>,
> _STL::allocator<char> > const&, log4cxx::spi::LocationInfo const&)'
> com/foo/bar.o(.text+0x87): In function `com::foo::Bar::doIt()':
> ../log4cxx/include/log4cxx/helpers/objectptr.h:88: undefined
> reference to
> `log4cxx::Logger::forcedLog(log4cxx::helpers::ObjectPtrT<log4cxx::Level>
> const&, _STL::basic_string<char, _STL::char_traits<char>,
> _STL::allocator<char> > const&, log4cxx::spi::LocationInfo const&)'
> collect2: ld returned 1 exit status make: *** [log4cxx_sample] Error
> 1
>
>
>
>


--
Andreas Fester
mailto:Andreas.Fester@gmx.de
WWW: http://littletux.homelinux.org
ICQ: 326674288





Mime
View raw message