You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-user@logging.apache.org by "Steck, David" <da...@lmco.com> on 2005/07/06 20:43:12 UTC

Errors Building with gcc 3.4.3 (@ token in preprocessor expressions)

All,

After learning about log4cxx and reading the introduction, I was quite excited to start using it.  But, given the warning on the homepage, I decided to wait for version 0.9.8 to come out.  After months of waiting, I finally downloaded the CVS HEAD.  When is the next version expected to be released?

I am having trouble building from the CVS HEAD.  I'm working on a RedHat Enterprise Linux Core 4 box, using gcc 3.4.3 (which I've noticed is a lot more picky than the version in RedHat 9.0).  With a quick search through the mailing list archives, I didn't see this issue, but please direct me there if I missed it.

I'm building with configure/make, since I don't have ant.  When building, I get the following errors:

 g++ -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"log4cxx\" -DVERSION=\"0.9.8\" -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 -DHAVE_LIBBOOST_REGEX=1 -DHAVE_BOOST_REGEX_HPP=1 -DHAVE_UNISTD_H=1 -DHAVE_ALLOCA_H=1 -DHAVE_PTHREAD=1 -DHAVE_THREAD=1 -DHAVE_LIBXML2=1 -DHAVE_XML=1 -I. -I. -I../include -I../include -I/usr/include/libxml2 -DLOG4CXX -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/home/dsteck/projects/log4cxx/APR/apr-1.1.1/include -I/home/dsteck/projects/log4cxx/APR/apr-util-1.1.2/include -D_REENTRANT -g -O2 -MT action.lo -MD -MP -MF .deps/action.Tpo -c action.cpp  -fPIC -DPIC -o .libs/action.o
In file included from ../include/log4cxx/logstring.h:21,
                 from ../include/log4cxx/helpers/object.h:20,
                 from ../include/log4cxx/helpers/objectimpl.h:20,
                 from ../include/log4cxx/rolling/action.h:21,
                 from action.cpp:17:
../include/log4cxx/log4cxx.h:28:5: token "@" is not valid in preprocessor expressions
In file included from ../include/log4cxx/helpers/object.h:20,
                 from ../include/log4cxx/helpers/objectimpl.h:20,
                 from ../include/log4cxx/rolling/action.h:21,
                 from action.cpp:17:
../include/log4cxx/logstring.h:23:33: token "@" is not valid in preprocessor expressions
../include/log4cxx/logstring.h:36:5: token "@" is not valid in preprocessor expressions
make[1]: *** [action.lo] Error 1


In the hopes of finding a quick fix, I removed the @ symbols in log4cxx.h (without exploring why they're there).  The compile continued, but resulted in this error (which seems to probably be a result of my change):

 g++ -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"log4cxx\" -DVERSION=\"0.9.8\" -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 -DHAVE_LIBBOOST_REGEX=1 -DHAVE_BOOST_REGEX_HPP=1 -DHAVE_UNISTD_H=1 -DHAVE_ALLOCA_H=1 -DHAVE_PTHREAD=1 -DHAVE_THREAD=1 -DHAVE_LIBXML2=1 -DHAVE_XML=1 -I. -I. -I../include -I../include -I/usr/include/libxml2 -DLOG4CXX -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/home/dsteck/projects/log4cxx/APR/apr-1.1.1/include -I/home/dsteck/projects/log4cxx/APR/apr-util-1.1.2/include -D_REENTRANT -g -O2 -MT appenderattachableimpl.lo -MD -MP -MF .deps/appenderattachableimpl.Tpo -c appenderattachableimpl.cpp  -fPIC -DPIC -o .libs/appenderattachableimpl.o
In file included from ../include/log4cxx/logger.h:23,
                 from ../include/log4cxx/spi/loggingevent.h:23,
                 from appenderattachableimpl.cpp:19:
../include/log4cxx/level.h: In member function `virtual const log4cxx::LevelPtr& log4cxx::Level::LevelClass::toLevel(const log4cxx::LogString&) const':
../include/log4cxx/level.h:69: error: no matching function for call to `log4cxx::Level::toLevel(const std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >&)'
../include/log4cxx/level.h:91: note: candidates are: static const log4cxx::LevelPtr& log4cxx::Level::toLevel(const std::string&)
../include/log4cxx/level.h:100: note:                 static const log4cxx::LevelPtr& log4cxx::Level::toLevel(int)
../include/log4cxx/level.h:106: note:                 static const log4cxx::LevelPtr& log4cxx::Level::toLevel(int, const log4cxx::LevelPtr&)
../include/log4cxx/level.h:114: note:                 static const log4cxx::LevelPtr& log4cxx::Level::toLevel(const std::string&, const log4cxx::LevelPtr&)
make[1]: *** [appenderattachableimpl.lo] Error 1


Can anyone explain the @ symbols or help with these errors?

Thank you,
-David Steck

Re: Errors Building with gcc 3.4.3 (@ token in preprocessor expressions)

Posted by Andreas Fester <An...@gmx.de>.
David,

I feel somehow guilty for that issue ;-)

For the moment, it would be best if you use my daily dist-tarball
from http://littletux.homelinux.org/log4cxx/. It is identical to
the CVS head, but contains some additional patches, and also already
contains the configure script (no need to run autogen.sh). After
unpacking, a

$ ./configure --with-apr=pathToApr --with-aprutil=pathToAprUtil
--with-logchar=wchar_t

should properly configure the package (at least one other log4cxx
user succeeded with that approach). Then, simply run "make".

The @ are used to define replacement patterns in .in files
and are usually replaced by "configure". Currently one of them
is missed and makes its way into the final .h file ....

Best Regards,

	Andreas

Steck, David wrote:
[...]
 > preprocessor expressions ../include/log4cxx/logstring.h:36:5: token
 > "@" is not valid in preprocessor expressions make[1]: *** [action.lo]
 > Error 1
 >

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