VS2005 breaking my builds !

B

Bit Byte

I'm having problem compiling one of my projects with VS2005. The
problems arise with VS2005 (apparent?) inability to compile log4cpp.

Has anyone succesfully compiled log4cpp using VS2005?

Here are the errors I get:

Error 1 error C2039: 'iterator_category' : is not a member of
'log4cplus::helpers::string_append_iterator<_Container>' c:\program
files\microsoft visual studio 8\vc\include\xutility 572
Error 2 error C2146: syntax error : missing ';' before identifier
'iterator_category' c:\program files\microsoft visual studio
8\vc\include\xutility 572
Error 3 error C4430: missing type specifier - int assumed. Note: C++
does not support default-int c:\program files\microsoft visual studio
8\vc\include\xutility 572
Error 4 error C2602: 'std::iterator_traits<_Iter>::iterator_category' is
not a member of a base class of 'std::iterator_traits<_Iter>' c:\program
files\microsoft visual studio 8\vc\include\xutility 572
Error 5 error C2868: 'std::iterator_traits<_Iter>::iterator_category' :
illegal syntax for using-declaration; expected qualified-name c:\program
files\microsoft visual studio 8\vc\include\xutility 572


Ideas, suggestions and (most of all) fixes welcome ...
 
C

Carl Daniel [VC++ MVP]

Bit said:
I'm having problem compiling one of my projects with VS2005. The
problems arise with VS2005 (apparent?) inability to compile log4cpp.

What version of log4cpp are you using? I tried grabbing the latest code
(v0.3.5) from sourceforge and found only a VC6 workspace that contains a
bunch of broken projects - it doesn't look like anyone's done any VC++
maintenance on this project for a couple years, and even then they were
using a year out of date version of VC++..

-cd
 
B

Bit Byte

Carl said:
What version of log4cpp are you using? I tried grabbing the latest code
(v0.3.5) from sourceforge and found only a VC6 workspace that contains a
bunch of broken projects - it doesn't look like anyone's done any VC++
maintenance on this project for a couple years, and even then they were
using a year out of date version of VC++..

-cd

Hi Carl, I'm using v1.0.2 - please see http://log4cplus.sourceforge.net/
Yes, I agree dev has kinda halted on this (last fix was in '04) - but I
have a lot of other code using the log4cpp dll and it would be a
nightmare to strip it out and use another library ...

Cheers
 
C

Carl Daniel [VC++ MVP]

Bit said:
Hi Carl, I'm using v1.0.2 - please see
http://log4cplus.sourceforge.net/ Yes, I agree dev has kinda halted
on this (last fix was in '04) - but I have a lot of other code using
the log4cpp dll and it would be a nightmare to strip it out and use
another library ...

OK, that version is much closer to working. I had to make 2 changes to get
it to compile with VC 2005:

replace all occurrences of __value with something else: __value is
recognized as a keyword by the VC2005 compiler (the authors of log4cpp
should not have used it - all identifiers containing two consequetive
underscores are reserved to the implementation).

For the specific error you're seeing, insert the following line of code into
\include\log4cplus\helpers\stringhelper.h, line 123:

typedef std::blush:utput_iterator_tag iterator_category;

I didn't try testing the library, but it builds with those two changes.

-cd
 
B

Bit Byte

Carl said:
Bit said:
Carl Daniel [VC++ MVP] wrote:

Bit Byte wrote:


I'm having problem compiling one of my projects with VS2005. The
problems arise with VS2005 (apparent?) inability to compile log4cpp.


What version of log4cpp are you using? I tried grabbing the latest
code (v0.3.5) from sourceforge and found only a VC6 workspace that
contains a bunch of broken projects - it doesn't look like anyone's
done any VC++ maintenance on this project for a couple years, and
even then they were using a year out of date version of VC++..

-cd

Hi Carl, I'm using v1.0.2 - please see
http://log4cplus.sourceforge.net/ Yes, I agree dev has kinda halted
on this (last fix was in '04) - but I have a lot of other code using
the log4cpp dll and it would be a nightmare to strip it out and use
another library ...


OK, that version is much closer to working. I had to make 2 changes to get
it to compile with VC 2005:

replace all occurrences of __value with something else: __value is
recognized as a keyword by the VC2005 compiler (the authors of log4cpp
should not have used it - all identifiers containing two consequetive
underscores are reserved to the implementation).

For the specific error you're seeing, insert the following line of code into
\include\log4cplus\helpers\stringhelper.h, line 123:

typedef std::blush:utput_iterator_tag iterator_category;

I didn't try testing the library, but it builds with those two changes.

-cd

Thanks for the quick response Carl - I'll make the modifications now and
then test it later with my apps - I'll let you know how it goes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top