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 Andrew Leach <im...@gmail.com> on 2015/10/12 15:05:51 UTC

Help with first C++ program to do logging

Hi,

Firstly, I'm a novice C++ programmer and this is my 3rd program in total,
my first that involves logging to files.

I'm using Visual Studio 2013 Community and getting lots of errors when I
try to write some simple logging from a DLL that I've written.

I believe I've correctly configured the include directory for log4cxx into
VS2013 as the include's aren't showing up any errors.

However, I'm getting lots of errors from the other code.

Here's the errors:

32 IntelliSense: incomplete type is not allowed
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\config\propertysetter.h
86 30 Test
33 IntelliSense: name followed by '::' must be a class or namespace name
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\config\propertysetter.h
86 44 Test
34 IntelliSense: identifier "properties" is undefined
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\config\propertysetter.h
86 65 Test
35 IntelliSense: expected a ')'
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\config\propertysetter.h
86 75 Test
36 IntelliSense: identifier "LogString" is undefined
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\config\propertysetter.h
99 48 Test
37 IntelliSense: identifier "LogString" is undefined
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\config\propertysetter.h
100 35 Test
38 IntelliSense: namespace "log4cxx::helpers" has no member "Pool"
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\config\propertysetter.h
101 47 Test
39 IntelliSense: incomplete type is not allowed
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\config\propertysetter.h
103 30 Test
40 IntelliSense: namespace "log4cxx::helpers" has no member "Pool"
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\config\propertysetter.h
103 57 Test
41 IntelliSense: identifier "p" is undefined
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\config\propertysetter.h
103 63 Test
42 IntelliSense: expected a declaration
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\config\propertysetter.h
104 17 Test
43 IntelliSense: expected a declaration
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\config\propertysetter.h
105 9 Test
Error 1 error C1083: Cannot open include file: 'log4cxx/log4cxx.h': No such
file or directory
C:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\logstring.h
28 1 Test
44 IntelliSense: explicit type is missing ('int' assumed)
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
90 21 Test
45 IntelliSense: identifier "File" is undefined
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
90 32 Test
46 IntelliSense: function "File" is not a type name
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
94 21 Test
47 IntelliSense: 'operator=' must be a member function
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
94 27 Test
48 IntelliSense: function "File" is not a type name
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
94 43 Test
49 IntelliSense: expected a declaration
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
98 21 Test
50 IntelliSense: declaration is incompatible with "<error-type>
exists(const <error-type> &name)" (declared at line 92 of
"C:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx/spi/loggerrepository.h")
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
105 26 Test
51 IntelliSense: namespace "log4cxx::helpers" has no member "Pool"
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
105 51 Test
52 IntelliSense: identifier "p" is undefined
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
105 57 Test
53 IntelliSense: expected a ';'
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
105 60 Test
54 IntelliSense: namespace "log4cxx::helpers" has no member "Pool"
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
111 53 Test
55 IntelliSense: identifier "p" is undefined
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
111 59 Test
56 IntelliSense: expected a ';'
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
111 62 Test
57 IntelliSense: identifier "log4cxx_time_t" is undefined
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
117 21 Test
58 IntelliSense: namespace "log4cxx::helpers" has no member "Pool"
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
117 67 Test
59 IntelliSense: identifier "p" is undefined
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
117 73 Test
60 IntelliSense: expected a ';'
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
117 76 Test
61 IntelliSense: identifier "LogString" is undefined
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
122 21 Test
62 IntelliSense: a type qualifier is not allowed on a nonmember function
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
122 41 Test
63 IntelliSense: identifier "LogString" is undefined
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
127 21 Test
64 IntelliSense: a type qualifier is not allowed on a nonmember function
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
127 41 Test
65 IntelliSense: function "File" is not a type name
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
131 21 Test
66 IntelliSense: identifier "LogString" is undefined
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
131 41 Test
67 IntelliSense: identifier "log4cxx_status_t" is undefined
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
141 21 Test
68 IntelliSense: identifier "apr_file_t" is undefined
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
141 43 Test
69 IntelliSense: identifier "file" is undefined
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
141 56 Test
70 IntelliSense: expected a ')'
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
141 60 Test
71 IntelliSense: expected a ';'
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
142 64 Test
72 IntelliSense: identifier "LogString" is undefined
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
149 33 Test
73 IntelliSense: namespace "log4cxx::helpers" has no member "Pool"
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
149 67 Test
74 IntelliSense: identifier "p" is undefined
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
149 73 Test
75 IntelliSense: expected a ';'
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
149 76 Test
76 IntelliSense: namespace "log4cxx::helpers" has no member "Pool"
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
156 55 Test
77 IntelliSense: identifier "p" is undefined
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
156 61 Test
78 IntelliSense: expected a ';'
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
156 64 Test
79 IntelliSense: function "File" is not a type name
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
163 41 Test
80 IntelliSense: namespace "log4cxx::helpers" has no member "Pool"
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
163 71 Test
81 IntelliSense: a type qualifier is not allowed on a nonmember function
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
163 80 Test
82 IntelliSense: identifier "LogString" is undefined
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
170 21 Test
83 IntelliSense: declaration is incompatible with "<error-type>
getParent()" (declared at line 666 of
"C:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx/logger.h")
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
170 31 Test
84 IntelliSense: namespace "log4cxx::helpers" has no member "Pool"
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
170 59 Test
85 IntelliSense: identifier "p" is undefined
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
170 65 Test
86 IntelliSense: expected a ';'
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
170 68 Test
87 IntelliSense: namespace "log4cxx::helpers" has no member "Pool"
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
176 51 Test
88 IntelliSense: identifier "p" is undefined
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
176 57 Test
89 IntelliSense: expected a ';'
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
176 60 Test
90 IntelliSense: expected a declaration
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
178 17 Test
91 IntelliSense: declaration is incompatible with "<error-type> getPath()"
(declared at line 127)
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
181 27 Test
92 IntelliSense: namespace "log4cxx::helpers" has no member "Pool"
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
181 53 Test
93 IntelliSense: identifier "p" is undefined
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
181 59 Test
94 IntelliSense: expected a ';'
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
181 62 Test
95 IntelliSense: expected a declaration
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
182 17 Test
96 IntelliSense: expected a declaration
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\file.h
183 1 Test
97 IntelliSense: expected a declaration
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\helpers\appenderattachableimpl.h
58 13 Test
98 IntelliSense: name followed by '::' must be a class or namespace name
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\helpers\appenderattachableimpl.h
59 13 Test
99 IntelliSense: name followed by '::' must be a class or namespace name
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\helpers\appenderattachableimpl.h
62 13 Test
100 IntelliSense: a type qualifier is not allowed on a nonmember function
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\helpers\appenderattachableimpl.h
64 27 Test
101 IntelliSense: a type qualifier is not allowed on a nonmember function
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\helpers\appenderattachableimpl.h
65 31 Test
2 IntelliSense: invalid specifier outside a class declaration
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\appender.h
87 9 Test
3 IntelliSense: function "close" may not be initialized
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\appender.h
87 30 Test
4 IntelliSense: invalid specifier outside a class declaration
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\appender.h
94 9 Test
5 IntelliSense: name followed by '::' must be a class or namespace name
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\appender.h
94 37 Test
6 IntelliSense: namespace "log4cxx::helpers" has no member "Pool"
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\appender.h
95 33 Test
7 IntelliSense: function "doAppend" may not be initialized
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\appender.h
95 45 Test
8 IntelliSense: invalid specifier outside a class declaration
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\appender.h
102 9 Test
9 IntelliSense: identifier "LogString" is undefined
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\appender.h
102 17 Test
10 IntelliSense: a type qualifier is not allowed on a nonmember function
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\appender.h
102 37 Test
11 IntelliSense: function "getName" may not be initialized
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\appender.h
102 43 Test
12 IntelliSense: invalid specifier outside a class declaration
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\appender.h
108 8 Test
13 IntelliSense: identifier "LayoutPtr" is undefined
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\appender.h
108 37 Test
14 IntelliSense: function "setLayout" may not be initialized
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\appender.h
108 56 Test
15 IntelliSense: invalid specifier outside a class declaration
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\appender.h
113 8 Test
16 IntelliSense: identifier "LayoutPtr" is undefined
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\appender.h
113 16 Test
17 IntelliSense: a type qualifier is not allowed on a nonmember function
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\appender.h
113 38 Test
18 IntelliSense: function "getLayout" may not be initialized
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\appender.h
113 44 Test
19 IntelliSense: invalid specifier outside a class declaration
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\appender.h
120 8 Test
20 IntelliSense: identifier "LogString" is undefined
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\appender.h
120 35 Test
21 IntelliSense: function "setName" may not be initialized
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\appender.h
120 52 Test
22 IntelliSense: invalid specifier outside a class declaration
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\appender.h
136 8 Test
23 IntelliSense: a type qualifier is not allowed on a nonmember function
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\appender.h
136 38 Test
24 IntelliSense: function "requiresLayout" may not be initialized
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\appender.h
136 44 Test
25 IntelliSense: expected a declaration
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\appender.h
137 4 Test
26 IntelliSense: this declaration has no storage class or type specifier
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\appender.h
139 5 Test
27 IntelliSense: identifier "Appender" is undefined
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\appender.h
139 21 Test
28 IntelliSense: this declaration has no storage class or type specifier
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\appender.h
140 5 Test
29 IntelliSense: identifier "AppenderList" is undefined
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\appender.h
140 22 Test
30 IntelliSense: expected a ')'
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\appender.h
140 34 Test
31 IntelliSense: expected a declaration
c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\src\main\include\log4cxx\appender.h
142 1 Test

