Amine
Amine

Reputation: 367

use of Log4cxx in visual studio 2012

I tried to build log4cxx for visual 2012 and, after 4 hours of resolving errors, the build was succesful (i'm not sure :)).

As a second step I tried to create a vs project to test logging. I used this example but it keep tell me that

mainapp.cpp(2): fatal error C1083: Cannot open include file: 'log4cxx\logger.h': No such file or directory

I already specified in the linker the path of directory debug in additional library directories and I added "log4cxx.lib" additional dependencies .

I'm confused and I don't know how to make it work

thanks in advance for your help

Upvotes: 1

Views: 2378

Answers (1)

nothrow
nothrow

Reputation: 16178

You also need to add the directory, where headers for log4cxx are. This is not for linking phase, but for compiler phase.

This can be done with Project Properties -> Compiler -> Preprocessor (I think, I don't have VS opened now)

You don't include .lib. This file is for linking.

You need to add to includes the directory, which contains directory log4cxx, and that (log4cxx) directory must contain logger.h!

Upvotes: 2

Related Questions