manuel aldana | 2 Aug 2006 19:18
Picon
Picon
Gravatar

compiling problem with VS 2005

hi,

i've got VS 2005 installed and cannot compile log4cxx (HEAD revision).
in all build files (build.xml, apr-build.xml, aprutil-build.xml) i set 
debug property to false.

while running ant i get following build error, which hint on the line 
number of aprutil-build.xml does not help me really:
-------------------------------
BUILD FAILED
C:\Dokumente und 
Einstellungen\manuel\Desktop\downloads\log4cxx\build.xml:556: T
he following error occurred while executing this line:
C:\Dokumente und 
Einstellungen\manuel\Desktop\downloads\log4cxx\aprutil-build.xm
l:207: cl failed with return code -1073741515
-------------------------------

thanks a lot (maybe even somebody has got a compiled release-windows 
version of log4cxx...)

--

-- 
  manuel aldana
  aldana <at> gmx.de
  aldana <at> cs.tu-berlin.de
  check out my site -> http://www.aldana-online.de

Andreas Fester | 2 Aug 2006 20:38
Picon
Favicon

Re: compiling problem with VS 2005

manuel aldana wrote:
> hi,
> 
> i've got VS 2005 installed and cannot compile log4cxx (HEAD revision).
> in all build files (build.xml, apr-build.xml, aprutil-build.xml) i set
> debug property to false.
> 
> while running ant i get following build error, which hint on the line
> number of aprutil-build.xml does not help me really:

try running ant -v. This gives additional output, including the command
line which was used for calling the compiler.

> -------------------------------
> BUILD FAILED
> C:\Dokumente und
> Einstellungen\manuel\Desktop\downloads\log4cxx\build.xml:556: T
> he following error occurred while executing this line:
> C:\Dokumente und
> Einstellungen\manuel\Desktop\downloads\log4cxx\aprutil-build.xm
> l:207: cl failed with return code -1073741515
> -------------------------------
> 
> thanks a lot (maybe even somebody has got a compiled release-windows
> version of log4cxx...)

Thats a thing I wanted to do for a long time, but currently the build
seems to fail due to a removed patch file for apr-util... I have
to check this...

(Continue reading)

manuel aldana | 3 Aug 2006 02:21
Picon
Picon
Gravatar

Re: compiling problem with VS 2005

> try running ant -v. This gives additional output, including the command
> line which was used for calling the compiler.

i did it, wasn't much more helpful. anyway, somebody was so nice sent me 
the binaries now.

> Thats a thing I wanted to do for a long time, but currently the build
> seems to fail due to a removed patch file for apr-util... I have
> to check this...

yes, that is a good idea. i am sure many people are spending a long time 
on same problems... but never the less thanks(!) for supporting the 
log-framework and your effort (you at least some spent in your free time).

--

-- 
  manuel aldana
  aldana <at> gmx.de
  aldana <at> cs.tu-berlin.de
  check out my site -> http://www.aldana-online.de
	

Klaus Dums | 4 Aug 2006 08:29
Picon

build on VS2005, Multi-threaded, static, Linker errors, unresolved external, already defined, Visual Studio 2005

The problem:
    Compile an exe without dependece on any dll ( eg: MSVCP80.DLL).
    Therefore I wanted to compile with option /MT and /MTd. But log4cxx
is compiled with /MD or /MDd to use a dll.
    The build output can be seen if you start ant with '-verbose'.
    So I got loads of linker errors.

The solution:
    Alter files:  apr-build.xml, aprutil-build.xml, build.xml.
    Add to those files in the compiler section the option: runtime="static".
    This changes the compiler option from /MD to /MT.
    Eg:
    --snip--
    <cc name="${compiler}"
                exceptions="true"
                outfile="${log4cxx.lib.dir}/log4cxx${lib-suffix}"
                subsystem="console"
                multithreaded="true"
                outtype="${lib.type}"
                objdir="${log4cxx.lib.dir}/log4cxx_obj"
                debug="${debug}"
                projectsOnly="${projectsOnly}"
                runtime="static">
        --snip--

    Define in Preprocessor Definitions in VS: LOG4CXX_STATIC
    Add Additional Dependencies in VS: log4cxxd.lib apr-1d.lib
aprutil-1d.lib wsock32.lib Ws2_32.lib

kind regards,
(Continue reading)

bilinmek istemiyor | 7 Aug 2006 15:10
Picon

Newbie can not compile trivial.cpp. Help!!!!

Hello,

I am very much new to C++ programming in MS Windows environment. I am asked to develop a C++ application with QT 3.2.3 on Windows platform with MS Visual C++ 7.1 .Net edition. I have been developing C programs mostly on solaris and linux platforms.

After realizing that Qt 3.2.3 does not have a logging API other then some qDebug, qFatal, qWarning, I have seached for a logging library and found three different log4c++ implementation . After seaching for a while I understood that log4cxx is a part of Apache and decided to use log4cxx.

I have compiled the library as directed even though gathering eveything ant, jre, apr, cppunit took sometime.

Anyhow, I wanted to test the library, honestly for 2 days I have not been able to compile even simple examples. I receive zillions of errors that I provided in the end of the mail. I suspect that I may be missing to include some compilation flags. I used the qt qmake tool to generate a makefile as I am eventually use this tool with qt library.

In my test example I have only one file main.cpp which I have stolen form trivial.cpp (I have only changed the name of the trivial.cpp)

/*
 * Copyright 2003,2004 The Apache Software Foundation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#include <log4cxx/logstring.h>
#include <stdlib.h>
#include <log4cxx/logger.h>
#include <log4cxx/basicconfigurator.h>
#include <log4cxx/helpers/exception.h>
#include <log4cxx/ndc.h>

using namespace log4cxx;
using namespace log4cxx::helpers;

int main()
{
  int result = EXIT_SUCCESS;
  try
  {
    BasicConfigurator::configure();
    LoggerPtr rootLogger = Logger::getRootLogger();

    NDC::push("trivial context");

    LOG4CXX_DEBUG(rootLogger, "debug message");
    LOG4CXX_INFO(rootLogger, "info message");
    LOG4CXX_WARN(rootLogger, "warn message");
    LOG4CXX_ERROR(rootLogger, "error message");
    LOG4CXX_FATAL(rootLogger, "fatal message");

    NDC::pop();
  }
  catch(std::exception&)
  {
    result = EXIT_FAILURE;
  }

  return result;
}

-------------------------------------------------------

MY QT PROJECT FILE

TEMPLATE = app

# Input
CONFIG  +=  qt warn_on console thread exceptions
INCLUDEPATH += . D:\libs\log4cxx\include
LIBS = D:\libs\log4cxx\lib\log4cxx.lib
DEFINES = QT_DLL
SOURCES += main.cpp



------------------------------------------------------------

GENERATED MAKEFILE FROM PROJECT FILE ABOVE

#############################################################################
# Makefile for building: wrk
# Generated by qmake (1.06c) (Qt 3.2.3) on: Mon Aug 07 15:07:14 2006
# Project:  wrk.pro
# Template: app
# Command: $(QMAKE) -o Makefile wrk.pro
#############################################################################

####### Compiler, tools and options

CC        =    cl
CXX        =    cl
LEX        = flex
YACC        = byacc
CFLAGS    =    -nologo -Zm200 -W3 -MD -O1 -GX -GX -GR  -DQT_DLL -DQT_DLL -DQT_THREAD_SUPPORT -DQT_NO_DEBUG
CXXFLAGS    =    -nologo -Zm200 -W3 -w34100 -w34189 -MD -O1 -GX -GX -GR  -DQT_DLL -DQT_DLL -DQT_THREAD_SUPPORT -DQT_NO_DEBUG
LEXFLAGS    =
YACCFLAGS    =-d
INCPATH    =     -I"." -I"D:\libs\log4cxx\include" -I"$(QTDIR)\include" -I"D:\toktay\projects\yayici\den2" -I"D:\apps\qt\3.2.3\mkspecs\win32- msvc.net"
LINK    =    link
LFLAGS    =    /NOLOGO /DELAYLOAD:comdlg32.dll /DELAYLOAD:oleaut32.dll /DELAYLOAD:winmm.dll /DELAYLOAD:wsock32.dll /DELAYLOAD:winspool.dll /SUBSYSTEM:CONSOLE /LIBPATH:"$(QTDIR)\lib"
LIBS    =     "qt-mt323.lib" "qtmain.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib " "oleaut32.lib" "uuid.lib" "imm32.lib" "winmm.lib" "wsock32.lib" "winspool.lib" "delayimp.lib" "D:\libs\log4cxx\lib\log4cxx.lib" " opengl32.lib" "glu32.lib"
MOC        =    $(QTDIR)\bin\moc.exe
UIC        =    $(QTDIR)\bin\uic.exe
QMAKE        =    qmake
IDC        =    $(QTDIR)\bin\idc.exe
IDL        =    midl
ZIP        =    zip -r -9
COPY_FILE    =       copy
COPY_DIR    =       copy
DEL_FILE    =       del
DEL_DIR    =       rmdir
MOVE        =       move
CHK_DIR_EXISTS =    if not exist
MKDIR        =    mkdir

####### Files

HEADERS =   
SOURCES =    main.cpp
OBJECTS =    main.obj
FORMS =   
UICDECLS =   
UICIMPLS =   
SRCMOC    =   
OBJMOC    =   
DIST    =   
TARGET    =    wrk.exe

####### Implicit rules

.SUFFIXES: .c .cpp .cc .cxx .C

{.}.cpp{}.obj::
    $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo <at> <<
    $<
<<

{.}.cc{}.obj::
    $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo <at> <<
    $<
<<

{.}.cxx{}.obj::
    $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo <at> <<
    $<
<<

{.}.C{}.obj::
    $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo <at> <<
    $<
<<

{.}.c{}.obj::
    $(CC) -c $(CFLAGS) $(INCPATH) -Fo <at> <<
    $<
<<

####### Build rules

all: Makefile $(TARGET)

$(TARGET):  $(UICDECLS) $(OBJECTS) $(OBJMOC)
    $(LINK) $(LFLAGS) /OUT:$(TARGET) <at> <<
      $(OBJECTS) $(OBJMOC) $(LIBS)
<<


mocables: $(SRCMOC)
uicables: $(UICIMPLS) $(UICDECLS)

Makefile: wrk.pro  D:\apps\qt\3.2.3\mkspecs\win32-msvc.net\qmake.conf ..\..\..\..\apps\qt\3.2.3\lib\qtmain.prl
    $(QMAKE) -o Makefile wrk.pro
qmake:
    <at> $(QMAKE) -o Makefile wrk.pro

dist:
    $(ZIP) wrk.zip $(SOURCES) $(HEADERS) $(DIST) $(FORMS) D:/toktay/projects/yayici/den2/wrk.pro ..\..\..\..\apps\qt\3.2.3\lib\qtmain.prl 

uiclean:
mocclean:
clean: uiclean mocclean
    -$(DEL_FILE) main.obj


FORCE:

distclean: clean
    -$(DEL_FILE) $(TARGET)

####### Compile

main.obj: main.cpp

####### Install

install: all 

uninstall: 

--------------------------------------------------------------------------------------------------

THE WARNINGS THAT I RECEIVE after nmake

D:\toktay\projects\yayici\den2>nmake

Microsoft (R) Program Maintenance Utility Version 7.10.3077
Copyright (C) Microsoft Corporation.  All rights reserved.

        cl -c -nologo -Zm200 -W3 -w34100 -w34189 -MD -O1 -GX -GX -GR  -DUNICODE
-DWIN32 -DQT_DLL -DQT_THREAD_SUPPORT -DQT_NO_DEBUG -I"." -I"D:\libs\log4cxx\incl
ude" -I"D:\apps\qt\3.2.3\include" -I"D:\toktay\projects\yayici\den2" -I"D:\apps\
qt\3.2.3\mkspecs\win32-msvc.net" -Fo <at> D:\temp\nm472.tmp
main.cpp
D:\libs\log4cxx\include\log4cxx\helpers\appenderattachableimpl.h(45) : warning C
4251: 'log4cxx::helpers::AppenderAttachableImpl::appenderList' : class 'std::vec
tor<_Ty>' needs to have dll-interface to be used by clients of class 'log4cxx::h
elpers::AppenderAttachableImpl'
        with
        [
            _Ty=log4cxx::AppenderPtr
        ]
D:\libs\log4cxx\include\log4cxx\helpers\appenderattachableimpl.h(106) : warning
C4250: 'log4cxx::helpers::AppenderAttachableImpl' : inherits 'log4cxx::helpers::
ObjectImpl::log4cxx::helpers::ObjectImpl::addRef' via dominance
        D:\libs\log4cxx\include\log4cxx\helpers\objectimpl.h(32) : see declarati
on of 'log4cxx::helpers::ObjectImpl::addRef'
D:\libs\log4cxx\include\log4cxx\helpers\appenderattachableimpl.h(106) : warning
C4250: 'log4cxx::helpers::AppenderAttachableImpl' : inherits 'log4cxx::helpers::
ObjectImpl::log4cxx::helpers::ObjectImpl::releaseRef' via dominance
        D:\libs\log4cxx\include\log4cxx\helpers\objectimpl.h(33) : see declarati
on of 'log4cxx::helpers::ObjectImpl::releaseRef'
D:\libs\log4cxx\include\log4cxx\level.h(134) : warning C4251: 'log4cxx::Level::A
LL' : class 'log4cxx::helpers::ObjectPtrT<T>' needs to have dll-interface to be
used by clients of class 'log4cxx::Level'
        with
        [
            T=log4cxx::Level
        ]
D:\libs\log4cxx\include\log4cxx\level.h(140) : warning C4251: 'log4cxx::Level::F
ATAL' : class 'log4cxx::helpers::ObjectPtrT<T>' needs to have dll-interface to b
e used by clients of class 'log4cxx::Level'
        with
        [
            T=log4cxx::Level
        ]
D:\libs\log4cxx\include\log4cxx\level.h(145) : warning C4251: 'log4cxx::Level::E
RROR' : class 'log4cxx::helpers::ObjectPtrT<T>' needs to have dll-interface to b
e used by clients of class 'log4cxx::Level'
        with
        [
            T=log4cxx::Level
        ]
D:\libs\log4cxx\include\log4cxx\level.h(150) : warning C4251: 'log4cxx::Level::W
ARN' : class 'log4cxx::helpers::ObjectPtrT<T>' needs to have dll-interface to be
 used by clients of class 'log4cxx::Level'
        with
        [
            T=log4cxx::Level
        ]
D:\libs\log4cxx\include\log4cxx\level.h(156) : warning C4251: 'log4cxx::Level::I
NFO' : class 'log4cxx::helpers::ObjectPtrT<T>' needs to have dll-interface to be
 used by clients of class 'log4cxx::Level'
        with
        [
            T=log4cxx::Level
        ]
D:\libs\log4cxx\include\log4cxx\level.h(162) : warning C4251: 'log4cxx::Level::D
EBUG' : class 'log4cxx::helpers::ObjectPtrT<T>' needs to have dll-interface to b
e used by clients of class 'log4cxx::Level'
        with
        [
            T=log4cxx::Level
        ]
D:\libs\log4cxx\include\log4cxx\level.h(167) : warning C4251: 'log4cxx::Level::O
FF' : class 'log4cxx::helpers::ObjectPtrT<T>' needs to have dll-interface to be
used by clients of class 'log4cxx::Level'
        with
        [
            T=log4cxx::Level
        ]
D:\libs\log4cxx\include\log4cxx\helpers\resourcebundle.h(82) : warning C4251: 'l
og4cxx::helpers::ResourceBundle::parent' : class 'log4cxx::helpers::ObjectPtrT<T
>' needs to have dll-interface to be used by clients of class 'log4cxx::helpers:
:ResourceBundle'
        with
        [
            T=log4cxx::helpers::ResourceBundle
        ]
D:\libs\log4cxx\include\log4cxx\logger.h(68) : warning C4251: 'log4cxx::Logger::
level' : class 'log4cxx::helpers::ObjectPtrT<T>' needs to have dll-interface to
be used by clients of class 'log4cxx::Logger'
        with
        [
            T=log4cxx::Level
        ]
D:\libs\log4cxx\include\log4cxx\logger.h(73) : warning C4251: 'log4cxx::Logger::
parent' : class 'log4cxx::helpers::ObjectPtrT<T>' needs to have dll-interface to
 be used by clients of class 'log4cxx::Logger'
        with
        [
            T=log4cxx::Logger
        ]
D:\libs\log4cxx\include\log4cxx\logger.h(79) : warning C4251: 'log4cxx::Logger::
resourceBundle' : class 'log4cxx::helpers::ObjectPtrT<T>' needs to have dll-inte
rface to be used by clients of class 'log4cxx::Logger'
        with
        [
            T=log4cxx::helpers::ResourceBundle
        ]
D:\libs\log4cxx\include\log4cxx\logger.h(85) : warning C4251: 'log4cxx::Logger::
aai' : class 'log4cxx::helpers::ObjectPtrT<T>' needs to have dll-interface to be
 used by clients of class 'log4cxx::Logger'
        with
        [
            T=log4cxx::helpers::AppenderAttachableImpl
        ]
D:\libs\log4cxx\include\log4cxx\logger.h(593) : warning C4250: 'log4cxx::Logger'
 : inherits 'log4cxx::helpers::ObjectImpl::log4cxx::helpers::ObjectImpl::addRef'
 via dominance
        D:\libs\log4cxx\include\log4cxx\helpers\objectimpl.h(32) : see declarati
on of 'log4cxx::helpers::ObjectImpl::addRef'
D:\libs\log4cxx\include\log4cxx\logger.h(593) : warning C4250: 'log4cxx::Logger'
 : inherits 'log4cxx::helpers::ObjectImpl::log4cxx::helpers::ObjectImpl::release
Ref' via dominance
        D:\libs\log4cxx\include\log4cxx\helpers\objectimpl.h(33) : see declarati
on of 'log4cxx::helpers::ObjectImpl::releaseRef'
        link /NOLOGO /DELAYLOAD:comdlg32.dll /DELAYLOAD:oleaut32.dll /DELAYLOAD:
winmm.dll /DELAYLOAD:wsock32.dll /DELAYLOAD:winspool.dll /SUBSYSTEM:CONSOLE /LIB
PATH:"D:\apps\qt\3.2.3\lib" /OUT:wrk.exe <at> D:\temp\nm473.tmp
LINK : warning LNK4199: /DELAYLOAD:comdlg32.dll ignored; no imports found from c
omdlg32.dll
LINK : warning LNK4199: /DELAYLOAD:oleaut32.dll ignored; no imports found from o
leaut32.dll
LINK : warning LNK4199: /DELAYLOAD:winmm.dll ignored; no imports found from winm
m.dll
LINK : warning LNK4199: /DELAYLOAD:wsock32.dll ignored; no imports found from ws
ock32.dll
LINK : warning LNK4199: /DELAYLOAD: winspool.dll ignored; no imports found from w
inspool.dll

----------------------------------------------

An execuatable is geneated but I no output written to the console when I executed.

Anyhelp would be much appreciated.

Sincerely





Curt Arnold | 7 Aug 2006 18:36
Picon
Favicon

Re: Newbie can not compile trivial.cpp. Help!!!!


On Aug 7, 2006, at 8:10 AM, bilinmek istemiyor wrote:

> Hello,
>
> I am very much new to C++ programming in MS Windows environment. I  
> am asked to develop a C++ application with QT 3.2.3 on Windows  
> platform with MS Visual C++ 7.1 .Net edition. I have been  
> developing C programs mostly on solaris and linux platforms.
>
> After realizing that Qt 3.2.3 does not have a logging API other  
> then some qDebug, qFatal, qWarning, I have seached for a logging  
> library and found three different log4c++ implementation . After  
> seaching for a while I understood that log4cxx is a part of Apache  
> and decided to use log4cxx.
>
> I have compiled the library as directed even though gathering  
> eveything ant, jre, apr, cppunit took sometime.
>
> Anyhow, I wanted to test the library, honestly for 2 days I have  
> not been able to compile even simple examples. I receive zillions  
> of errors that I provided in the end of the mail. I suspect that I  
> may be missing to include some compilation flags. I used the qt  
> qmake tool to generate a makefile as I am eventually use this tool  
> with qt library.
>
> In my test example I have only one file main.cpp which I have  
> stolen form trivial.cpp (I have only changed the name of the  
> trivial.cpp)
>

I've seen the dll-interface warnings and the dominance warnings  
before, but I do not know of any problem they cause.  The no imports  
warnings are due to linking with libraries that are not used which  
again should cause any problems.

My guess is that the EXE has a dependency on a DLL that is not on the  
path or in the current working directory and the application never is  
started.  If you linked with a shared build of log4cxx, do you have  
log4cxx.dll on the path or in the current working directory?

The depends tool should show the DLL dependencies of an application  
and will show in red any that are not resolved.  I'm not sure where  
it is located in MS VS.NET 7.1, it is located in the Tools menu of  
the VC 6 and the Platform SDK menus.

If that doesn't change things, could you fire up the application in  
the debugger and see what happens?

bilinmek istemiyor | 8 Aug 2006 08:52
Picon

Re: Newbie can not compile trivial.cpp. Help!!!!

Hi,

Thank you for the responses. As I said I am newbie in windows environment and my problem was that dll was not loaded. I put the dll in the same directory and later set the path environment variable to log4cxx installation directory and the problem is solved. On the other hand, the warnings are still displayed. I do not want to get rid of the warning by simply disabling them. Is there a proper way to disable them?

I provide warnings below.

   cl -c -nologo -Zm200 -W3 -w34100 -w34189 -MD -O1 -GX -GX -GR  -DUNICODE
-DWIN32 -DQT_DLL -DQT_THREAD_SUPPORT -DQT_NO_DEBUG -I"." -I"D:\libs\log4cxx\incl
ude" -I"D:\apps\qt\3.2.3\include" -I"D:\toktay\projects\yayici

\den2" -I"D:\apps\
qt\3.2.3\mkspecs\win32- msvc.net" -Fo <at> D:\temp\nm472.tmp
main.cpp
D:\libs\log4cxx\include\log4cxx\helpers\appenderattachableimpl.h(45) : warning C
4251: 'log4cxx::helpers::AppenderAttachableImpl::appenderList' : class 'std::vec
tor<_Ty>' needs to have dll-interface to be used by clients of class 'log4cxx::h
elpers::AppenderAttachableImpl'
        with
        [
            _Ty=log4cxx::AppenderPtr
        ]
D:\libs\log4cxx\include\log4cxx\helpers\appenderattachableimpl.h(106) : warning
C4250: 'log4cxx::helpers::AppenderAttachableImpl' : inherits 'log4cxx::helpers::
ObjectImpl::log4cxx::helpers::ObjectImpl::addRef' via dominance
        D:\libs\log4cxx\include\log4cxx\helpers\objectimpl.h(32) : see declarati
on of 'log4cxx::helpers::ObjectImpl::addRef'
D:\libs\log4cxx\include\log4cxx\helpers\appenderattachableimpl.h(106) : warning
C4250: 'log4cxx::helpers::AppenderAttachableImpl' : inherits 'log4cxx::helpers::
ObjectImpl::log4cxx::helpers::ObjectImpl::releaseRef' via dominance
        D:\libs\log4cxx\include\log4cxx\helpers\objectimpl.h(33) : see declarati
on of 'log4cxx::helpers::ObjectImpl::releaseRef'
D:\libs\log4cxx\include\log4cxx\level.h(134) : warning C4251: 'log4cxx::Level::A
LL' : class 'log4cxx::helpers::ObjectPtrT<T>' needs to have dll-interface to be
used by clients of class 'log4cxx::Level'
        with
        [
            T=log4cxx::Level
        ]
D:\libs\log4cxx\include\log4cxx\level.h(140) : warning C4251: 'log4cxx::Level::F
ATAL' : class 'log4cxx::helpers::ObjectPtrT<T>' needs to have dll-interface to b
e used by clients of class 'log4cxx::Level'
        with
        [
            T=log4cxx::Level
        ]
D:\libs\log4cxx\include\log4cxx\level.h(145) : warning C4251: 'log4cxx::Level::E
RROR' : class 'log4cxx::helpers::ObjectPtrT<T>' needs to have dll-interface to b
e used by clients of class 'log4cxx::Level'
        with
        [
            T=log4cxx::Level
        ]
D:\libs\log4cxx\include\log4cxx\level.h(150) : warning C4251: 'log4cxx::Level::W
ARN' : class 'log4cxx::helpers::ObjectPtrT<T>' needs to have dll-interface to be
 used by clients of class 'log4cxx::Level'
        with
        [
            T=log4cxx::Level
        ]
D:\libs\log4cxx\include\log4cxx\level.h(156) : warning C4251: 'log4cxx::Level::I
NFO' : class 'log4cxx::helpers::ObjectPtrT<T>' needs to have dll-interface to be
 used by clients of class 'log4cxx::Level'
        with
        [
            T=log4cxx::Level
        ]
D:\libs\log4cxx\include\log4cxx\level.h(162) : warning C4251: 'log4cxx::Level::D
EBUG' : class 'log4cxx::helpers::ObjectPtrT<T>' needs to have dll-interface to b
e used by clients of class 'log4cxx::Level'
        with
        [
            T=log4cxx::Level
        ]
D:\libs\log4cxx\include\log4cxx\level.h(167) : warning C4251: 'log4cxx::Level::O
FF' : class 'log4cxx::helpers::ObjectPtrT<T>' needs to have dll-interface to be
used by clients of class 'log4cxx::Level'
        with
        [
            T=log4cxx::Level
        ]
D:\libs\log4cxx\include\log4cxx\helpers\resourcebundle.h(82) : warning C4251: 'l
og4cxx::helpers::ResourceBundle::parent' : class 'log4cxx::helpers::ObjectPtrT<T
>' needs to have dll-interface to be used by clients of class 'log4cxx::helpers:
:ResourceBundle'
        with
        [
            T=log4cxx::helpers::ResourceBundle
        ]
D:\libs\log4cxx\include\log4cxx\logger.h(68) : warning C4251: 'log4cxx::Logger::
level' : class 'log4cxx::helpers::ObjectPtrT<T>' needs to have dll-interface to
be used by clients of class 'log4cxx::Logger'
        with
        [
            T=log4cxx::Level
        ]
D:\libs\log4cxx\include\log4cxx\logger.h(73) : warning C4251: 'log4cxx::Logger::
parent' : class 'log4cxx::helpers::ObjectPtrT<T>' needs to have dll-interface to
 be used by clients of class 'log4cxx::Logger'
        with
        [
            T=log4cxx::Logger
        ]
D:\libs\log4cxx\include\log4cxx\logger.h(79) : warning C4251: 'log4cxx::Logger::
resourceBundle' : class 'log4cxx::helpers::ObjectPtrT<T>' needs to have dll-inte
rface to be used by clients of class 'log4cxx::Logger'
        with
        [
            T=log4cxx::helpers::ResourceBundle
        ]
D:\libs\log4cxx\include\log4cxx\logger.h(85) : warning C4251: 'log4cxx::Logger::
aai' : class 'log4cxx::helpers::ObjectPtrT<T>' needs to have dll-interface to be
 used by clients of class 'log4cxx::Logger'
        with
        [
            T=log4cxx::helpers::AppenderAttachableImpl
        ]
D:\libs\log4cxx\include\log4cxx\logger.h(593) : warning C4250: 'log4cxx::Logger'
 : inherits 'log4cxx::helpers::ObjectImpl::log4cxx::helpers::ObjectImpl::addRef'
 via dominance
        D:\libs\log4cxx\include\log4cxx\helpers\objectimpl.h(32) : see declarati
on of 'log4cxx::helpers::ObjectImpl::addRef'
D:\libs\log4cxx\include\log4cxx\logger.h(593) : warning C4250: 'log4cxx::Logger'
 : inherits 'log4cxx::helpers::ObjectImpl::log4cxx::helpers::ObjectImpl::release
Ref' via dominance
        D:\libs\log4cxx\include\log4cxx\helpers\objectimpl.h(33) : see declarati
on of 'log4cxx::helpers::ObjectImpl::releaseRef'
        link /NOLOGO /DELAYLOAD:comdlg32.dll /DELAYLOAD:oleaut32.dll /DELAYLOAD:
winmm.dll /DELAYLOAD:wsock32.dll /DELAYLOAD:winspool.dll /SUBSYSTEM:CONSOLE /LIB
PATH:"D:\apps\qt\3.2.3\lib" /OUT:wrk.exe <at> D:\temp\nm473.tmp
LINK : warning LNK4199: /DELAYLOAD:comdlg32.dll ignored; no imports found from c
omdlg32.dll
LINK : warning LNK4199: /DELAYLOAD:oleaut32.dll ignored; no imports found from o
leaut32.dll
LINK : warning LNK4199: /DELAYLOAD:winmm.dll ignored; no imports found from winm
m.dll
LINK : warning LNK4199: /DELAYLOAD:wsock32.dll ignored; no imports found from ws
ock32.dll
LINK : warning LNK4199: /DELAYLOAD: winspool.dll ignored; no imports found from w
inspool.dll

----------------------------------------------

An execuatable is geneated but I no output written to the console when I executed.

Anyhelp would be much appreciated.

Sincerely






On 8/7/06, bilinmek istemiyor <benibilme <at> gmail.com> wrote:
Hello,

I am very much new to C++ programming in MS Windows environment. I am asked to develop a C++ application with QT 3.2.3 on Windows platform with MS Visual C++ 7.1 .Net edition. I have been developing C programs mostly on solaris and linux platforms.

After realizing that Qt 3.2.3 does not have a logging API other then some qDebug, qFatal, qWarning, I have seached for a logging library and found three different log4c++ implementation . After seaching for a while I understood that log4cxx is a part of Apache and decided to use log4cxx.

I have compiled the library as directed even though gathering eveything ant, jre, apr, cppunit took sometime.

Anyhow, I wanted to test the library, honestly for 2 days I have not been able to compile even simple examples. I receive zillions of errors that I provided in the end of the mail. I suspect that I may be missing to include some compilation flags. I used the qt qmake tool to generate a makefile as I am eventually use this tool with qt library.

In my test example I have only one file main.cpp which I have stolen form trivial.cpp (I have only changed the name of the trivial.cpp)

/*
 * Copyright 2003,2004 The Apache Software Foundation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#include <log4cxx/logstring.h>
#include <stdlib.h>
#include <log4cxx/logger.h>
#include <log4cxx/basicconfigurator.h>
#include <log4cxx/helpers/exception.h>
#include <log4cxx/ndc.h>

using namespace log4cxx;
using namespace log4cxx::helpers;

int main()
{
  int result = EXIT_SUCCESS;
  try
  {
    BasicConfigurator::configure();
    LoggerPtr rootLogger = Logger::getRootLogger();

    NDC::push("trivial context");

    LOG4CXX_DEBUG(rootLogger, "debug message");
    LOG4CXX_INFO(rootLogger, "info message");
    LOG4CXX_WARN(rootLogger, "warn message");
    LOG4CXX_ERROR(rootLogger, "error message");
    LOG4CXX_FATAL(rootLogger, "fatal message");

    NDC::pop();
  }
  catch(std::exception&)
  {
    result = EXIT_FAILURE;
  }

  return result;
}

-------------------------------------------------------

MY QT PROJECT FILE

TEMPLATE = app

# Input
CONFIG  +=  qt warn_on console thread exceptions
INCLUDEPATH += . D:\libs\log4cxx\include
LIBS = D:\libs\log4cxx\lib\log4cxx.lib
DEFINES = QT_DLL
SOURCES += main.cpp



------------------------------------------------------------

GENERATED MAKEFILE FROM PROJECT FILE ABOVE

#############################################################################
# Makefile for building: wrk
# Generated by qmake (1.06c) (Qt 3.2.3) on: Mon Aug 07 15:07:14 2006
# Project:  wrk.pro
# Template: app
# Command: $(QMAKE) -o Makefile wrk.pro
#############################################################################

####### Compiler, tools and options

CC        =    cl
CXX        =    cl
LEX        = flex
YACC        = byacc
CFLAGS    =    -nologo -Zm200 -W3 -MD -O1 -GX -GX -GR  -DQT_DLL -DQT_DLL -DQT_THREAD_SUPPORT -DQT_NO_DEBUG
CXXFLAGS    =    -nologo -Zm200 -W3 -w34100 -w34189 -MD -O1 -GX -GX -GR  -DQT_DLL -DQT_DLL -DQT_THREAD_SUPPORT -DQT_NO_DEBUG
LEXFLAGS    =
YACCFLAGS    =-d
INCPATH    =     -I"." -I"D:\libs\log4cxx\include" -I"$(QTDIR)\include" -I"D:\toktay\projects\yayici\den2" -I"D:\apps\qt\3.2.3\mkspecs\win32- msvc.net"
LINK    =    link
LFLAGS    =    /NOLOGO /DELAYLOAD:comdlg32.dll /DELAYLOAD:oleaut32.dll /DELAYLOAD: winmm.dll /DELAYLOAD:wsock32.dll /DELAYLOAD:winspool.dll /SUBSYSTEM:CONSOLE /LIBPATH:"$(QTDIR)\lib"
LIBS    =     "qt-mt323.lib" "qtmain.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib " "oleaut32.lib" "uuid.lib" "imm32.lib" "winmm.lib" "wsock32.lib" "winspool.lib" "delayimp.lib" "D:\libs\log4cxx\lib\log4cxx.lib" " opengl32.lib" "glu32.lib"
MOC        =    $(QTDIR)\bin\moc.exe
UIC        =    $(QTDIR)\bin\uic.exe
QMAKE        =    qmake
IDC        =    $(QTDIR)\bin\idc.exe
IDL        =    midl
ZIP        =    zip -r -9
COPY_FILE    =       copy
COPY_DIR    =       copy
DEL_FILE    =       del
DEL_DIR    =       rmdir
MOVE        =       move
CHK_DIR_EXISTS =    if not exist
MKDIR        =    mkdir

####### Files

HEADERS =   
SOURCES =    main.cpp
OBJECTS =    main.obj
FORMS =   
UICDECLS =   
UICIMPLS =   
SRCMOC    =   
OBJMOC    =   
DIST    =   
TARGET    =    wrk.exe

####### Implicit rules

.SUFFIXES: .c .cpp .cc .cxx .C

{.}.cpp{}.obj::
    $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo <at> <<
    $<
<<

{.}.cc{}.obj::
    $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo <at> <<
    $<
<<

{.}.cxx{}.obj::
    $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo <at> <<
    $<
<<

{.}.C{}.obj::
    $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo <at> <<
    $<
<<

{.}.c{}.obj::
    $(CC) -c $(CFLAGS) $(INCPATH) -Fo <at> <<
    $<
<<

####### Build rules

all: Makefile $(TARGET)

$(TARGET):  $(UICDECLS) $(OBJECTS) $(OBJMOC)
    $(LINK) $(LFLAGS) /OUT:$(TARGET) <at> <<
      $(OBJECTS) $(OBJMOC) $(LIBS)
<<


mocables: $(SRCMOC)
uicables: $(UICIMPLS) $(UICDECLS)

Makefile: wrk.pro  D:\apps\qt\3.2.3\mkspecs\win32-msvc.net\qmake.conf ..\..\..\..\apps\qt\3.2.3\lib\qtmain.prl
    $(QMAKE) -o Makefile wrk.pro
qmake:
    <at> $(QMAKE) -o Makefile wrk.pro

dist:
    $(ZIP) wrk.zip $(SOURCES) $(HEADERS) $(DIST) $(FORMS) D:/toktay/projects/yayici/den2/wrk.pro ..\..\..\..\apps\qt\3.2.3\lib\qtmain.prl 

uiclean:
mocclean:
clean: uiclean mocclean
    -$(DEL_FILE) main.obj


FORCE:

distclean: clean
    -$(DEL_FILE) $(TARGET)

####### Compile

main.obj: main.cpp

####### Install

install: all 

uninstall: 

--------------------------------------------------------------------------------------------------

THE WARNINGS THAT I RECEIVE after nmake

D:\toktay\projects\yayici\den2>nmake

Microsoft (R) Program Maintenance Utility Version 7.10.3077
Copyright (C) Microsoft Corporation.  All rights reserved.

        cl -c -nologo -Zm200 -W3 -w34100 -w34189 -MD -O1 -GX -GX -GR  -DUNICODE
-DWIN32 -DQT_DLL -DQT_THREAD_SUPPORT -DQT_NO_DEBUG -I"." -I"D:\libs\log4cxx\incl
ude" -I"D:\apps\qt\3.2.3\include" -I"D:\toktay\projects\yayici\den2" -I"D:\apps\
qt\3.2.3\mkspecs\win32- msvc.net" -Fo <at> D:\temp\nm472.tmp
main.cpp
D:\libs\log4cxx\include\log4cxx\helpers\appenderattachableimpl.h(45) : warning C
4251: 'log4cxx::helpers::AppenderAttachableImpl::appenderList' : class 'std::vec
tor<_Ty>' needs to have dll-interface to be used by clients of class 'log4cxx::h
elpers::AppenderAttachableImpl'
        with
        [
            _Ty=log4cxx::AppenderPtr
        ]
D:\libs\log4cxx\include\log4cxx\helpers\appenderattachableimpl.h(106) : warning
C4250: 'log4cxx::helpers::AppenderAttachableImpl' : inherits 'log4cxx::helpers::
ObjectImpl::log4cxx::helpers::ObjectImpl::addRef' via dominance
        D:\libs\log4cxx\include\log4cxx\helpers\objectimpl.h(32) : see declarati
on of 'log4cxx::helpers::ObjectImpl::addRef'
D:\libs\log4cxx\include\log4cxx\helpers\appenderattachableimpl.h(106) : warning
C4250: 'log4cxx::helpers::AppenderAttachableImpl' : inherits 'log4cxx::helpers::
ObjectImpl::log4cxx::helpers::ObjectImpl::releaseRef' via dominance
        D:\libs\log4cxx\include\log4cxx\helpers\objectimpl.h(33) : see declarati
on of 'log4cxx::helpers::ObjectImpl::releaseRef'
D:\libs\log4cxx\include\log4cxx\level.h(134) : warning C4251: 'log4cxx::Level::A
LL' : class 'log4cxx::helpers::ObjectPtrT<T>' needs to have dll-interface to be
used by clients of class 'log4cxx::Level'
        with
        [
            T=log4cxx::Level
        ]
D:\libs\log4cxx\include\log4cxx\level.h(140) : warning C4251: 'log4cxx::Level::F
ATAL' : class 'log4cxx::helpers::ObjectPtrT<T>' needs to have dll-interface to b
e used by clients of class 'log4cxx::Level'
        with
        [
            T=log4cxx::Level
        ]
D:\libs\log4cxx\include\log4cxx\level.h(145) : warning C4251: 'log4cxx::Level::E
RROR' : class 'log4cxx::helpers::ObjectPtrT<T>' needs to have dll-interface to b
e used by clients of class 'log4cxx::Level'
        with
        [
            T=log4cxx::Level
        ]
D:\libs\log4cxx\include\log4cxx\level.h(150) : warning C4251: 'log4cxx::Level::W
ARN' : class 'log4cxx::helpers::ObjectPtrT<T>' needs to have dll-interface to be
 used by clients of class 'log4cxx::Level'
        with
        [
            T=log4cxx::Level
        ]
D:\libs\log4cxx\include\log4cxx\level.h(156) : warning C4251: 'log4cxx::Level::I
NFO' : class 'log4cxx::helpers::ObjectPtrT<T>' needs to have dll-interface to be
 used by clients of class 'log4cxx::Level'
        with
        [
            T=log4cxx::Level
        ]
D:\libs\log4cxx\include\log4cxx\level.h(162) : warning C4251: 'log4cxx::Level::D
EBUG' : class 'log4cxx::helpers::ObjectPtrT<T>' needs to have dll-interface to b
e used by clients of class 'log4cxx::Level'
        with
        [
            T=log4cxx::Level
        ]
D:\libs\log4cxx\include\log4cxx\level.h(167) : warning C4251: 'log4cxx::Level::O
FF' : class 'log4cxx::helpers::ObjectPtrT<T>' needs to have dll-interface to be
used by clients of class 'log4cxx::Level'
        with
        [
            T=log4cxx::Level
        ]
D:\libs\log4cxx\include\log4cxx\helpers\resourcebundle.h(82) : warning C4251: 'l
og4cxx::helpers::ResourceBundle::parent' : class 'log4cxx::helpers::ObjectPtrT<T
>' needs to have dll-interface to be used by clients of class 'log4cxx::helpers:
:ResourceBundle'
        with
        [
            T=log4cxx::helpers::ResourceBundle
        ]
D:\libs\log4cxx\include\log4cxx\logger.h(68) : warning C4251: 'log4cxx::Logger::
level' : class 'log4cxx::helpers::ObjectPtrT<T>' needs to have dll-interface to
be used by clients of class 'log4cxx::Logger'
        with
        [
            T=log4cxx::Level
        ]
D:\libs\log4cxx\include\log4cxx\logger.h(73) : warning C4251: 'log4cxx::Logger::
parent' : class 'log4cxx::helpers::ObjectPtrT<T>' needs to have dll-interface to
 be used by clients of class 'log4cxx::Logger'
        with
        [
            T=log4cxx::Logger
        ]
D:\libs\log4cxx\include\log4cxx\logger.h(79) : warning C4251: 'log4cxx::Logger::
resourceBundle' : class 'log4cxx::helpers::ObjectPtrT<T>' needs to have dll-inte
rface to be used by clients of class 'log4cxx::Logger'
        with
        [
            T=log4cxx::helpers::ResourceBundle
        ]
D:\libs\log4cxx\include\log4cxx\logger.h(85) : warning C4251: 'log4cxx::Logger::
aai' : class 'log4cxx::helpers::ObjectPtrT<T>' needs to have dll-interface to be
 used by clients of class 'log4cxx::Logger'
        with
        [
            T=log4cxx::helpers::AppenderAttachableImpl
        ]
D:\libs\log4cxx\include\log4cxx\logger.h(593) : warning C4250: 'log4cxx::Logger'
 : inherits 'log4cxx::helpers::ObjectImpl::log4cxx::helpers::ObjectImpl::addRef'
 via dominance
        D:\libs\log4cxx\include\log4cxx\helpers\objectimpl.h(32) : see declarati
on of 'log4cxx::helpers::ObjectImpl::addRef'
D:\libs\log4cxx\include\log4cxx\logger.h(593) : warning C4250: 'log4cxx::Logger'
 : inherits 'log4cxx::helpers::ObjectImpl::log4cxx::helpers::ObjectImpl::release
Ref' via dominance
        D:\libs\log4cxx\include\log4cxx\helpers\objectimpl.h(33) : see declarati
on of 'log4cxx::helpers::ObjectImpl::releaseRef'
        link /NOLOGO /DELAYLOAD:comdlg32.dll /DELAYLOAD:oleaut32.dll /DELAYLOAD:
winmm.dll /DELAYLOAD:wsock32.dll /DELAYLOAD:winspool.dll /SUBSYSTEM:CONSOLE /LIB
PATH:"D:\apps\qt\3.2.3\lib" /OUT:wrk.exe <at> D:\temp\nm473.tmp
LINK : warning LNK4199: /DELAYLOAD:comdlg32.dll ignored; no imports found from c
omdlg32.dll
LINK : warning LNK4199: /DELAYLOAD:oleaut32.dll ignored; no imports found from o
leaut32.dll
LINK : warning LNK4199: /DELAYLOAD:winmm.dll ignored; no imports found from winm
m.dll
LINK : warning LNK4199: /DELAYLOAD:wsock32.dll ignored; no imports found from ws
ock32.dll
LINK : warning LNK4199: /DELAYLOAD: winspool.dll ignored; no imports found from w
inspool.dll

----------------------------------------------

An execuatable is geneated but I no output written to the console when I executed.

Anyhelp would be much appreciated.

Sincerely






Ganesh Kumar | 8 Aug 2006 15:24
Picon

About log4cxx new release

Hi
I am interested in using log4cxx. From the web-site, I found out that the current release
0.9.7 has lots of bugs in it. And these bugs are fixed in the latest release 0.9.8, which is
not yet released. When this version is going to be released

--Ganesh
siva prasanth | 9 Aug 2006 22:57
Picon
Favicon

Log4CXX - Compile Error

Hi,
 
I am trying to build the log4cxx on SunOS. I build the apr, apr-util and cppunit.
when i try to build the log4cxx,,i am able to compile the code bt during linking i get the follwing error.
 
ld: fatal: library -lsqlite3: not found
ld: fatal: library -liconv: not found
ld: fatal: File processing errors. No output written to .libs/liblog4cxx.so.9.0.0
*** Error code 1
make: Fatal error: Command failed for target `liblog4cxx.la'.
 
The makefile in log4cxx has
APU_LIBS =  -L/usr/local/apr/lib -laprutil-1 -lsqlite3 -lexpat -liconv.
 
and i checked the lib folder under which the apr is installed and it has
 
apr.exp                 libapr-1.so.0          libaprutil-1.so.0      libexpat.so.0
aprutil.exp            libapr-1.so.0.2.7      libaprutil-1.so.0.2.7  libexpat.so.0.1.0
libapr-1.a             libaprutil-1.a         libexpat.a             pkgconfig
libapr-1.la            libaprutil-1.la        libexpat.la
libapr-1.so            libaprutil-1.so        libexpat.so
 
 
Can anyone please let me know how to correct the error.
( looking at the make i feel that the apr/apr-util lib folder should have the
sqlite3.so ??? which i am missing....correct me???)
 
 
 
/Prasanth
 
 
 
 


Regards
Siva Prasanth Kambam

Yahoo! Music Unlimited - Access over 1 million songs. Try it free.
Jostein Tveit | 10 Aug 2006 12:35
Picon
Picon
Favicon

Re: Log4CXX - Compile Error

siva prasanth <siva_tillu <at> yahoo.co.in> writes:

> I am trying to build the log4cxx on SunOS. I build the apr, apr-util and
> cppunit.

I have successfully build log4cxx on Solaris 8 with Sun Forte
compiler.
See here for instructions:
<URL: http://marc.theaimsgroup.com/?l=log4cxx-user&m=114908626202067&w=2 >
Feel free to ask questions.

> The makefile in log4cxx has
> APU_LIBS =  -L/usr/local/apr/lib -laprutil-1 -lsqlite3 -lexpat -liconv.

My Makefile does not include sqlite3. Are you building log4cxx
with database support, or could it be that configure did
something wrong?

--

-- 
Jostein Tveit <josteitv <at> pvv.ntnu.no>


Gmane