Here's a code extract

#include <log4cxx/logger.h>
#include <log4cxx/xml/domconfigurator.h>

using namespace log4cxx;
using namespace log4cxx::xml;
using namespace log4cxx::helpers;

LoggerPtr logger(Logger::getLogger("Test"));
DOMConfigurator::configure("TestConfig.xml");

MT4_EXPFUNC double __stdcall Test(const RateInfo* rates, const int
rates_total, const int period, const int shift, const ENUM_APPIED_PRICE
applied_price)
{
    LOG4CXX_DEBUG(logger, "Test NULL array");
    return(0.0);
}

Could someone give me some pointers on how to get this working please as I
don't know where to start.

I know newbies are annoying so my apologies and thanks for your
understanding.

-Andrew
-------
Internet communications are not secure and therefore Andrew Leach does not
accept legal responsibility for the contents of this message.  The
information contained in this email is private, personal and confidential
and may be legally privileged.  It is intended solely for the addressee.
If you are not the intended recipient, any disclosure, copying,
distribution or any action taken or omitted to be taken in reliance on it,
is prohibited and may be unlawful. This email and any attachments have been
automatically scanned for viruses prior to dispatch, but we make no
warranty that they are free from computer viruses.  You are advised to
check all emails and attachments using your own anti virus software before
opening or executing them.

Re: Help with first C++ program to do logging

Posted by Thorsten Schöning <ts...@am-soft.de>.
Guten Tag Andrew Leach,
am Montag, 12. Oktober 2015 um 18:07 schrieben Sie:

> I've tried for several hours to build the package but find it to be an impossible task.

It's not, I've done it in the past, but it's been a while now and I
don't remember if I used mvn as a frontend for ant or vice versa. I
think the first, because mvn should handle the dependencies...

> [WARNING] Error injecting: org.apache.maven.plugin.antrun.AntRunMojo
> java.lang.NoClassDefFoundError: org/apache/tools/ant/BuildException

Looks like ANT is not properly set up in this environment.

> And Ant fails with these errors:

> C:\Users\ypx7647\Downloads\apache-log4cxx>ant -Dfind=false
> Buildfile: C:\Users\ypx7647\Downloads\apache-log4cxx\build.xml
>   [taskdef] Could not load definitions from resource net/sf/antcontrib/antcontri
> b.properties. It could not be found.

Looks like ant-contrib and/or cpptasks is missing. mvn should have
downloaded them.

> And the projects directory doesn't exist in the SVN checkout!

The project files are generated from the ant script by passing the
necessary options, the script can either build directly or generate
the project files. Some things in between work as well: Use the old
project files with a checkout from trunk or build your own project
files for your IDE. In the latter case you need to create a project,
add all the cpp files and copy log4cxx.hw to log4cxx.h in the same
dir. Of course you need to take care about the dependencies like APR
on your own as well, but APR should support MSVC.

I personally prefer custom IDE projects, but spent quite some days
getting all up running.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning       E-Mail: Thorsten.Schoening@AM-SoFT.de
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/

Telefon...........05151-  9468- 55
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


RE: Help with first C++ program to do logging

Posted by Dana Irvin <di...@ingenicomm.com>.
This might just be a bias of mine – but I don’t think the best place to put Maven or Ant is in AppData/Roaming. Maven and Ant are both in there, and are the elements you seem to be having issue with. I’d move them out, even if just to test. I’d say put either in Program Files, or at the C: root (C:\apache-ant-1.9.6 is where I have it on one machine), and change your paths accordingly.

 

Just a thought.

 

Dana Irvin (Dirv) | Sr Software Engineer | Ingenicomm, Inc. |  <ma...@ingenicomm.com> dirvin@ingenicomm.com

 

From: Andrew Leach [mailto:imamushroom@gmail.com] 
Sent: Monday, October 12, 2015 2:34 PM
To: Log4CXX User
Subject: Re: Help with first C++ program to do logging

 

> This class is in ant.jar, which is e.g. in my installation folder
> "C:\Program Files (x86)\Apache Ant\lib". The "bin" folder of that is
> in my path and contains some ant.bat which deals with things like
> ANT_HOME, classpath and such. Have a look at that. I don't remember
> anymore how I set up my ANT and currently don't have the time to play
> with that, sorry.

 

I'm not saying that there isn't anything wrong with my ANT setup however, I can't see what could be wrong. I present my environment variables to prove that I've done what I believe to be correct.

 

C:\Users\ypx7647\Downloads\apache-log4cxx>echo %PATH%

C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x8

6)\Common Files\Microsoft Shared\Windows Live;C:\windows\system32;C:\windows;C:\

windows\System32\Wbem;C:\Program Files (x86)\Windows Live\Shared;C:\Program File

