51CTO Expert Clinic: Application of Boost Library

Source: Internet
Author: User

Boost is called the "C ++ quasi-standard library" and contains many high-quality tools, such as regular expressions, string algorithms, smart pointers, and hash containers, it makes up for the shortcomings of the C ++ 98 standard library and can build components with industrial strength, representing the highest technical height that C ++ can achieve. However, the content of the Boost library is profound and profound, and a large number of advanced programming skills are used. The structure is exquisite and complex, which makes many programmers daunting.

Mr. Luo Jianfeng, Project Manager of the software company under the central ministries and commissions, is invited to answer questions about the application of the Boost library. You are welcome to ask questions and discuss them with experts to make progress together!

Expert Book: Guide to full development of Boost Library

Current outpatient link: http://doctor.51cto.com/develop-214.html

Current experts:


Luo Jianfeng

Q: CHO yaozi
Hello, Miss Luo.

I have been using VS for C ++. NET 2005 Program Development in C # language. recently I want to develop C ++ programs. in. NET 2005 when creating a project, there is a C ++ project. because.. NET is an integrated development environment based on. NET Framework. what I want to ask is that I use. NET 2005 compiled C ++ program is not required. NET Framework! In addition, the website's background database does not use MD5 encryption. How can it be converted and cracked!

A: Luo Jianfeng

I am not a teacher.

I have not used vs.net, and I have been using vc8 and C ++ in vs2005. netFramework, which can be directly compiled into Native Binary Code without running the environment. You only need to host C ++ without using Microsoft's own.

Another problem is that md5 is hard to understand. md5 has been overcome, but the difficulty is still quite high. For details, check the information on the Internet. I have not studied the attack. Sorry.

Q: leo0087

Hello, Miss Luo!

I want to know the differences and advantages between C ++ and JAVA?

A: Luo Jianfeng

You don't need to call a teacher. Just call my network name chrono.

I am not particularly familiar with java. Sorry for the mistake.

Java runs on the jvm Virtual Machine and is compiled into bytecode, while C ++ directly compiles it into executable binary programs without virtual machines.

Java has a garbage collection mechanism. C ++ must manually manage the memory. However, you can use libraries such as boost: shared_ptr, pool, and ptr_container to simplify this process.

Java is simpler than C ++ and does not support multiple inheritance and operator overloading. C ++ is large and has many complicated syntaxes. However, java has gradually absorbed many features of C ++, such as enumeration and templates.

One of the most important differences is that java is an industrial standard rather than an international standard. Its fate is in the hands of sun/oracle, and C ++ and C are both international standards, it is not controlled by any company or individual.

The advantage of C ++ is its powerful function and fast running speed. Almost all platforms provide C/C ++ support and can write programs that implement any function. The disadvantage is the lack of support libraries and the absence of a large number of application frameworks such as java. However, once you have mastered C ++, it will certainly be attracted by its powerful functions and profound language connotation.

Q: Sun Kong

Hello, chrono.

How to install C ++ library Boost and how to compile and install C ++ library Boost1.40. For detailed steps, refer to Step 1 and step 2. Hard work! How to install C ++ library Boost

A: Luo Jianfeng

You can directly decompress the file without any special installation. You need to set the search path for the header file.

Most boost libraries can be used without compilation. For other libraries such as date_time and system, you can use bjam or directly add the source code to the project compilation, for detailed steps, see the built-in documentation or the Boost library full development guide.

Q: bingfeng

The following error occurs when I use the path in BOOST:

"Unhandled exception: 0xC0000005: Access conflict occurred when reading location 0x00000000"

The program is a win32 console program:

# Include <boost/filesystem/path. hpp>
# Include <iostream>
Usingnamespaceboost: filesystem;
Usingnamespacestd;
Intmain (void)
{
Try
{
Boost: filesystem: pathsave_path ("c: \ \\");
}
Catch (std: exception & e)
{
Cerr <e. what () <endl;
}

Return0;
}

When an exception occurs, stop at boost: filesystem: pathsave_path ("c: \ \\");

The boost library is linked to the libboost_filesystem-vc80-mt.lib, And the Runtime Library is MDd.

Thank you very much for solving this problem!

A: Luo Jianfeng

I have no problem in this test. The mt method is used. The library uses embedded project compilation, boost1.43:

# Define BOOST_SYSTEM_NO_LIB
# Define BOOST_FILESYSTEM_NO_LIB
# Include <boost/filesystem. hp>

You can try catch system_error to check the specific error information or debug the program code.

Q: zhang45xiang

Instructor Li

Hello, I am not very familiar with the "Application Discussion of Boost libraries" in this issue. I am here to join you!

I have read a little about c, but I have no clue. When I see the code, I will be dizzy! It seems that these languages are hard to learn!

A: Luo Jianfeng

Learning c dizzy can be changed to python and ruby, which is easier than C/C ++.

Q: rickyand

How can I add string variables with UNICODE in VC2010? I use _ T or L. Isn't it a String constant? Thank you. This problem has been bothering me for a long time. I have been using VC6.0 for this problem. Thank you.

A: Luo Jianfeng

I rarely use unicode in development, because it is very underlying. I personally think that wchar_t, wstring, and other C ++ standard medium-width character types should be used, for example:

Wstring ws = L "unicode ";
Wcout <ws <endl;

