Ace learning journey-study Note 1

Source: Internet
Author: User

Because vs 2003 (vc7.1.3091) of M $ is installed, I can see that the online documents and Standard C ++ meet 98%. Because I am learning C ++ and want to learn ace,
Therefore, we are ready to re-compile the ace compiled in vc6 with vc7 for future study.

Install ace in Windows is very simple, follow the instructions in the ACE-INSTALL.html to do everything OK, first create
Config. h file, and then add a line in it # include "ACE/config-win32.h", also because I am learning C ++, of course, want to make ace use
The standard C ++ library, then you need to add a macro definition in the first line () of config. h: # define ace_has_standard_cpp_library 1 indicates that we want to ace
The standard C ++ header file is used, and the configuration is whether to use MFC. Of course, I am not using it. What cross-platform platforms do I expect when I use it ...:)
As per my needs, there are only the following two lines in the config. h file:
# Define ace_has_standard_cpp_library 1
# Include "ACE/config-win32.h"
Then you can open Ace. DSW in the ace_root/ace directory to compile the SDK.

Oh, forget to say: ace_root.pdf the directory where you install ace. for example, if I decompress ace-5.4.zip TO THE D:/ace directory, it is included in ace-5.4.zip.
Path ace_wrappers, so the final ace_root is equal to D:/ACE/ace_wrappers. If you decompress it to the root directory of D: disk
Ace_root is equal to D:/ace_wrappers, and so on...

Another point you should pay attention to when performing Ace. DSW, because. DSW is a vc6 project file, opening in vc7.1 will prompt you whether to convert to the vc7.1 project file, select
"All is", and you need to note the following before compiling:
By default, all of the ACE projects use the DLL versions of the msvc run-time libraries. You can still choose
Use the static (LIB) versions of ACE libraries regardless of Run-Time libraries. The reason we chose to link
Only the dynamic run-time library is that almost every nt box has these library installed and to save disk space.
If you prefer to link MFC as a static library into ace, you can do this by defining ace_uses_static_mfc
In your Config. h file. However, if you wocould like to link everything (including the msvc run-time libraries)
Statically, you'll need to modify the project files in ACE yourself.
What type of results are prompted above? I chose the dynamic Connection Library, the debug or release version, and I suggest the debug version, because the example that comes with Ace,
Apps and so on all need the ace library of the debugging version. If you generate the release library, it will take some effort to compile the example programs. Hey, hey...

Then compile the program without any words, and finally prompt that there are no errors. Warning: this ace is really powerful... in addition, I think the compilation speed of vc7.1 seems to be a little slow, and the compilation speed of vc6 is refreshing.
Compilation information prompts very quickly, but vc7.1 prompts a maximum of one and two files after compilation in one second.

The first thing after the ace library compilation is to compile the example that comes with Ace. How do I learn from C ++ when I wait for the example? C ++ npv1 and C ++ npv2 are of course our priorities,
I have heard of these two books for C ++ who want to learn network programming. I have bought both Chinese versions, the English version is also downloaded thanks to the translation work of two teachers, Chun Jing and Ma Vida.
More convenient learning ace!

Here I am going to talk about the problem. On the Internet, I can see that many reviewers in the book reviews of many Chinese translations are talking about it as a mess: How is the translation wrong here? How is the translation poor there,
Let's look at the original version. Don't be fooled by anyone or anything. What they translate is rubbish and so on... I am very uncomfortable to see this. I do not deny that there are many Chinese translations which are not very helpful,
I think it is a bit dizzy, but it is not like this, and I see these comments in every Chinese translation book reviews, it is really...

On the site of teacher Hou Jie there is such an article http://www.jjhou.com/article01-6.htm (Technology Translation perspective, from the computer field), the content of this article
I think it is very practical and brilliant. I won't repeat it here...

My native language is naturally Chinese, and my English level is also normal. I can see the screen-on-screen English on the computer, because it can be enlarged, and I have a thick copy in my hand, dense
The English document is really... the General English document computer-related can barely read (of course, most of the time also need Kingsoft's support: P), want to know the information
With the Chinese version, I naturally want to buy a reference, but I don't want the Chinese translation to be perfect. I just want to be able to understand what the original English document means,
When I think that the translation is not good, I cannot understand any sentence or paragraph. If I can find the English documents, I will chew on it myself, if you cannot, check if you can access the Internet. (most of the time, there is no... :)
If you don't have the original version, you can start to get started. Maybe you will be able to communicate with others in the future, and you will be enlightened. I personally think you should not be too arrogant...

I won't jump out and scold me because of this or that translation problem. If it's not true, it's a waste of money.
I have read all the original books and translated them into books one by one. I would like to ask how many of the scolds have read all the English books one by one. Then I think the translation is poor? I think it's probably because of the Chinese version.
If there were a few wrong words, and then I flipped through the original version and began to scold me. Is it a bit biased? If you read a few lines, the teachers read the full book, I think everyone knows the difference between translating a few lines and translating a full book !!!
I think that as long as the translation teacher has translated it seriously, the translation of "letter, da, ya" (see the article mentioned above by Hou Jie) also has a certain level, it is inevitable that some of the books are overwhelmed,
From my personal point of view, I think that most of my work and things are in line with the old saying: Gold is full, and no one is perfect. This corresponds to the Chinese translation... hey, hey... you are not satisfied. Please be polite.
Come on, it's nothing to blame here !!!

Well, there are so many external questions mentioned above, but I can't help it... let's continue with the above thread about ACE example compilation and running. The following uses the files in the C ++ npv1 directory as an example,
Other examples are similar. First, compile. There should be no problem. If the compilation fails, check the configuration of vc7.1. In the "tool ", "option" has a "project", and then
In the drop-down box of "show the following contents", click it and select "include files". Then, add a new line named "ace_root/include" to it. In my machine
Because ace_root is equal to D:/ACE/ace_wrappers/, So I add D:/ACE/ace_wrappers/include, corresponding to your machine, please add according to the actual situation...

Then, after compilation, the link is used. here, by the way, because the examples of ACE use the debug library, you need to specify the aced when linking. the directory where Lib is located,
Because when vc7.1 compiles the ace library. lib and other files are placed in the lib directory under ace_root, so you need to continue to select "library file" in the drop-down box "show the following contents ",
Add a new row to ace_root/lib, so that everything is OK...

Finally, the program runs. You need to add ace_root/bin and ace_root/lib to the PATH variable of the system, and then open a cmd window to the directory of the example program to run it.
The example program...

C ++ npv1 is an example of a network log server program,
First, let's talk about the client logging_client.exe which can contain two parameters: the first is the port number, for example, 8901, the second is the IP address, and the default is localhost,
Then I will use the server program thread_per_connection_logging_server as an example. It can include a parameter. The first parameter is the listening port number, for example, 8901.
Is the first parameter that the client needs to specify.

For the C ++ npv1 example program, there is one or two other words that have to be said, and the prompt message is too bad during running !!! Client connection, message sending and server acceptance link, no message received
Note: I thought the program is not running normally. Add a line to the logging_client.cpp client.
Cout <"the client inputs and sends the following information to the server:" <user_input <Endl;
To confirm that the program is running normally.
In fact, the server program in the example is still recorded. It will record the messages sent from the client using your machine name + ". log" in the server directory as the log file name,
It's just a binary format, not very nice to understand...

Well, I will write this article first today, but I still have a little bit of experience: writing articles is so tired. It took me two hours from to finish writing this article, not modified yet. polish it !!!
If you want to translate a book, you must first understand the dense English, then translate it like I did in this article, and then modify and polish it. This job is not easy, think about
Comment on scammers... hum... (Here I declare that I have no relationship or contact with the authors mentioned above. The words here are my personal feelings...

 

This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/hjmhjms/archive/2007/03/05/1521349.aspx

 

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.