s (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Microsoft SQ

L Server\100\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Bin

n\;C:\Users\ypx7647\AppData\Roaming\Apache\apache-maven-3.3.3\bin;C:\PROGRA~1\Ja

va\jdk1.7.0_75\bin;C:\"Program Files (x86)"\Notepad++;C:\Program Files (x86)\Gtk

Sharp\2.12\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\Calibre2\

;C:\Program Files\Exercism\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn

\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files (x86)\M

icrosoft SDKs\TypeScript\1.0\;C:\Program Files (x86)\AMD\ATI.ACE\Core-Static;C:\

Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\Microsoft

 SDKs\Azure\CLI\wbin;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program File

s (x86)\Toshiba\Bluetooth Toshiba Stack\sys\;C:\Program Files (x86)\Toshiba\Blue

tooth Toshiba Stack\sys\x64\;C:\Program Files (x86)\Intel\Services\IPT\;C:\Progr

am Files (x86)\GNU\GnuPG\pub;C:\Program Files (x86)\Skype\Phone\;C:\Program File

s (x86)\QuickTime\QTSystem\;%USERPROFILE%\.dnx\bin;C:\Program Files\Microsoft DN

X\Dnvm\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\P

rogram Files (x86)\Git\cmd;C:\Users\ypx7647\AppData\Roaming\Apache\apache-ant-1.

9.6\bin;C:\Program Files (x86)\GnuWin32\bin;C:\WinPython-64bit-2.7.6.4\python-2.

7.6.amd64;C:\phantomjs-1.9.8-windows;C:\n1k0-casperjs-4f105a9\bin;C:\MinGW\bin\;

C:\MinGW\msys\1.0\bin\;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bi

n;

 

C:\Users\ypx7647\Downloads\apache-log4cxx>echo %ANT_HOME%

C:\Users\ypx7647\AppData\Roaming\Apache\apache-ant-1.9.6

 

C:\Users\ypx7647\Downloads\apache-log4cxx>echo %CLASSPATH%

 

C:\Users\ypx7647\Downloads\apache-log4cxx>dir %ANT_HOME%\lib\ant.jar

 Volume in drive C is 

 Volume Serial Number is 

 

 Directory of C:\Users\ypx7647\AppData\Roaming\Apache\apache-ant-1.9.6\lib

 

29/06/2015  06:45         2 029 794 ant.jar

               1 File(s)      2 029 794 bytes

               0 Dir(s)  33 850 724 352 bytes free

 

Anyone any other ideas?

-Andrew


-------
Internet communications are not secure and therefore Andrew Leach does not accept legal responsibility for the contents of this message.  The information contained in this email is private, personal and confidential and may be legally privileged.  It is intended solely for the addressee.  If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. This email and any attachments have been automatically scanned for viruses prior to dispatch, but we make no warranty that they are free from computer viruses.  You are advised to check all emails and attachments using your own anti virus software before opening or executing them.

 

On 12 October 2015 at 22:12, Thorsten Schöning <ts...@am-soft.de> wrote:

Guten Tag Andrew Leach,
am Montag, 12. Oktober 2015 um 21:23 schrieben Sie:

> It's seems there's a problem with the maven-antrun-plugin v1.7. I
> seen numerous issues like the one I'm experiencing when I did a search on the web.

This still looks like your ANT is wrongly setup or simply not
available.

> [WARNING] Error injecting: org.apache.maven.plugin.antrun.AntRunMojo
> java.lang.NoClassDefFoundError: org/apache/tools/ant/BuildException

This class is in ant.jar, which is e.g. in my installation folder
"C:\Program Files (x86)\Apache Ant\lib". The "bin" folder of that is
in my path and contains some ant.bat which deals with things like
ANT_HOME, classpath and such. Have a look at that. I don't remember
anymore how I set up my ANT and currently don't have the time to play
with that, sorry.


Mit freundlichen Grüßen,

Thorsten Schöning

--
Thorsten Schöning       E-Mail: Thorsten.Schoening@AM-SoFT.de
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/

Telefon...........05151-  9468- 55
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow

 

  _____  

No virus found in this message.
Checked by AVG - www.avg.com
Version: 2015.0.6172 / Virus Database: 4435/10782 - Release Date: 10/08/15


Re: Help with first C++ program to do logging

Posted by Thorsten Schöning <ts...@am-soft.de>.
Guten Tag Andrew Leach,
am Montag, 12. Oktober 2015 um 22:33 schrieben Sie:

> Directory of
> C:\Users\ypx7647\AppData\Roaming\Apache\apache-ant-1.9.6\lib

You have two problems: First, BuildException is not found for any
reason, second, there's a problem with the build at all, that's why
BuildException is needed. As you are on Windows, in situations like
yours I fire up Process Monitor, trace the I/O and just search for
"BuildException" or such to see which paths are checked by Java/Maven.
Most of the times some things occur...

In a quick test in my installation I just deleted my .m2 folder
completely and issued "mvn package", which resulted in some downloaded
libs again. Some of those libs where ant 1.9.3 already, so it might be
that your user wide installation is simply not needed at all. Process
Monitor clearly shows that my system wide installation of ANT is NOT
used and I don't have ANT_HOME set in my env.

My build fails though, because I don't have any suitable compiler
available. So, what can I read in my shell?

> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:
> run (compile) on project apache-log4cxx: An Ant BuildException has occured: The
> following error occurred while executing this line:
> [ERROR] C:\Users\tschoening\Documents\Svn\Src\Libs\branches\C++\RAD 10\Logging\l
> og4cxx\0.11.0-SNAPSHOT\src\build.xml:563: The following error occurred while exe
> cuting this line:
> [ERROR] C:\Users\tschoening\Documents\Svn\Src\Libs\branches\C++\RAD 10\Logging\l
> og4cxx\0.11.0-SNAPSHOT\src\src\ant\apr-build.xml:155: Could not launch cl: java.
> io.IOException: Cannot run program "cl" (in directory "C:\Users\tschoening\Docum
> ents\Svn\Src\Libs\branches\C++\RAD 10\Logging\log4cxx\0.11.0-SNAPSHOT\src\target
> \debug\static\apr-ofiles"): CreateProcess error=2, Das System kann die angegeben
> e Datei nicht finden
> [ERROR] around Ant part ...<ant target="build"/>... @ 4:24 in C:\Users\tschoenin
> g\Documents\Svn\Src\Libs\branches\C++\RAD 10\Logging\log4cxx\0.11.0-SNAPSHOT\src
> \target\antrun\build-main.xml
> [ERROR] -> [Help 1]

As you see, I properly get a BuildException instead of a
ClassNotFoundException, like you. And I use trunk myself, just copied
APR in the right directories and issued mvn package. My MVN version:

> Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 17:22:2
> 2+0200)
> Maven home: C:\Program Files (x86)\Apache Maven\bin\..
> Java version: 1.8.0_60, vendor: Oracle Corporation
> Java home: C:\Program Files\Java\jdk1.8.0_60\jre
> Default locale: de_DE, platform encoding: Cp1252
> OS name: "windows 8.1", version: "6.3", arch: "amd64", family: "dos"

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning       E-Mail: Thorsten.Schoening@AM-SoFT.de
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/

Telefon...........05151-  9468- 55
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


Re: Help with first C++ program to do logging

Posted by Andrew Leach <im...@gmail.com>.
> This class is in ant.jar, which is e.g. in my installation folder
> "C:\Program Files (x86)\Apache Ant\lib". The "bin" folder of that is
> in my path and contains some ant.bat which deals with things like
> ANT_HOME, classpath and such. Have a look at that. I don't remember
> anymore how I set up my ANT and currently don't have the time to play
> with that, sorry.

I'm not saying that there isn't anything wrong with my ANT setup however, I
can't see what could be wrong. I present my environment variables to prove
that I've done what I believe to be correct.

C:\Users\ypx7647\Downloads\apache-log4cxx>*echo %PATH%*
*C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program
Files (x8*
*6)\Common Files\Microsoft Shared\Windows
Live;C:\windows\system32;C:\windows;C:\*
*windows\System32\Wbem;C:\Program Files (x86)\Windows
Live\Shared;C:\Program File*
*s (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files
(x86)\Microsoft SQ*
*L Server\100\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL
Server\100\DTS\Bin*
*n\;C:\Users\ypx7647\AppData\Roaming\Apache\apache-maven-3.3.3\bin;C:\PROGRA~1\Ja*
*va\jdk1.7.0_75\bin;C:\"Program Files (x86)"\Notepad++;C:\Program Files
(x86)\Gtk*
*Sharp\2.12\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files
(x86)\Calibre2\*
*;C:\Program Files\Exercism\;C:\Program Files\Microsoft SQL
Server\110\Tools\Binn*
*\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files
(x86)\M*
*icrosoft SDKs\TypeScript\1.0\;C:\Program Files
(x86)\AMD\ATI.ACE\Core-Static;C:\*
*Program Files\Microsoft\Web Platform Installer\;C:\Program Files
(x86)\Microsoft*
* SDKs\Azure\CLI\wbin;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program
File*
*s (x86)\Toshiba\Bluetooth Toshiba Stack\sys\;C:\Program Files
(x86)\Toshiba\Blue*
*tooth Toshiba Stack\sys\x64\;C:\Program Files
(x86)\Intel\Services\IPT\;C:\Progr*
*am Files (x86)\GNU\GnuPG\pub;C:\Program Files
(x86)\Skype\Phone\;C:\Program File*
*s (x86)\QuickTime\QTSystem\;%USERPROFILE%\.dnx\bin;C:\Program
Files\Microsoft DN*
*X\Dnvm\;C:\Program Files (x86)\Windows Kits\10\Windows Performance
Toolkit\;C:\P*
*rogram Files (x86)\Git\cmd*;
*C:\Users\ypx7647\AppData\Roaming\Apache\apache-ant-1.*
*9.6\bin**;C:\Program Files
(x86)\GnuWin32\bin;C:\WinPython-64bit-2.7.6.4\python-2.*
*7.6.amd64;C:\phantomjs-1.9.8-windows;C:\n1k0-casperjs-4f105a9\bin;C:\MinGW\bin\;*
*C:\MinGW\msys\1.0\bin\;C:\Program Files (x86)\Microsoft Visual Studio
14.0\VC\bi*
*n;*

C:\Users\ypx7647\Downloads\apache-log4cxx>*echo %ANT_HOME%*
*C:\Users\ypx7647\AppData\Roaming\Apache\apache-ant-1.9.6*

C:\Users\ypx7647\Downloads\apache-log4cxx>*echo %CLASSPATH%*

C:\Users\ypx7647\Downloads\apache-log4cxx>*dir %ANT_HOME%\lib\ant.jar*
 Volume in drive C is
 Volume Serial Number is

 Directory of C:\Users\ypx7647\AppData\Roaming\Apache\apache-ant-1.9.6\lib

29/06/2015  06:45         2 029 794 ant.jar
               1 File(s)      2 029 794 bytes
               0 Dir(s)  33 850 724 352 bytes free

Anyone any other ideas?
-Andrew
-------
Internet communications are not secure and therefore Andrew Leach does not
accept legal responsibility for the contents of this message.  The
information contained in this email is private, personal and confidential
and may be legally privileged.  It is intended solely for the addressee.
If you are not the intended recipient, any disclosure, copying,
distribution or any action taken or omitted to be taken in reliance on it,
is prohibited and may be unlawful. This email and any attachments have been
automatically scanned for viruses prior to dispatch, but we make no
warranty that they are free from computer viruses.  You are advised to
check all emails and attachments using your own anti virus software before
opening or executing them.

On 12 October 2015 at 22:12, Thorsten Schöning <ts...@am-soft.de>
wrote:

> Guten Tag Andrew Leach,
> am Montag, 12. Oktober 2015 um 21:23 schrieben Sie:
>
> > It's seems there's a problem with the maven-antrun-plugin v1.7. I
> > seen numerous issues like the one I'm experiencing when I did a search
> on the web.
>
> This still looks like your ANT is wrongly setup or simply not
> available.
>
> > [WARNING] Error injecting: org.apache.maven.plugin.antrun.AntRunMojo
> > java.lang.NoClassDefFoundError: org/apache/tools/ant/BuildException
>
> This class is in ant.jar, which is e.g. in my installation folder
> "C:\Program Files (x86)\Apache Ant\lib". The "bin" folder of that is
> in my path and contains some ant.bat which deals with things like
> ANT_HOME, classpath and such. Have a look at that. I don't remember
> anymore how I set up my ANT and currently don't have the time to play
> with that, sorry.
>
> Mit freundlichen Grüßen,
>
> Thorsten Schöning
>
> --
> Thorsten Schöning       E-Mail: Thorsten.Schoening@AM-SoFT.de
> AM-SoFT IT-Systeme      http://www.AM-SoFT.de/
>
> Telefon...........05151-  9468- 55
> Fax...............05151-  9468- 88
> Mobil..............0178-8 9468- 04
>
> AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
> AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow
>
>

Re: Help with first C++ program to do logging

Posted by Thorsten Schöning <ts...@am-soft.de>.
Guten Tag Andrew Leach,
am Montag, 12. Oktober 2015 um 21:23 schrieben Sie:

> It's seems there's a problem with the maven-antrun-plugin v1.7. I
> seen numerous issues like the one I'm experiencing when I did a search on the web.

This still looks like your ANT is wrongly setup or simply not
available.

> [WARNING] Error injecting: org.apache.maven.plugin.antrun.AntRunMojo
> java.lang.NoClassDefFoundError: org/apache/tools/ant/BuildException

This class is in ant.jar, which is e.g. in my installation folder
"C:\Program Files (x86)\Apache Ant\lib". The "bin" folder of that is
in my path and contains some ant.bat which deals with things like
ANT_HOME, classpath and such. Have a look at that. I don't remember
anymore how I set up my ANT and currently don't have the time to play
with that, sorry.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning       E-Mail: Thorsten.Schoening@AM-SoFT.de
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/

Telefon...........05151-  9468- 55
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


Re: Help with first C++ program to do logging

Posted by Andrew Leach <im...@gmail.com>.
I've produced a debug log of the maven output and attached it.

It's seems there's a problem with the maven-antrun-plugin v1.7. I seen
numerous issues like the one I'm experiencing when I did a search on the
web.

I've tried overriding the version to 1.6 & 1.5 in the pom.xml but received
different errors. I even tried to checkout version 1.8 but I don't know
maven well enough in order to get it to upload into the local .m2
repository. If anyone knows, let me know and I'll try that out.

Next, I'll try the ant route.

Thanks again for everyone's help.
-Andrew

-------
Internet communications are not secure and therefore Andrew Leach does not
accept legal responsibility for the contents of this message.  The
information contained in this email is private, personal and confidential
and may be legally privileged.  It is intended solely for the addressee.
If you are not the intended recipient, any disclosure, copying,
distribution or any action taken or omitted to be taken in reliance on it,
is prohibited and may be unlawful. This email and any attachments have been
automatically scanned for viruses prior to dispatch, but we make no
warranty that they are free from computer viruses.  You are advised to
check all emails and attachments using your own anti virus software before
opening or executing them.

On 12 October 2015 at 19:47, Thorsten Schöning <ts...@am-soft.de>
wrote:

> Guten Tag Dana Irvin,
> am Montag, 12. Oktober 2015 um 19:02 schrieben Sie:
>
> > Below are the errors I get – they seem centered around the APR
> > random stuff. In APR 1.5.2, I only see a unix directory under the random
> directory.
>
> That's fine, just build with that. APR saves all platform independent
> code in such unix dirs and I have added those files in my project and
> got an "apr_generate_random_bytes" in my lib. I have quite some other
> unix dirs in my project as well, like "file_io", else it wouldn't even
> compile.
>
> Mit freundlichen Grüßen,
>
> Thorsten Schöning
>
> --
> Thorsten Schöning       E-Mail: Thorsten.Schoening@AM-SoFT.de
> AM-SoFT IT-Systeme      http://www.AM-SoFT.de/
>
> Telefon...........05151-  9468- 55
> Fax...............05151-  9468- 88
> Mobil..............0178-8 9468- 04
>
> AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
> AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow
>
>

Re: Help with first C++ program to do logging

Posted by Thorsten Schöning <ts...@am-soft.de>.
Guten Tag Dana Irvin,
am Montag, 12. Oktober 2015 um 19:02 schrieben Sie:

> Below are the errors I get – they seem centered around the APR
> random stuff. In APR 1.5.2, I only see a unix directory under the random directory.

That's fine, just build with that. APR saves all platform independent
code in such unix dirs and I have added those files in my project and
got an "apr_generate_random_bytes" in my lib. I have quite some other
unix dirs in my project as well, like "file_io", else it wouldn't even
compile.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning       E-Mail: Thorsten.Schoening@AM-SoFT.de
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/

Telefon...........05151-  9468- 55
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


RE: Help with first C++ program to do logging

Posted by Dana Irvin <di...@ingenicomm.com>.
Below are the errors I get – they seem centered around the APR random stuff. In APR 1.5.2, I only see a unix directory under the random directory.

 

       [cc] nteventlogappender.cpp

       [cc] Generating Code...

       [cc] Starting link

       [cc]    Creating library log4cxx.lib and object log4cxx.exp

       [cc] apr-1.lib(pipe.obj) : error LNK2019: unresolved external symbol apr_

generate_random_bytes referenced in function apr_file_pipe_create_ex

       [cc] apr-1.lib(pipe.obj) : error LNK2019: unresolved external symbol apr_

escape_hex referenced in function apr_file_pipe_create_ex

       [cc] log4cxx.dll : fatal error LNK1120: 2 unresolved externals

 

BUILD FAILED

 

This is with the latest log4cxx trunk (just did an svn up to rev 1708163), using the ant build command I had outlined previously.

 

Regards, 

 

DANA IRVIN (DIRV) | SR SOFTWARE ENGINEER | INGENICOMM, INC. | 720.328.0058 | DIRVIN@INGENICOMM.COM

 

-----Original Message-----
From: Thorsten Schöning [mailto:tschoening@am-soft.de] 
Sent: Monday, October 12, 2015 10:49 AM
To: Log4CXX User; dirvin@ingenicomm.com
Subject: Re: Help with first C++ program to do logging

 

Guten Tag Dana Irvin,

am Montag, 12. Oktober 2015 um 18:33 schrieben Sie:

 

> One thing

> of note – I found the trunk wouldn’t compile/link complete with the 

> current version of APR and APR-Util. I had to use APR 1.5.1 and 

> APR-Util 1.5.3 for Windows. There are some undefined references in the 

> Win32 build of one of those. I don’t remember which. Thorsten, have 

> you or any of the contributors seen something similar?

 

No and in fact I spent the last two weeks or so to get APR 1.5.2, APR-Util 1.5.4 and APR-Iconv 1.2.1 R2 running and usable with current trunk of log4cxx, successful in the end. But I created my own custom projects from scratch for my Embarcadero C++-Builder 10 and the things I needed to address where all around that compiler and its support by APR.

 

So, could you be more verbose about the errors you got? We should at least file some bugs.

 

Mit freundlichen Grüßen,

 

Thorsten Schöning

 

-- 

Thorsten Schöning       E-Mail:  <ma...@AM-SoFT.de> Thorsten.Schoening@AM-SoFT.de

AM-SoFT IT-Systeme       <http://www.AM-SoFT.de/> http://www.AM-SoFT.de/

 

Telefon...........05151-  9468- 55

Fax...............05151-  9468- 88

Mobil..............0178-8 9468- 04

 

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow

 

 

-----

No virus found in this message.

Checked by AVG -  <http://www.avg.com> www.avg.com

Version: 2015.0.6172 / Virus Database: 4435/10782 - Release Date: 10/08/15


Re: Help with first C++ program to do logging

Posted by Thorsten Schöning <ts...@am-soft.de>.
Guten Tag Dana Irvin,
am Montag, 12. Oktober 2015 um 18:33 schrieben Sie:

> One thing
> of note – I found the trunk wouldn’t compile/link complete with the
> current version of APR and APR-Util. I had to use APR 1.5.1 and
> APR-Util 1.5.3 for Windows. There are some undefined references in
> the Win32 build of one of those. I don’t remember which. Thorsten,
> have you or any of the contributors seen something similar?

No and in fact I spent the last two weeks or so to get APR 1.5.2,
APR-Util 1.5.4 and APR-Iconv 1.2.1 R2 running and usable with current
trunk of log4cxx, successful in the end. But I created my own custom
projects from scratch for my Embarcadero C++-Builder 10 and the things
I needed to address where all around that compiler and its support by
APR.

So, could you be more verbose about the errors you got? We should at
least file some bugs.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning       E-Mail: Thorsten.Schoening@AM-SoFT.de
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/

Telefon...........05151-  9468- 55
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


RE: Help with first C++ program to do logging

Posted by Dana Irvin <di...@ingenicomm.com>.
Hi, Andrew. I just went through a Log4Cxx rebuild myself with setting up a new build server last week, so I can appreciate the hurdle that can be.

 

I would recommend use the Ant build procedure, and checking out from the SVN trunk. That procedure seemed to work out best for me. Also, completely abandon doing anything with the VS projects themselves. That, IMHO, is just a time-suck and I haven’t gotten it to reliably work for various VS versions or architectures. One thing of note – I found the trunk wouldn’t compile/link complete with the current version of APR and APR-Util. I had to use APR 1.5.1 and APR-Util 1.5.3 for Windows. There are some undefined references in the Win32 build of one of those. I don’t remember which. Thorsten, have you or any of the contributors seen something similar? If you see similar things, I have copies of the win32 src archives for those versions. I can probably get those to you somehow – I didn’t see them on the Apache site. Just email me directly.

 

Here are some snippets of my vendors build batch script. Hopefully you’ll get some value out of it:

 

rem ## copy the apr and apr-util packages here

                xcopy /Y ..\apr\apr-1.5.1-win32-src.zip .

                7z x apr-1.5.1-win32-src.zip > nul

                rename apr-1.5.1 apr

                xcopy /Y ..\apr-util\apr-util-1.5.3-win32-src.zip .

                7z x apr-util-1.5.3-win32-src.zip > nul

                rename apr-util-1.5.3 apr-util

                IF NOT DEFINED VisualStudioVersion call "%VS110COMNTOOLS%\..\..\VC\vcvarsall.bat" AMD64

                rem go to the trunk checkout – defined/checked out above

                cd %_log4cxx%

                ant -lib ..\ant-cp-addons -lib ..\misc-cp-addons -Dfind=false -Ddebug=true build

                ant -lib ..\ant-cp-addons -lib ..\misc-cp-addons -Dfind=false -Ddebug=false build

                xcopy src\main\include\* ..\distbuild\include /E /Y /K /Q /C 

                del ..\distbuild\include\Makefile*

                copy target\debug\shared\log4cxx.dll ..\distbuild\lib\log4cxxd.dll

                copy target\debug\shared\log4cxx.exp ..\distbuild\lib\log4cxxd.exp

                copy target\debug\shared\log4cxx.lib ..\distbuild\lib\log4cxxd.lib

                copy target\release\shared\log4cxx.dll ..\distbuild\lib

                copy target\release\shared\log4cxx.exp ..\distbuild\lib

                copy target\release\shared\log4cxx.lib ..\distbuild\lib

                cd ..\..

 

The distbuild stuff breaks out into include and lib subdirectories, which allow easy additions to project files for including the header files, and finding the import libs. 

 

The VisualStudioVersion line will likely have to be modified to your version of Visual Studio. We use 2012 (11.0) for our builds, so that will likely be different for you.

 

I do have “ant-cp-addons” and “misc-cp-addons” which put some of the needed jars on the ant classpath. In ant-cp-addons, I have the ant-contrib-1.0b3.jar and cpptasks.jar files. In misc-cp-addons, I have the Xerces-J jars and log4j.1.2.17.jar – I’m not certain if these are 100% necessary but kept those in there from building cpptasks.jar.

 

Hopefully that is helpful. I use the above stuff to build a X64 version on both Win32 and Win64 systems. Please let me know if you have any questions.

 

Regards,

 

Dana Irvin (Dirv) | Sr Software Engineer | Ingenicomm, Inc. |   <ma...@ingenicomm.com> dirvin@ingenicomm.com

 

From: Andrew Leach [mailto:imamushroom@gmail.com] 
Sent: Monday, October 12, 2015 10:08 AM
To: Log4CXX User
Subject: Re: Help with first C++ program to do logging

 

Thanks for you email.

 

I've tried for several hours to build the package but find it to be an impossible task.

 

Maven fails with these errors:

 

[INFO] ------------------------------------------------------------------------

[INFO] Building Apache log4cxx (Incubating) 0.11.0-SNAPSHOT

[INFO] ------------------------------------------------------------------------

[INFO]

[INFO] --- maven-antrun-plugin:1.7:run (compile) @ apache-log4cxx ---

[WARNING] Error injecting: org.apache.maven.plugin.antrun.AntRunMojo

java.lang.NoClassDefFoundError: org/apache/tools/ant/BuildException

        at java.lang.Class.getDeclaredConstructors0(Native Method)

        at java.lang.Class.privateGetDeclaredConstructors(Class.java:2585)

        at java.lang.Class.getDeclaredConstructors(Class.java:1906)

        at com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.

java:245)

        at com.google.inject.internal.ConstructorBindingImpl.create(ConstructorB

indingImpl.java:99)

        at com.google.inject.internal.InjectorImpl.createUninitializedBinding(In

jectorImpl.java:657)

        at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(Injec

torImpl.java:875)

        at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecurs

ive(InjectorImpl.java:798)

        at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(Injector

Impl.java:281)

        at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImp

l.java:213)

        at com.google.inject.internal.InjectorImpl.getProviderOrThrow(InjectorIm

pl.java:998)

        at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java

:1031)

        at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java

:994)

        at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java

:1044)

        at org.eclipse.sisu.space.AbstractDeferredClass.get(AbstractDeferredClas

s.java:48)

        at com.google.inject.internal.ProviderInternalFactory.provision(Provider

InternalFactory.java:86)

        at com.google.inject.internal.InternalFactoryToInitializableAdapter.prov

ision(InternalFactoryToInitializableAdapter.java:54)

        at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInt

ernalFactory.java:70)

        at com.google.inject.internal.ProvisionListenerStackCallback$Provision.p

rovision(ProvisionListenerStackCallback.java:115)

        at org.eclipse.sisu.bean.BeanScheduler$Activator.onProvision(BeanSchedul

er.java:176)

        at com.google.inject.internal.ProvisionListenerStackCallback$Provision.p

rovision(ProvisionListenerStackCallback.java:126)

        at com.google.inject.internal.ProvisionListenerStackCallback.provision(P

rovisionListenerStackCallback.java:68)

        at com.google.inject.internal.ProviderInternalFactory.circularGet(Provid

erInternalFactory.java:68)

        at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(

InternalFactoryToInitializableAdapter.java:46)

        at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:10

09)

        at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.ja

va:1059)

        at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1005)

 

        at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:3

6)

        at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:81)

 

        at org.eclipse.sisu.plexus.LazyPlexusBean.getValue(LazyPlexusBean.java:5

1)

        at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContai

ner.java:263)

        at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContai

ner.java:255)

        at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfigu

redMojo(DefaultMavenPluginManager.java:546)

        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default

BuildPluginManager.java:121)

        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor

.java:208)

        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor

.java:153)

        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor

.java:145)

        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje

ct(LifecycleModuleBuilder.java:116)

        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje

ct(LifecycleModuleBuilder.java:80)

        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThre

adedBuilder.build(SingleThreadedBuilder.java:51)

        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl

eStarter.java:128)

        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)

        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)

        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)

        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)

        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)

        at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:606)

        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun

cher.java:289)

        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav

a:229)

        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La

uncher.java:415)

        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:

356)

Caused by: java.lang.ClassNotFoundException: org.apache.tools.ant.BuildException

 

        at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(

SelfFirstStrategy.java:50)

        at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadCl

ass(ClassRealm.java:271)

        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm

.java:247)

        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm

.java:239)

        ... 55 more

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 1.079 s

[INFO] Finished at: 2015-10-12T17:57:40+02:00

[INFO] Final Memory: 8M/115M

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:

run (compile) on project apache-log4cxx: Execution compile of goal org.apache.ma

ven.plugins:maven-antrun-plugin:1.7:run failed: A required class was missing whi

le executing org.apache.maven.plugins:maven-antrun-plugin:1.7:run: org/apache/to

ols/ant/BuildException

[ERROR] -----------------------------------------------------

[ERROR] realm =    plugin>org.apache.maven.plugins:maven-antrun-plugin:1.7

[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy

[ERROR] urls[0] = file:/C:/Users/ypx7647/.m2/repository/org/apache/maven/plugins

/maven-antrun-plugin/1.7/maven-antrun-plugin-1.7.jar

[ERROR] urls[1] = file:/C:/Users/ypx7647/.m2/repository/org/apache/ant/ant/1.9.3

/ant-1.9.3.jar

[ERROR] urls[2] = file:/C:/Users/ypx7647/.m2/repository/org/apache/ant/ant-launc

her/1.9.3/ant-launcher-1.9.3.jar

[ERROR] urls[3] = file:/C:/Users/ypx7647/.m2/repository/ant-contrib/ant-contrib/

1.0b2/ant-contrib-1.0b2.jar

[ERROR] urls[4] = file:/C:/Users/ypx7647/.m2/repository/ant/ant/1.5/ant-1.5.jar

[ERROR] urls[5] = file:/C:/Users/ypx7647/.m2/repository/ant-contrib/cpptasks/1.0

b5/cpptasks-1.0b5.jar

[ERROR] urls[6] = file:/C:/Users/ypx7647/.m2/repository/xerces/xercesImpl/2.8.1/

xercesImpl-2.8.1.jar

[ERROR] urls[7] = file:/C:/Users/ypx7647/.m2/repository/xml-apis/xml-apis/1.3.03

/xml-apis-1.3.03.jar

[ERROR] urls[8] = file:/C:/Users/ypx7647/.m2/repository/org/codehaus/plexus/plex

us-interpolation/1.1/plexus-interpolation-1.1.jar

[ERROR] urls[9] = file:/C:/Users/ypx7647/.m2/repository/junit/junit/3.8.1/junit-

3.8.1.jar

[ERROR] urls[10] = file:/C:/Users/ypx7647/.m2/repository/org/codehaus/plexus/ple

xus-utils/2.0.5/plexus-utils-2.0.5.jar

[ERROR] Number of foreign imports: 1

[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]

[ERROR]

[ERROR] -----------------------------------------------------: org.apache.tools.

ant.BuildException

[ERROR] -> [Help 1]

[ERROR]

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit

ch.

[ERROR] Re-run Maven using the -X switch to enable full debug logging.

[ERROR]

[ERROR] For more information about the errors and possible solutions, please rea

d the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContaine

rException

 

And Ant fails with these errors:

 

C:\Users\ypx7647\Downloads\apache-log4cxx>ant -Dfind=false

Buildfile: C:\Users\ypx7647\Downloads\apache-log4cxx\build.xml

  [taskdef] Could not load definitions from resource net/sf/antcontrib/antcontri

b.properties. It could not be found.

 

BUILD FAILED

C:\Users\ypx7647\Downloads\apache-log4cxx\build.xml:184: Problem: failed to crea

te task or type propertyregex

Cause: The name is undefined.

Action: Check the spelling.

Action: Check that any custom tasks/types have been declared.

Action: Check that any <presetdef>/<macrodef> declarations have taken place.

 

 

Total time: 0 seconds

 

And the projects directory doesn't exist in the SVN checkout!

 

I'm completely stuck.

 

Could someone help out please?

 

Thanks,

Andrew




-------
Internet communications are not secure and therefore Andrew Leach does not accept legal responsibility for the contents of this message.  The information contained in this email is private, personal and confidential and may be legally privileged.  It is intended solely for the addressee.  If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. This email and any attachments have been automatically scanned for viruses prior to dispatch, but we make no warranty that they are free from computer viruses.  You are advised to check all emails and attachments using your own anti virus software before opening or executing them.

 

On 12 October 2015 at 15:35, Thorsten Schöning <ts...@am-soft.de> wrote:

Guten Tag Andrew Leach,
am Montag, 12. Oktober 2015 um 15:05 schrieben Sie:

> I believe I've correctly configured the include directory for
> log4cxx into VS2013 as the include's aren't showing up any errors.

You need to setup log4cxx properly as well.

> c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\[...]

You shouldn't start with log4cxx 0.10.0 anymore, checkout a current
trunk using SVN or download it using your browser. While not
officially released yet, the current trunk contains a lot of bug
fixes.

https://logging.apache.org/log4cxx/source-repository.html

> Error   1       error C1083: Cannot open include file:
> 'log4cxx/log4cxx.h': No such file or directory

This is most likely the root cause, log4cxx can't work properly
without that header. You haven't setup your building environment for
log4cxx properly and should first read the docs on how to build the
lib. If your already done so, you either made something wrong or the
instructions are not clear enough or whatever, so feel free to tell us
and we might fix things.

https://logging.apache.org/log4cxx/building/index.html
https://logging.apache.org/log4cxx/usage.html

Mit freundlichen Grüßen,

Thorsten Schöning

--
Thorsten Schöning       E-Mail: Thorsten.Schoening@AM-SoFT.de
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/

Telefon...........05151-  9468- 55
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow

 

  _____  

No virus found in this message.
Checked by AVG - www.avg.com
Version: 2015.0.6172 / Virus Database: 4435/10782 - Release Date: 10/08/15


Re: Help with first C++ program to do logging

Posted by Andrew Leach <im...@gmail.com>.
Thanks for you email.

I've tried for several hours to build the package but find it to be an
impossible task.

Maven fails with these errors:

[INFO]
------------------------------------------------------------------------
[INFO] Building Apache log4cxx (Incubating) 0.11.0-SNAPSHOT
[INFO]
------------------------------------------------------------------------
[INFO]
[INFO] --- maven-antrun-plugin:1.7:run (compile) @ apache-log4cxx ---
[WARNING] Error injecting: org.apache.maven.plugin.antrun.AntRunMojo
java.lang.NoClassDefFoundError: org/apache/tools/ant/BuildException
        at java.lang.Class.getDeclaredConstructors0(Native Method)
        at java.lang.Class.privateGetDeclaredConstructors(Class.java:2585)
        at java.lang.Class.getDeclaredConstructors(Class.java:1906)
        at
com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.
java:245)
        at
