64-bit centos 6.5 compiling and configuring ace 6.1.0 (6.2.0)

Source: Internet
Author: User

System: centos 6.5 64-bit

Ace version: 6.1.0

Assume that the directory of the compressed file is/usr/local/

Step 1:

Decompress the loaded ace-6.1.0.tar.gz

# Tar zxvf ACE-6.1.0.tar.gz

A folder named ace_wrappers appears.

Step 2: Define the environment variables:

Modify/etc/profile or/etc/bashrc

# Vi/etc/profile

Add the following two lines:

Ace_root =/usr/local/ace_wrappers; export ace_root

LD_LIBRARY_PATH = $ ace_root/ace; export LD_LIBRARY_PATH

# This path is the path of the final link. If the compilation output does not modify the path, it is the above path. If the custom path is used, it must be changed to the custom path.

Step 3: Modify platform_linux.gnu,

VI platform_linux.gnu

Find

Ifeq ($ (buildbits), 32)
Flags_c_cc + =-M32
Ldflags + =-M32
Endif
Ifeq ($ (buildbits), 64)
Flags_c_cc + =-M64
Ldflags + =-M64
Endif
To:

Ifeq ($ (buildbits), 32)
Flags_c_cc + =-M32
Ldflags + =-M32
Endif
Ifeq ($ (buildbits), 64)
Flags_c_cc + =-M64
Flags_c_cc + =-FPIC
Ldflags + =-M64
Endif

The modification here is to solve the problem of 64-bit system compilation. if the system is 32-bit, it should be fine if it is not modified.

Step 4: goUnder ace_wrappers/include/makeincludeCreate the platform_macros.gnu file,

VI platform_macros.gnu

Add the following code:

Include $ (ace_root)/include/makeinclude/platform_linux.gnu // No # include

The following two items are optional:
1. install_prefix =/usr/local/ace_install

This item is output from the compilation file. If you want to add this item, you need to modify the preceding environment variable: LD_LIBRARY_PATH = $ ace_root/ace; export LD_LIBRARY_PATH. If you add this item, change it

LD_LIBRARY_PATH =/usr/local/ace_install/ace; export LD_LIBRARY_PATH

2. static_libs = 1

This defines that a static library is generated when a compilation file is generated. If no static library is added, no static library is generated.

Step 5: test example

# Include "ACE/log_msg.h"
# Include "ACE/OS _main.h"
Using namespace STD;
Int ace_tmain (INT Arg, ace_tchar * argv [])
{
Ace_debug (lm_debug, ace_text ("Hello Ace ")));
Return 0;
}

Compile and connect:

Gcc-O hello. cpp-I/usr/local/ace_wrappers/-L/usr/local/ace_wrappers/ACE/-encode-LRT-lpthread

You can read books and learn ace if there is no problem ............





Related Article

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.