Compile log4cxx-0.10.0 detailed methods in vs2010 (from download, compilation, solution error details) (reproduced)

Source: Internet
Author: User

This article contains a total of 17 steps. follow the steps below to compile log4cxx in vs2010.

1.DownloadLog4cxx and source code of APR and APR-util:

A) http://www.apache.org/dyn/closer.cgi/logging/log4cxx/0.10.0/apache-log4cxx-0.10.0.zip

B) http://archive.apache.org/dist/apr/apr-1.2.11-win32-src.zip

C) http://archive.apache.org/dist/apr/apr-util-1.2.10-win32-src.zip


2. Compress three packagesExtractTo the same directory. For example:

 


3. Change the apr-1.2.11RenameFor Apr, rename the apr-util-1.2.10 to Apr-util. For example:


4. Open the CMD window, as shown in:


5. Enter: cd d: \ log4cxx_compile \ apache-log4cxx-0.10.0 in 4 and press Enter.

Enter: D: Press enter and switch to the apache-log4cxx-0.10.0 directory


6. Input in 5:Configure. Bat press ENTER


7. Under the 6 base DOS window to continue entering: configure-aprutil.bat press ENTER


8. Enter D: \ log4cxx_compile \ Apr-util \ include and find the APU. HW file, for example:
9. use Notepad ++ to open the APU. HW file (or notepad)

Manually modify content in Apr-util \ include \ Apu. HW

# Define apu_have_apr_iconv 1

Change

# Define apu_have_apr_iconv 0
 

10. Use vs2010 to open log4cxx. DSW under apache-log4cxx-0.10.0 \ Projects


 

A Conversion prompt is displayed when you open the project:


 

11. After the conversion, the project is shown as follows:


 

12. Set log4cxx as the startup Item.

Before setting:


 

After setting:


13. start compiling. log4cxx

 

 

 

 

Appears

 

4> D: \ log4cxx_compile \ apache-log4cxx-0.10.0 \ SRC \ main \ include \ log4cxx/SPI/loggingevent. H (155): Error c2252: templates can only be explicitly instantiated within the namespace range
A) double-click the error line in the "output" window and an error will appear in the "code window". For example:
B) Select log4cxx_list_def and press F12 on the keyboard. The macro definition is displayed, for example:

C) Set

# Define log4cxx_list_def (n, T) \ template class log4cxx_export STD: Allocator <t>; \ template class log4cxx_export STD: vector <t>; \ typedef STD :: vector <t> N

Replace with: # define log4cxx_list_def (n, T) \ typedef STD: vector <t> N


14. recompile after modifying according to 13

Appears

2> network_io \ UNIX \ multicast. C (137): Error c2079: "MIP" Error Using undefined struct "group_source_req"

 

Double-click the output of the first line and comment the # If mcast_join_source_group comment of rows 136 and 148 with # If defined (group_source_req)


 

15. After modification according to 14, recompile

 

Appears

'4> .. \ SRC \ main \ CPP \ stringhelper. cpp (64): Error c2039: "insert_iterator": Not a member of "STD.


 

Add the header file # include <iterator> to the. cpp file (stringhelper. cpp ).


 

16. After modification according to 15, recompile

An error occurs, such as 'unresolved external symbol XXX.


 

Add Apr, aprutil, and XML to the reference of log4cxx. (perform operations in the order of the following four graphs)



 



 

17. Select to regenerate the solution.



 

After compilation:

 

By now, log4cxx compilation is complete.

Compile log4cxx-0.10.0 detailed methods in vs2010 (from download, compilation, solution error details) (reproduced)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.