com.google.inject.internal.ConstructorBindingImpl.create(ConstructorB
indingImpl.java:99)
        at
com.google.inject.internal.InjectorImpl.createUninitializedBinding(In
jectorImpl.java:657)
        at
com.google.inject.internal.InjectorImpl.createJustInTimeBinding(Injec
torImpl.java:875)
        at
com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecurs
ive(InjectorImpl.java:798)
        at
com.google.inject.internal.InjectorImpl.getJustInTimeBinding(Injector
Impl.java:281)
        at
com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImp
l.java:213)
        at
com.google.inject.internal.InjectorImpl.getProviderOrThrow(InjectorIm
pl.java:998)
        at
com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java
:1031)
        at
com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java
:994)
        at
com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java
:1044)
        at
org.eclipse.sisu.space.AbstractDeferredClass.get(AbstractDeferredClas
s.java:48)
        at
com.google.inject.internal.ProviderInternalFactory.provision(Provider
InternalFactory.java:86)
        at
com.google.inject.internal.InternalFactoryToInitializableAdapter.prov
ision(InternalFactoryToInitializableAdapter.java:54)
        at
com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInt
ernalFactory.java:70)
        at
com.google.inject.internal.ProvisionListenerStackCallback$Provision.p
rovision(ProvisionListenerStackCallback.java:115)
        at
org.eclipse.sisu.bean.BeanScheduler$Activator.onProvision(BeanSchedul
er.java:176)
        at
com.google.inject.internal.ProvisionListenerStackCallback$Provision.p
rovision(ProvisionListenerStackCallback.java:126)
        at
com.google.inject.internal.ProvisionListenerStackCallback.provision(P
rovisionListenerStackCallback.java:68)
        at
com.google.inject.internal.ProviderInternalFactory.circularGet(Provid
erInternalFactory.java:68)
        at
com.google.inject.internal.InternalFactoryToInitializableAdapter.get(
InternalFactoryToInitializableAdapter.java:46)
        at
com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:10
09)
        at
com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.ja
va:1059)
        at
com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1005)

        at
com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:3
6)
        at
org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:81)

        at
org.eclipse.sisu.plexus.LazyPlexusBean.getValue(LazyPlexusBean.java:5
1)
        at
org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContai
ner.java:263)
        at
org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContai
ner.java:255)
        at
