CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 22

Threaded View

  1. #1
    Join Date
    May 2002
    Location
    India
    Posts
    268

    Red face Urgent help needed in using log4cpp


    Hi,
    I have downloaded log4cpp and am facing two problems.
    First Problem
    I built the log4cpp in VC 7.0 as MDd in debug version. I put log4cppD.dll & log4cppD.lib in my debug folder. When I try to link it to my static library, it is giving the following linking errors (614 in total). My atatic library is also built as MDd in debug verison.

    Code:
    log4cppD.lib(log4cppD.dll) : warning LNK4006: "public: int __thiscall log4cpp::CategoryStream::width(int)" (?width@CategoryStream@log4cpp@@QAEHH@Z) already defined in log4cppD.lib(log4cppD.dll); second definition ignored
    ....
    ....
    log4cppD.lib(log4cppD.dll) : warning LNK4006: "public: static void __cdecl log4cpp::Category::setRootPriority(int)" (?setRootPriority@Category@log4cpp@@SAXH@Z) already defined in log4cppD.lib(log4cppD.dll); second definition ignored
    ....
    ....
    log4cppD.lib(log4cppD.dll) : warning LNK4006: "__declspec(dllimport) public: virtual void __thiscall log4cpp::NTEventLogAppender::setLayout(class log4cpp::Layout *)" (__imp_?setLayout@NTEventLogAppender@log4cpp@@UAEXPAVLayout@2@@Z) already defined in log4cppD.lib(log4cppD.dll); second definition ignored
    ....
    ...
    log4cppD.lib(log4cppD.dll) : warning LNK4006: "__declspec(dllimport) protected: void __thiscall log4cpp::NTEventLogAppender::regSetDword(struct HKEY__ *,char *,unsigned long)" (__imp_?regSetDword@NTEventLogAppender@log4cpp@@IAEXPAUHKEY__@@PADK@Z) already defined in log4cppD.lib(log4cppD.dll); second definition ignored
    .......
    ....
    log4cppD.lib(log4cppD.dll) : warning LNK4006: "public: __thiscall log4cpp::AbortAppender::AbortAppender(class log4cpp::AbortAppender const &)" (??0AbortAppender@log4cpp@@QAE@ABV01@@Z) already defined in log4cppD.lib(log4cppD.dll); second definition ignored
    ...
    log4cppD.lib(log4cppD.dll) : warning LNK4006: __IMPORT_DESCRIPTOR_log4cppD already defined in log4cppD.lib(log4cppD.dll); second definition ignored
    Can anyone please tell me why am I getting these linking errors and how to resolve the same?


    Second Problem
    When I try to use the log4cpp in VC 6.0, I get the errors
    Code:
    d:\log4cpp-0.3.5rc1\include\log4cpp\priority.hh(65) : error C2258: illegal pure syntax, must be '= 0'
    d:\log4cpp-0.3.5rc1\include\log4cpp\priority.hh(65) : error C2252: 'MESSAGE_SIZE' : pure specifier can only be specified for functions
    d:\log4cpp-0.3.5rc1\include\log4cpp\threading\msthreads.hh(160) : fatal error C1506: unrecoverable block scoping error
    Please help me on this too.

    Also please help in using log4cpp with MFC dialog based applications. I am not certain of the type of runtime library i need to set.
    Last edited by The Saint; October 13th, 2005 at 07:21 AM. Reason: Add to query
    Life is short, enjoy it with a smile as long as it lasts.
    User error. Replace User and press any key when ready. - Anonymous

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured