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 Zettai Muri <ze...@gmail.com> on 2011/09/10 15:49:58 UTC

Attempting to compile example program

Hi All,

I am using the following environment in an attempt to compile a
logging app to get started using log4cxx:

Dev-C++ 4.9.9.2
WinXP
apache-log4cxx-0.10.0
apr-1.2.11-win32-src.zip
apr-util-1.2.10-win32-src.zip

I followed the instructions on:
http://logging.apache.org/log4cxx/building/vstudio.html and built a
log4cxx.dll file using Visual Studio 6.  It created the dll but with
over 100 warnings.

I am now trying to create a simple example program to confirm it works
and found one at: http://www.yolinux.com/TUTORIALS/Log4cxx.html

I have copied the source from here and created the file
'Log4cxxConfig.xml' using the information from the above website.

Under parameters in project options in Dev-C++ the C++ Compiler has:
-I"C:\Documents and Settings\Me\My
Documents\Programming\C++\Libs\apache-log4cxx-0.10.0\src\main\include"

Under parameters in project options in Dev-C++ the Linker has:
-lapr-1 -laprutil-1

I have put the log4cxx.dll file in the project directory, however when
I attempt to compile the program I get in the Dev-C++ Compile Log:
Compiler: Default compiler
Building Makefile: "C:\Documents and Settings\Me\My
Documents\Programming\C++\Code\Log4cxx01\Makefile.win"
Executing  make...
make.exe -f "C:\Documents and Settings\Me\My
Documents\Programming\C++\Code\Log4cxx01\Makefile.win" all
g++.exe -c main.cpp -o main.o
-I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include"
-I"C:/Dev-Cpp/include/c++/3.4.2/backward"
-I"C:/Dev-Cpp/include/c++/3.4.2/mingw32"
-I"C:/Dev-Cpp/include/c++/3.4.2"  -I"C:/Dev-Cpp/include"
-I"C:\Documents and Settings\Me\My
Documents\Programming\C++\Libs\apache-log4cxx-0.10.0\src\main\include"

C:/Dev-Cpp/include/c++/3.4.2/bits/basic_ios.h: In instantiation of
`std::basic_ios<wchar_t, std::char_traits<wchar_t> >':
C:/Dev-Cpp/include/c++/3.4.2/ostream:59:   instantiated from
`std::basic_ostream<wchar_t, std::char_traits<wchar_t> >'
main.cpp:14:   instantiated from here
C:/Dev-Cpp/include/c++/3.4.2/bits/basic_ios.h:67: error: no type named
`pos_type' in `struct std::char_traits<wchar_t>'
C:/Dev-Cpp/include/c++/3.4.2/ostream: In instantiation of
`std::basic_ostream<wchar_t, std::char_traits<wchar_t> >':
main.cpp:14:   instantiated from here

C:/Dev-Cpp/include/c++/3.4.2/ostream:64: error: no type named
`pos_type' in `struct std::char_traits<wchar_t>'

C:/Dev-Cpp/include/c++/3.4.2/bits/ostream.tcc:404: error: no type
named `pos_type' in `class std::basic_ostream<wchar_t,
std::char_traits<wchar_t> >'
C:/Dev-Cpp/include/c++/3.4.2/bits/ostream.tcc:420: error: no type
named `pos_type' in `struct std::char_traits<wchar_t>'

make.exe: *** [main.o] Error 1

Execution terminated

Line 14 of main.cpp is:

12 void functionA()
13 {
14     LOG4CXX_INFO(loggerFunctionA, "Executing functionA.");
15 }

Is anyone able to point me towards a way I can verify the dll is
working and creating a simple logging app to get started using this?

Many thanks,

ZM.

Re: AW: [bulk]: Re: Attempting to compile example program

Posted by Thorsten Schöning <ts...@am-soft.de>.
Guten Tag Zerbst, Carsten,
am Dienstag, 13. September 2011 um 08:40 schrieben Sie:

> There was an issue with macros not supported by VC, has someone
> patched the code in the meantime ?

Depends on the errors you got, I had to make log4cxx usable with
Borland Builder 5 and 6, which are pretty old, had unsupported macros,
too, but got it finally working.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning
AM-SoFT IT-Systeme - Hameln | Potsdam | Leipzig
 
Telefon: Potsdam: 0331-743881-0
E-Mail:  tschoening@am-soft.de
Web:     http://www.am-soft.de

AM-SoFT GmbH IT-Systeme, Konsumhof 1-5, 14482 Potsdam
Amtsgericht Potsdam HRB 21278 P, Geschäftsführer: Andreas Muchow


AW: [bulk]: Re: Attempting to compile example program

Posted by "Zerbst, Carsten" <Ca...@PROSTEP.com>.
Hello All, 
 
I terribly failed in the beginning of this year to compile log4cxx
with the current Visual Studio Express. 
 
There was an issue with macros not supported by VC, has someone 
patched the code in the meantime ?
 
Bye, Carsten 
 

________________________________

Von: Thorsten Schöning [mailto:tschoening@am-soft.de]
Gesendet: Di 13.09.2011 08:37
An: log4cxx-user@logging.apache.org
Betreff: [bulk]: Re: Attempting to compile example program



Guten Tag Zettai Muri,
am Dienstag, 13. September 2011 um 00:08 schrieben Sie:

> Anyone have any ideas at all?

My only idea would be to not use Visual Studio 6, but a more recent
Version of Visual Studio Express. Then you shouldn't need Dev-C++
either.

Mit freundlichen Grüßen,

Thorsten Schöning

--
Thorsten Schöning
AM-SoFT IT-Systeme - Hameln | Potsdam | Leipzig

Telefon: Potsdam: 0331-743881-0
E-Mail:  tschoening@am-soft.de
Web:     http://www.am-soft.de <http://www.am-soft.de/> 

AM-SoFT GmbH IT-Systeme, Konsumhof 1-5, 14482 Potsdam
Amtsgericht Potsdam HRB 21278 P, Geschäftsführer: Andreas Muchow



________________________________________________
PROSTEP ITS GmbH, Dolivostr.11, D-64293 Darmstadt
HR: Amtsgericht Darmstadt, HRB 8805
Geschäftsführung: Dr. Markus Sachers, Reinhard Betz 
________________________________________________


Re: Attempting to compile example program

Posted by Thorsten Schöning <ts...@am-soft.de>.
Guten Tag Zettai Muri,
am Dienstag, 13. September 2011 um 00:08 schrieben Sie:

> Anyone have any ideas at all?

My only idea would be to not use Visual Studio 6, but a more recent
Version of Visual Studio Express. Then you shouldn't need Dev-C++
either.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning
AM-SoFT IT-Systeme - Hameln | Potsdam | Leipzig
 
Telefon: Potsdam: 0331-743881-0
E-Mail:  tschoening@am-soft.de
Web:     http://www.am-soft.de

AM-SoFT GmbH IT-Systeme, Konsumhof 1-5, 14482 Potsdam
Amtsgericht Potsdam HRB 21278 P, Geschäftsführer: Andreas Muchow


Re: Attempting to compile example program

Posted by Zettai Muri <ze...@gmail.com>.
>
> Is anyone able to point me towards a way I can verify the dll is
> working and creating a simple logging app to get started using this?
>
> Many thanks,
>
> ZM.
>

Anyone have any ideas at all? If I'm sending this to the wrong mailing
list please let me know.