Vc6 is too old to support many modern C ++ features, but vc2010 is not very stable. You can try vc8 or vs2005.

Q: BZoooooo

I am only familiar with C ++. Now I am learning JAVA. I am going to learn more about it!

A: Luo Jianfeng

The java language itself is small, but there are too many external libraries and frameworks, and c ++ is reversed.

I personally prefer c ++, which is free from sun/oracle restrictions.

In addition, c ++ can be used in objective-c, which is very powerful in developing mac/iphone programs with boost.

Q: Bill_Hoo

Good evening:

I am in the next phase of my sophomore year. I like C ++ and software engineering very much. I have decided to use C ++ on the road of software engineering.

The following are some questions:

1. In my case, what stage is the boost library suitable? In other words, is it necessary to access boost now?

2. What is the relationship between the boost library and C ++ STL?


3. I myself am very fascinated by the C ++ language. Although I have selected a language, I have not yet chosen which language I want to develop. I have been engaged in c ++ for more than 10 years, hope to get some suggestions in the direction.

4. What do I need to learn in the advanced stage after I have been familiar with the main C ++ syntax and features? What books do you read?


5. I have heard that a good software engineer must have a certain grasp of the underlying knowledge of the system. What exactly does this grasp mean? It is expected to be targeted.

Finally, I would like to thank Chrono for its selfless help. Thank you ^

A: Luo Jianfeng

1. to learn about boost, you must first familiarize yourself with C ++, especially some advanced features, such as namespaces, templates, and exceptions. Then you must be familiar with STL and standard libraries, its modern C ++ programming style affects all C ++ programmers today.

If you have a basic understanding of stl, You can see boost. In fact, boost is not too difficult, and many components are quite simple to use and can be applied immediately to actual work. It is recommended to read the boost library full development guide. I personally think it is intended for junior and intermediate programmers.

2. I have a detailed answer in the boost library full development guide. In short, boost is a better STL and a successor to STL.

3. c ++ focuses on the underlying layer and lacks an application-oriented development framework. However, it can do anything in a wide range, I think it is a great deal of money to use objective-c ++ in ios.


4. please refer to the recommended bibliography in the appendix of the "Full Development Guide for boost libraries". Here are two of the most important "design patterns" gof. Do not read these dummies or big talk books ), objective c ++.

5. The underlying layer of the system depends on the specific direction, such as windows, embedded systems, and unix. Or have a deep understanding of the internal model of C ++, such as the memory management mechanism and object model. However, this insight does not have to be understood in depth. As the practice needs to be understood, it is not necessarily beneficial to be knowledgeable in advance ).

Q: zhang_san_san

Hello, Miss Luo:

I know little about Boost. What I want to know is its application in the embedded field. Generally, embedded systems are not written in C language or assembly directly. Is there a need for C ++ and the mark template library STL?

A: Luo Jianfeng

Uclinux, ucos, and other operating systems have weak functions. Some of them do not support C ++ well, or even do not support it at all. stl and boost cannot be used at this time. However, some embedded systems use linux and support c ++, so that stl and boost can be used. For more information, see the C ++ compilation instructions in the system manual, determine which ones are supported and which ones are not supported.

Q: superpopb2b

Since it is a C ++ standard library, has it been integrated into the current mainstream C ++ compiler library, such as G ++ or VC ++? Do you need additional installation?

In addition, when can it be inherited to the database?

A: Luo Jianfeng

Boost is a "quasi-standard library". In fact, it is still a third-party library, so it is not integrated and will not be integrated in the future. However, boost is easy to install, and integration is of little significance.

Q: wawehi

I don't know what to ask. I have your boost Guide (genuine) in my hand. It is a bit similar to the manual. If you don't know about boost, you can flip it out, I hope to provide another guide on how to use boost to develop game servers. I will explain it in detail in various aspects and pass on your programming experience ~~~~~~~~

Support you !!!

A: Luo Jianfeng

Thanks for your support. Like stl, boost provides underlying libraries. You need to use other architectures for Development servers. I am not a hard nut to say in this field. I hope to cooperate with you in the future.

Q: yf213
Chrono, hello!

I just got started with the boost library. It is no problem to apply it to the library that comes with boost. However, after compiling lib for the mpi library, there is always a link error and the relevant symbols in mpi cannot be found! According to the installation and compilation guidance provided by some netizens on the Internet, the solution fails. I am troubled by this problem and hope to help you!

Thank you!

A: Luo Jianfeng

I have not studied the mpi library. I just checked it out. Because my main working platform is win, I cannot compile external libraries such as mpich and openmpi, so I cannot test boost. mpi. Sorry.

We recommend that you use embedded project compilation instead of dynamic links, which may reduce some troubles, such:
# Define BOOST_MPI_NO_LIB
# Include <libs/mpi/src/xxxx. cpp>

------------------------------------------
Phase II) outpatient service: Application and test of 10 Gigabit copper cable
 
① Notice: At present, 10 Gigabit copper cables have become a cabling system widely used in smart buildings and data centers. In the entire lifecycle of network system engineering and cabling planning, design, and construction until on-site acceptance, the cabling testing technology is crucial. For enterprise users and test units, various difficult problems are inevitable during acceptance, detection, maintenance, and fault diagnosis.

Link: http://doctor.51cto.com/develop-215.html

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.