Compile ACE with cygwin and report Error 2

Source: Internet
Author: User

Recently, I want to develop a server project and want to learn about ACE, so I will play ACE with Cygwin,

After downloading the ACE5.5 source code package, compile it immediately:

First, refer to ace-install.htm. The ACE Compilation Method in Cygwin is described as follows:

  1. Open a Cygwin shell. Set yourPATHEnvironment variable so your CygwinBinDirectory is first:

           % export PATH=//c/cygwin/bin:$PATH       

    Note Cygwin uses''/''As directory separator, and''// X''As a notation for Win32 driveX. Note also that youCan'tUse''C:/cygwin/bin''Because, for Cygwin ,'':''Is path separator character, as in UNIX.

  2. AddACE_ROOTEnvironment variable pointing to the root of your ACE wrappers source tree:
           % export ACE_ROOT=c:/work/cygwin/ACE_wrappers       

    Note here youCan'tUse''// X''Cygwin notation as this is seen by Cygwin's compiler and it doesn' t support that (itDoesSupport''/''As directory separator however ).

    From now on, we will refer to the root directory of the ACE source tree$ ACE_ROOT.

  3. Create a file calledConfig. hIn$ ACE_ROOT/aceDirectory that contains:
           #include "ace/config-cygwin32.h"       
  4. Create a file calledPlatform_macros.GNUIn$ ACE_ROOT/include/makeincludeDirectory containing:
           include $(ACE_ROOT)/include/makeinclude/platform_cygwin32.GNU       

    In the above text, don't replace$ (ACE_ROOT)With the actual directory, GNU make will take the value from the environment variable you defined previusly.

  5. On the Cygwin shell, change to the $ ACE_ROOT/ace directory and run make:
           % cd $ACE_ROOT/ace       % make       

    This shoshould createLibACE. dll(The Win32 shared library) andLibACE. dll.(The Win32 import library for the DLL). Note the name for the ace dll on Cygwin follows the UNIX convention.

    If you want static libs also, you may run:

           % make static_libs=1
But the final compilation fails. make returns Error2, Which is annoying.
Google, most people have compiled it like this, but this machine cannot survive,
Later, I finally found an article about a compilation method different from the official documentation:
First, set the ACE_ROOT environment and run the command "vi/etc/profile" to add four lines to it.
ACE_ROOT = ~ /ACE_wrappers export ACE_ROOTLD_LIBRARY_PATH = $ ACE_ROOT/ace: $ LD_LIBRARY_PATH export LD_LIBRARY_PATH I added to "export PATH USER ...." . Run/etc/profile once,
Command: "chmod 555/etc/profile" "/etc/profile" so that our ACE_ROOT is set,
Run the following command to check whether ACE_ROOT is set: "echo $ ACE_ROOT ",
Then perform step 3 and 4 of the official document,
Finally:
       % cd $ACE_ROOT/ace       %  make static_libs=1
After a long wait, we finally got it done! Record the document.
 
1. Define ACE_ROOT
export ACE_ROOT=/datas/ACE_wrappers;
2. Define the configuration file $ ACE_ROOT/ace/config. h, which contains the platform-related configuration files:
For example, in linux, the content is
  
  
#include "ace/config-linux.h"
3、Create a build configuration file, $ACE_ROOT/include/makeinclude/platform_macros.GNU, that contains the appropriate platform/compiler-specific Makefile configurations, e.g.,
   include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU
4、Note that because ACE builds shared libraries, you'll need to set LD_LIBRARY_PATH (or equivalent for your platform) to the directory where binary version of the ACE library is built into. For example, you probably want to do something like the following:
   % setenv LD_LIBRARY_PATH $ACE_ROOT/lib:$LD_LIBRARY_PATH
5、
When all this is done, hopefully all you'll need to do is type:
% Make
6. Add the following statement to the first line of config. h on fedora6:
# Define ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS 1

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.