ACE

zhaozj2021-02-16  66

2004-05-28 9:00 ACE_C NPV1 - Learning Notes (1)

Note: This article declined

Because of the installation of VS 2003 (VC7.1.3091), watch the online information and 98% of the standard C , because now study C , and want to learn Ace, so prepare to compile the original ACE to the vc6 Re-use VC7 to compile, ready for future learning.

In Windows Installing ACE is simple, follow the instructions in Ace-install.html to do everything, first build a config.h file under the ACE_ROOT / ACE, then join a line of rows #include "Ace / Config-win32.h" That's, because I am learning C , I certainly hope that ACE uses a standard C library, then I need to join a macro definition in config.h (): #define ace_has_standard_cpp_library 1 indicates that we want ACE to use Standard C header file, another configuration is whether I use MFC, of ​​course I don't use it, I also expected to cross-platform ... :) So according to my needs, the config.h file is only as follows Two lines #define ace_has_standard_cpp_library 1 # include "ace / config-win32.h" can then open the Ace.dsw under the ACE_ROOT / ACE directory to compile work.

Oh, forgot to say: ACE_ROOT is the directory you install ACE, for example, I am decompressed in the D: / ACE directory, because the path ACE_WrapPers is included in ACE-5.4.zip, so the last ACE_ROOT is equal to D: / ACE / ACE_WRAPPERS, if you are unzipped to D: The root directory of the disk, then ACE_ROOT is equal to D: / ACE_WrapPers, with this type ...

Another point should pay attention to when you perform Ace.dsw, because .dsw is the project file of VC6, open it in VC7.1, you will prompt you to conversion to VC7.1 project files, select "All" is , Then there is a little more attention before compilation: You have to compile by default, all of the ace projects use the dll version of the msvc run-time libraries. You can Still Chooseuse The Static (LIB) Versions of Ace Libraries Regardless Of run-time libraries. The reason we chose to linkonly 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_MFCin your config.h file. However, if you would 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 as tips? I am a selected dynamic connection library, and is the debug version or the Release version, I suggest the debug version, because the ACE comes with Example, Apps, etc. need debug version of the ACE library, if you have generated Release Library, then you compile those examples of examples to pay some hands and feet, oh, ...

Then compiled all the way, and finally there is no mistake, warning, this Ace is really powerful ... In addition, I think the compilation speed of VC7.1 is like a slow, the compilation information of the brush brush is compiled under VC6. Soon, and VC7.1 is a second to compile, two files. The first thing to compile the ACE itself is naturally compiled, and I will wait for C small rookie. Example How to learn?: The C NPV1 and C NPV2 in P is of course our focus. It may have heard of these two books for C to learn network programming. The Chinese version I bought it. The English version also downloaded :) Thanks to the translation of the two teachers of Chunjing and Mavida so that we can learn the ace!

Here I said the question outside, I saw a lot of commentors on the book review of many Chinese translations, I can say that it is a mess: How to translate it is wrong, there is a bad translation, we are better to see the original version, Don't be cheated, they translated it is garbage, etc. ... See these I am very uncomfortable, I don't deny that there are a lot of translations in many middle translations, it is a bit dizziness. Brain rose, but it is not this, and the book reviews I have seen every translation in the book is ...

There is such an article on the site of Houjie, http://www.jjhou.com/Article01-6.htm (the scientific translation surface, talking from the computer field), this article I think I think it is very real. , Incisive, not repeating here ...

My mother tongue is natural is Chinese, and my English is also general. I will see the English in the computer. Because I can zoom in, I can be enlarged, and I have a thick, the English book of dense Ma Ma is really. ..: p General English document computer-related can be barely read (of course, most of the time to help: p), the information you want to know has Chinese version I naturally want to buy, but I will not The translation is 100% perfect. I only ask me to know what the original English document shows what it means. Specifically, what sentence is not good, I don't understand, I can find it. I will go to myself, I can't see if I can't go online, I can't go online (most of the time is not ... :) There is no original version, I can't let it, I may change from other aspects. I am suddenly turned over, I feel that I don't want too much to get too much ... :)

I won't have any deficiencies because of this or translation, it's not right, jump out of the mess, say it is garbage ... :) Those who don't talk about the rendering of the book, at least the teacher will put the original book All after reading it, then translate into a book, ask some people who are chaotic, all of this English book is finished, and then think people do not translate? I look probably to see Chinese version, I think there is A few words are wrong, then I have turned over the original version, I started to mess, this is some biased. You look at a few lines. People teachers are reading all the book. I think who knows the translation of several lines of translation. !! I think as long as it is a teacher who is translated, I translated "Letter, Da, Ya" (see Hou Jie's article mentioned above) also has a certain level, some small people are inevitable, so-called If you don't hill, you will see any job, I feel that everything is in line with a big saying: the gold is not enough, people have no people, this corresponds to the Chinese translation ... Hey, ... you are really dissatisfied, please have a polite briefing, where there is a chaotic!!!

Ok, I have said so many questions, but I can't help but ... :) Let us continue to compile, run on the ACE example, the following is as an example in the C npv1 directory, other The example is similar, first is compiled, there should be no problem, if the compilation is not passed, please check the configuration of VC7.1, there is a "project" in "Tool", "Options", then there is " Directory of the content, the drop-down box, select "Contains File", then add a new line ACE_ROOT / INCLUDE, in my machine, because ACE_ROOT is equal to D: / ACE / ACE_WrapPers /, I join D: / ACE / ACE_WRAPPERS / INCLUDE, corresponding to your machine, please join ...

Then because it is a link, here is the way, because the above says, the example of the ACE comes with the debug library, then you need to specify the catalog where Aced.lib is specified during the link, because VC7 .1 When compiling the ACE library, put the files such as Aced.Lib in the ace_root, so you have to continue selecting "Library File" in the drop-down box above "Directory" to display the following, then join new Join the ACE_ROOT / LIB, so that everything is OK ... The last is the operation of the program, you need to join the ACE_ROOT / BIN and ACE_ROOT / LIB in the system's Path variable and then open a directory of the CMD window to the example program. You can run an example program ...

The example of C NPV1 is an example in a network log server, first we talk about the client logging_client.exe it can take two parameters, the first is the port number, for example, 8901, the second is IP, The default is localhost, then the server program I will take three_per_connection_logging_server as an example, which can bring a parameter, the first parameter is the port number of the listener, such as 8901, this is the first parameter that the client needs to specify.

For example, if there is one or two sentences, there is something wrong, the time prompt information is too bad! In case the program is not working properly, joining a row cout << "client input in the client logging_client.cpp and sent to the server:" << User_input << Endl; confirms the program runs Normal. Active server program still has a record It will record the message sent by your machine name ". Log" as the log file name, but it is a binary format, not very good-looking ... :)

Ok, I will write this today. I have a little bit of experience today: I have been very tired of writing articles. I spent two hours from 9 o'clock to 11:00, I have not modified it. , Moistening !!! If you think that if it is a translation book, you must first understand the English language, then translate it as I wrote this article, then I have to modify, moist, this work is not easy, then think Those who have sent comments ... Hey ... (here I declare, I have no relationship with the authors mentioned above, here, the words are purely personal ... :)

转载请注明原文地址:https://www.9cbs.com/read-28240.html

New Post(0)