Configuration and debugging of the C ++ Network Development Kit ace Environment

Source: Internet
Author: User

 

Ace is a very useful open-source C ++ Network Programming Development Kit. Using It is more conducive to code robustness, portability, and simplicity than using APIs directly.
It is estimated that it is difficult for everyone to get started with Ace. Maybe they will give up halfway. This is a summary of the two days of learning ace, which is basically unwritten, however, if you want to learn about ace, you will surely understand the meaning below.

My system environment is: Win2k Pro (SP4), vc6.0 (SP5)

After a while, I want to open a forum on my homepage and set up a VC area. You are welcome to join us.
Http://www.liufei.com

1. Ace official homepage:Http://www.cs.wustl.edu /~ Schmidt/ace.html
:Http://deuce.doc.wustl.edu/Download.html

I downloaded ace.zip from latest beta kit (the compressed package in latest release seems to be faulty. I have an error in winrar3.30 decompression)

2. decompress the package and place it on disk D.
D:/ace_wrappers

3. Add a new file config. H to the Directory D:/ace_wrappers/ace.
# Include "ACE/config-win32.h"

4. Compile: Use vc6.0 to open D:/ace_wrappers/ACE/ace. DSW
Ace DLL classes on the left
Ace lib classes
Or 1. Select "compile" from the menu, "place remote configuration", and select the project configuration you need.
"Compile" and "recreate all" (or any, such as Ace DLL-Win32 MFC Debug)
This process may last for half an hour to an hour.
Or 2. Select "compile" and "batch build" from the menu and select the project configuration you need.
This process may last two to four hours.

The generated. Lib file is located under D:/ace_wrappers/ACE,
The generated. dll file is located under D:/ace_wrappers/bin /.


Enable ace_static.dsw
Compile
Aces. Lib
Acesd. Lib
Ace_rmcasts.lib
Ace_rmcastsd.lib
Tmcasts. Lib
Tmcastsd. Lib

Naming rules for DLL and Lib files generated by ACE: (D = debug, S = static)

Debug-Aced. Lib, debug + static-acesd. Lib, release-Ace. Lib, release + static-Aces. Lib

V. Compile the sample program
Use VC to open D:/ace_wrappers/tests. DSW
"Compile" and "batch build"

6. Engineering configuration of Self-writing programs

Article 2: Example program in ACE programmer's Tutorial:
URL:
Http://www.cs.wustl.edu /~ Schmidt/ace_wrappers/docs/tutorials/guide-tutorials.html

Copy the original code on the webpage to a new file and name it server. cpp.
Open, compile, and recreate all with VC. In the pop-up dialog box, "This build command require...", Point "is"

The following error occurs:

If "cannot open include file: 'ace/sock_acceptor.h ': no such file or directory"
Project-set-C/C ++: Preprocessor and add the path D:/ace_wrappers.

If "you must link against multi-threaded libraries when using ACE (check your project settings )"
Project-set-C/C ++: code generation-use run-time Library: Debug multithreaded DLL

If "error c2065: 'ace _ error': Undeclared identifier" exists"
Error c2065: 'ace _ debug': Undeclared identifier
# Include "ACE/log_msg.h"

Error c4716: 'ace _ main_ I ': must return a value
Add in main
Return 0;

"Error lnk2001: unresolved external symbol" _ declspec (dllimport) int _ cdecl"
Project-settings-link-input: Object/Library module: Add aced. Lib additional library path: D:/ace_wrappers/ace



Problems encountered during client Compilation
1. Error c2039: 'sprintf': is not a member of 'ace _ OS'

# Include "ACE/OS _ns_stdio.h"

2. Error c2039: 'strlen': is not a member of 'ace _ OS'

# Include "ACE/OS _ns_string.h"
3. Error c2059: syntax error :'? '
Error in this sentence: ace_debug (lm_debug ,? Usage egx Yes? Change"

4. The specified path of the dynamic link library aced. dll cannot be found.
Add D:/ace_wrappers/bin to the system variable path.



Static include:
Project-set-C/C ++-add to the pre-processing program definition, ace_as_static_libs


Example 1 server is generated after compilation
Server.exe 16 K serverd.exe 97 K servers.exe 124 K serversd.exe 669 K
(Servers.exe is suitable for publishing)

Example 2 generated after the client is compiled
Client.exe 16 K clientd.exe 97 K clients.exe 124 K clientsd.exe 669 K
(Clients.exe is suitable for publishing)

Test clients 127.0.0.1 1919
Server 1919

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.