You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by venkatlakshmi <ve...@yahoo.co.in> on 2006/06/26 19:58:01 UTC

Compiling NTEventlog.cpp

I tried compiling the NTEventLog.cpp to retrieve the
NTEventLog.dll. When I compiled the NTEventlog.cpp
from the respective path, it shows the following
error.

C:\VLakshmi\JCI\EQUIPM~1\LOGGIN~1.13\src\java\org\apache\log4j\nt>bcc32
nteventl
og.cpp
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000
Borland
nteventlog.cpp:
Error E2209 nteventlog.cpp 19: Unable to open include
file 'org_apache_log4j_Pri
ority.h'
Error E2209 nteventlog.cpp 20: Unable to open include
file 'org_apache_log4j_nt_
NTEventLogAppender.h'
Error E2147 nteventlog.cpp 24: 'JNIEnv' cannot start a
parameter declaration
Error E2451 nteventlog.cpp 26: Undefined symbol
'jclass' in function JNU_ThrowBy
Name(int *,const char *,const char *)
Error E2379 nteventlog.cpp 26: Statement missing ; in
function JNU_ThrowByName(i
nt *,const char *,const char *)
Error E2451 nteventlog.cpp 28: Undefined symbol
'classForName' in function JNU_T
hrowByName(int *,const char *,const char *)
Error E2377 nteventlog.cpp 28: If statement missing )
in function JNU_ThrowByNam
e(int *,const char *,const char *)
Warning W8057 nteventlog.cpp 34: Parameter 'env' is
never used in function JNU_T
hrowByName(int *,const char *,const char *)
Warning W8057 nteventlog.cpp 34: Parameter 'name' is
never used in function JNU_
ThrowByName(int *,const char *,const char *)
Warning W8057 nteventlog.cpp 34: Parameter 'msg' is
never used in function JNU_T
hrowByName(int *,const char *,const char *)
Error E2147 nteventlog.cpp 37: 'JNIEnv' cannot start a
parameter declaration
Error E2303 nteventlog.cpp 37: Type name expected
*** 9 errors in Compile ***

Kindly let me know as to how I am supposed to proceed
with.




With regards,

Venkatlakshmi



		
__________________________________________________________
Yahoo! India Answers: Share what you know. Learn something new
http://in.answers.yahoo.com/

Re: Compiling NTEventlog.cpp

Posted by venkatlakshmi <ve...@yahoo.co.in>.
Dear Curt,

I used the 1.2.8 version of log4j and retrieved the
NTEventLogAppender.dll. This has solved the problem.

Thanks a lot for your suggestion.



--- Curt Arnold <ca...@apache.org> wrote:

> 
> On Jun 26, 2006, at 12:58 PM, venkatlakshmi wrote:
> 
> > I tried compiling the NTEventLog.cpp to retrieve
> the
> > NTEventLog.dll. When I compiled the NTEventlog.cpp
> > from the respective path, it shows the following
> > error.
> >
> >
> 
> ..
> 
> > Kindly let me know as to how I am supposed to
> proceed
> > with.
> >
> >
> > With regards,
> >
> > Venkatlakshmi
> >
> 
> The build.xml in the SVN for both the log4j 1.2 and
> 1.3 branches will  
> build NTEventLogAppender.dll using MinGW's gcc (see
> bug 37866, http:// 
> issues.apache.org/bugzilla/show_bug.cgi?id=37866). 
> Unless you have a  
> specific need to use Borland C++, I would recommend
> using the Ant  
> build.  The specific cause of your compilation
> issues is that the  
> code requires header files generated by javah to be
> on the include path.
> 
> To build NTEventLogAppender.dll:
> 
> 1. Download MinGW-3.1.0-1.exe from
> http://mingw.sourceforge.net/ 
> download.shtml
> 
> 2. Run downloaded file to install MinGW
> 
> 3. Check out log4j source from Subversion
> 
> svn co
>
http:://svn.apache.org/repos/asf/logging/trunk/log4j/trunk
> log4j
> 
> or
> 
> svn co
>
http:://svn.apache.org/repos/asf/logging/log4j/branches/v1_2-
> 
> branch log4j
> 
> 4. Copy build.properties.sample to build.properties
> 
> cd log4j
> copy build.properties.sample build.properties
> 
> 5. Place MinGW on the path
> 
> path c:\mingw\bin;%PATH%
> 
> 6. Build NTEventLogAppender
> 
> ant build.nt
> 
> This step will require that you build log4j.jar
> first which may  
> require downloading some supporting jars and
> modifying  
> build.properties.  However, if you are already set
> up to build log4j,  
> then you should know your way around these issues.
> 
> If you really want to use Borland C++, then you can
> look at the  
> build.nt target in build.xml for the step by step. 
> You'd want to use  
> the Borland Resource Compiler (brc or brc32 if I
> remember correctly)  
> or Microsoft Resource Compiler (rc) instead of
> windres to compile  
> EventLogCategories.rc and NTEventLogAppender.rc and 
> Borland C++  
> (bcc32) instead of gcc to compile nteventlog.cpp.
> 
> If you don't care about building the DLL, you can
> extract it from any  
> older log4j (say 1.2.8) from
> http://archive.apache.org/dist.
> 
> 
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail:
> log4j-user-help@logging.apache.org
> 
> 




With regards,

Venkatlakshmi



		
__________________________________________________________
Yahoo! India Answers: Share what you know. Learn something new
http://in.answers.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Compiling NTEventlog.cpp

Posted by Curt Arnold <ca...@apache.org>.
On Jun 26, 2006, at 12:58 PM, venkatlakshmi wrote:

> I tried compiling the NTEventLog.cpp to retrieve the
> NTEventLog.dll. When I compiled the NTEventlog.cpp
> from the respective path, it shows the following
> error.
>
>

..

> Kindly let me know as to how I am supposed to proceed
> with.
>
>
> With regards,
>
> Venkatlakshmi
>

The build.xml in the SVN for both the log4j 1.2 and 1.3 branches will  
build NTEventLogAppender.dll using MinGW's gcc (see bug 37866, http:// 
issues.apache.org/bugzilla/show_bug.cgi?id=37866).  Unless you have a  
specific need to use Borland C++, I would recommend using the Ant  
build.  The specific cause of your compilation issues is that the  
code requires header files generated by javah to be on the include path.

To build NTEventLogAppender.dll:

1. Download MinGW-3.1.0-1.exe from http://mingw.sourceforge.net/ 
download.shtml

2. Run downloaded file to install MinGW

3. Check out log4j source from Subversion

svn co http:://svn.apache.org/repos/asf/logging/trunk/log4j/trunk log4j

or

svn co http:://svn.apache.org/repos/asf/logging/log4j/branches/v1_2- 
branch log4j

4. Copy build.properties.sample to build.properties

cd log4j
copy build.properties.sample build.properties

5. Place MinGW on the path

path c:\mingw\bin;%PATH%

6. Build NTEventLogAppender

ant build.nt

This step will require that you build log4j.jar first which may  
require downloading some supporting jars and modifying  
build.properties.  However, if you are already set up to build log4j,  
then you should know your way around these issues.

If you really want to use Borland C++, then you can look at the  
build.nt target in build.xml for the step by step.  You'd want to use  
the Borland Resource Compiler (brc or brc32 if I remember correctly)  
or Microsoft Resource Compiler (rc) instead of windres to compile  
EventLogCategories.rc and NTEventLogAppender.rc and  Borland C++  
(bcc32) instead of gcc to compile nteventlog.cpp.

If you don't care about building the DLL, you can extract it from any  
older log4j (say 1.2.8) from http://archive.apache.org/dist.





---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org