org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfigu
redMojo(DefaultMavenPluginManager.java:546)
        at
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
BuildPluginManager.java:121)
        at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:208)
        at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:153)
        at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:145)
        at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:116)
        at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:80)
        at
org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThre
adedBuilder.build(SingleThreadedBuilder.java:51)
        at
org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at
org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:289)
        at
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:229)
        at
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:415)
        at
org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
356)
Caused by: java.lang.ClassNotFoundException:
org.apache.tools.ant.BuildException

        at
org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(
SelfFirstStrategy.java:50)
        at
org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadCl
ass(ClassRealm.java:271)
        at
org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm
.java:247)
        at
org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm
.java:239)
        ... 55 more
[INFO]
------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 1.079 s
[INFO] Finished at: 2015-10-12T17:57:40+02:00
[INFO] Final Memory: 8M/115M
[INFO]
------------------------------------------------------------------------
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-antrun-plugin:1.7:
run (compile) on project apache-log4cxx: Execution compile of goal
org.apache.ma
ven.plugins:maven-antrun-plugin:1.7:run failed: A required class was
missing whi
le executing org.apache.maven.plugins:maven-antrun-plugin:1.7:run:
org/apache/to
ols/ant/BuildException
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.apache.maven.plugins:maven-antrun-plugin:1.7
[ERROR] strategy =
org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] =
file:/C:/Users/ypx7647/.m2/repository/org/apache/maven/plugins
/maven-antrun-plugin/1.7/maven-antrun-plugin-1.7.jar
[ERROR] urls[1] =
file:/C:/Users/ypx7647/.m2/repository/org/apache/ant/ant/1.9.3
/ant-1.9.3.jar
[ERROR] urls[2] =
file:/C:/Users/ypx7647/.m2/repository/org/apache/ant/ant-launc
her/1.9.3/ant-launcher-1.9.3.jar
[ERROR] urls[3] =
file:/C:/Users/ypx7647/.m2/repository/ant-contrib/ant-contrib/
1.0b2/ant-contrib-1.0b2.jar
[ERROR] urls[4] =
file:/C:/Users/ypx7647/.m2/repository/ant/ant/1.5/ant-1.5.jar
[ERROR] urls[5] =
file:/C:/Users/ypx7647/.m2/repository/ant-contrib/cpptasks/1.0
b5/cpptasks-1.0b5.jar
[ERROR] urls[6] =
file:/C:/Users/ypx7647/.m2/repository/xerces/xercesImpl/2.8.1/
xercesImpl-2.8.1.jar
[ERROR] urls[7] =
file:/C:/Users/ypx7647/.m2/repository/xml-apis/xml-apis/1.3.03
/xml-apis-1.3.03.jar
[ERROR] urls[8] =
file:/C:/Users/ypx7647/.m2/repository/org/codehaus/plexus/plex
us-interpolation/1.1/plexus-interpolation-1.1.jar
[ERROR] urls[9] =
file:/C:/Users/ypx7647/.m2/repository/junit/junit/3.8.1/junit-
3.8.1.jar
[ERROR] urls[10] =
file:/C:/Users/ypx7647/.m2/repository/org/codehaus/plexus/ple
xus-utils/2.0.5/plexus-utils-2.0.5.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent:
null]]
[ERROR]
[ERROR] -----------------------------------------------------:
org.apache.tools.
ant.BuildException
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e
swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions,
please rea
d the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/PluginContaine
rException

And Ant fails with these errors:

C:\Users\ypx7647\Downloads\apache-log4cxx>ant -Dfind=false
Buildfile: C:\Users\ypx7647\Downloads\apache-log4cxx\build.xml
  [taskdef] Could not load definitions from resource
net/sf/antcontrib/antcontri
b.properties. It could not be found.

BUILD FAILED
C:\Users\ypx7647\Downloads\apache-log4cxx\build.xml:184: Problem: failed to
crea
te task or type propertyregex
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.


Total time: 0 seconds

And the projects directory doesn't exist in the SVN checkout!

I'm completely stuck.

Could someone help out please?

Thanks,
Andrew

-------
Internet communications are not secure and therefore Andrew Leach does not
accept legal responsibility for the contents of this message.  The
information contained in this email is private, personal and confidential
and may be legally privileged.  It is intended solely for the addressee.
If you are not the intended recipient, any disclosure, copying,
distribution or any action taken or omitted to be taken in reliance on it,
is prohibited and may be unlawful. This email and any attachments have been
automatically scanned for viruses prior to dispatch, but we make no
warranty that they are free from computer viruses.  You are advised to
check all emails and attachments using your own anti virus software before
opening or executing them.

On 12 October 2015 at 15:35, Thorsten Schöning <ts...@am-soft.de>
wrote:

> Guten Tag Andrew Leach,
> am Montag, 12. Oktober 2015 um 15:05 schrieben Sie:
>
> > I believe I've correctly configured the include directory for
> > log4cxx into VS2013 as the include's aren't showing up any errors.
>
> You need to setup log4cxx properly as well.
>
> > c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\[...]
>
> You shouldn't start with log4cxx 0.10.0 anymore, checkout a current
> trunk using SVN or download it using your browser. While not
> officially released yet, the current trunk contains a lot of bug
> fixes.
>
> https://logging.apache.org/log4cxx/source-repository.html
>
> > Error   1       error C1083: Cannot open include file:
> > 'log4cxx/log4cxx.h': No such file or directory
>
> This is most likely the root cause, log4cxx can't work properly
> without that header. You haven't setup your building environment for
> log4cxx properly and should first read the docs on how to build the
> lib. If your already done so, you either made something wrong or the
> instructions are not clear enough or whatever, so feel free to tell us
> and we might fix things.
>
> https://logging.apache.org/log4cxx/building/index.html
> https://logging.apache.org/log4cxx/usage.html
>
> Mit freundlichen Grüßen,
>
> Thorsten Schöning
>
> --
> Thorsten Schöning       E-Mail: Thorsten.Schoening@AM-SoFT.de
> AM-SoFT IT-Systeme      http://www.AM-SoFT.de/
>
> Telefon...........05151-  9468- 55
> Fax...............05151-  9468- 88
> Mobil..............0178-8 9468- 04
>
> AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
> AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow
>
>

Re: Help with first C++ program to do logging

Posted by Thorsten Schöning <ts...@am-soft.de>.
Guten Tag Andrew Leach,
am Montag, 12. Oktober 2015 um 15:05 schrieben Sie:

> I believe I've correctly configured the include directory for
> log4cxx into VS2013 as the include's aren't showing up any errors.

You need to setup log4cxx properly as well.

> c:\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0\[...]

You shouldn't start with log4cxx 0.10.0 anymore, checkout a current
trunk using SVN or download it using your browser. While not
officially released yet, the current trunk contains a lot of bug
fixes.

https://logging.apache.org/log4cxx/source-repository.html

> Error   1       error C1083: Cannot open include file:
> 'log4cxx/log4cxx.h': No such file or directory

This is most likely the root cause, log4cxx can't work properly
without that header. You haven't setup your building environment for
log4cxx properly and should first read the docs on how to build the
lib. If your already done so, you either made something wrong or the
instructions are not clear enough or whatever, so feel free to tell us
and we might fix things.

https://logging.apache.org/log4cxx/building/index.html
https://logging.apache.org/log4cxx/usage.html

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning       E-Mail: Thorsten.Schoening@AM-SoFT.de
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/

Telefon...........05151-  9468- 55
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow