Summary of eclipse CDT's C/C ++ Development Environment

Source: Internet
Author: User

Http://blog.csdn.net/yang3wei/article/details/7624465

I moved a lot of articles in one breathArticleWe were very busy recently,

Is to put the C/C ++ development environment in eclipse at the end,

I have no choice but to endure it. Today, I accidentally handled this matter ~

Eclipse is so excellent that I can't extricate myself from it,

Now, Java, actionscript, C/C ++, PythonProgramming LanguageI have been able to develop in eclipse.

The current mood is undoubtedly very comfortable.

As for objective-C, stay honestly in xcode,

Xcode is actually quite good, and eclipse is not a waste of effort,

However, it does not do well in compatibility with multiple programming languages.

In the past, xcode seemed to support C/C ++, Java, and other languages (now it seems to support C/C ++ )~

Now xcode has been castrated, and the size of the installation package is 3. Multiple G is now 1. 6g,

In terms of functions, it is naturally reduced a lot. Why is the function reduced? I cannot guess Apple's ideas.

However, xcode can still be used to write objective-C, which is completely back to the old line,

People have a sense of returning to the essence. In fact, C/C ++, Java, and so on can still be chosen by more than N ides...

It took me a long time to get eclipse CDT today.

It doesn't mean how long it takes to download the eclipse version with CDT, more than 100 MB,

Although my network speed is not good, it still takes a long time to complete the download.

I already have an eclipse in my local machine, which is also Helios,

Later I thought that the two eclipse products were a little chicken, so I installed the CDT feature update directly in the eclipse that I 've been using.

After this is done, it will be counted as the development environment of several programming languages is concentrated in the eclipse that has been used before.

I think it is quite good. I can use different languages for development and simply switch some ide views.

If you think that projects in different languages are mixed in the workspace, you can also create an independent workspace for different languages,

During use, you can switch between them at will. In short, it is quite helpful ~

However, I encountered a lot of broken issues when I got CDT, one or two of which even took a lot of time,

The purpose of this blog post is to record all the pain points encountered during this period and provide a reference for the future ~

Well, in fact, some simple issues have already been reflected in some of the previous articles.

I think twice, but I am still the most difficult. I am stuck with the big data that has been exposed for more than N times:

The main problem is that if I create a new project, the project structure is similar to the testbed of box2d,

How can I organize the source code modules of the glui, glut, and box2d lightweight reusable frameworks into my project?

I searched the internet for a long time and did not find the answer that best fits my needs,

It may be because eclipse CDT is not widely used, or because it is too low-key to be developed with CDT, leaving little valuable text records.

If you don't talk much about it, you don't have to worry about it. Just pick up the most important things and list them as follows:

1. Right-click Project-> Properties (command + I)-> C/C ++ build-> Settings-> toolsettings->

Gcc C ++ compiler-> nodes des:

"$ {Workspace_loc:/testbox2d/libs }"

The preceding string is automatically generated after the libs directory of the selected project is viewed.

Similar to the El expression, the meaning is very clear, that is, the compiler will retrieve the contents under this directory during the compilation process. H header file.

In fact, after my tests, this setting in C/C ++ build

It is associated with the settings in C/C ++ general-> paths and symbols-> program des-> gnu c ++ ~

After removing/testbox2d/libs from the replace DES-> include directories in,

In the previous figure, "$ {workspace_loc:/testbox2d/libs}" will also be erased.

Otherwise, remove "$ {workspace_loc:/testbox2d/libs}" from the previous figure,

The "/testbox2d/Libs" entry starting with a purple icon at the position mentioned later will also be erased.

Therefore, the two mentioned above are closely related and mutually dependent.

Refer to the figure below to get a correct understanding of what I mean:

So far, clean the project. The previously reported header file box2d. h cannot be found.

Or you cannot find the compilation errors of the header files of the box2d source code module, such as b2world. h and b2body. h ~

However, the problem persists. Next we will encounter a new compilation error, that is:

B2world and b2body definitions cannot be found in the main. O object file.

(Main. O contains the main method. The. o file is the file type generated after the CPP file is compiled ).

I checked the problem online and quickly found the cause:

That's because the previous operations only let the compiler know the position of the header file of the box2d source code module,

As for the specific. cpp implementation of these header files, although they are put together with the header files, they are not actually compiled.

According to my guess, onlyCodeDirectory of the source file, where the CPP file will be compiled.

This is not my credibility, because I did not see b2body. O, b2world. O and other files compiled in the console.

This is enough to explain the problem: the CPP source file of box2d is not involved in the compilation process.

Now that the problem has been found, the solution is as follows:

Group the root directory of the box2d source code module to"Source codeFolder!

The following is the directory structure of the project andProgramSmooth execution ~

In general, the time spent this time is mainly due to

# Include <box2d/b2body. h> This line of pre-processing commands is not very thorough, or I have learned it before, but I have forgotten it for a long time.

# Include <ABC/DEF/fuck. h> and # include "test. H" have different meanings. You can ask Google experts about them,

After a long time, I just degraded to the point where I could only tell what I was saying. What I said was wrong, and I was afraid that I would mislead others.

Well, let's not talk about these frustrations. Let's talk about the sensory experience of eclipse CDT:

Compared with projects that use xcode to compile objecive-C and C/C ++, xcode compilation is more efficient.

The feeling is that the compilation of a box2d source code module by eclipse cdt makes me a little upset.

Speaking of this, Apple is now spreading its wingsPreparing to leave GCC (GNU compile collecion,

Apple has a llvm. I am not very clear about the difference between llvm and GCC, but what I know is,

One day later, Apple will transition the llvm-GCC compilation group to pure llvm.

When I was in Shenzhen a year ago, I used windows. I still remember clearly,

I saw the excited expression on my face when GCC claimed to be able to compile n中 programming language,

I don't know how long it will take (GCC is very large) to get a complete set of GCC into my computer.

In fact, G ++ is not used in the future. GCC compiled some C/C ++ source files,

Other programming languages are not involved. The computer went wrong again. OK. After restoration, nothing was done --,

Now we use Mac, UNIX-based variants, which are very good and suitable for scientific research systems,

It's no longer an egg windows. The surprise to me is:

Mac has built-in python, Java, GCC, and llvm compilation tool set released by Apple.

On Mac, the development environment that was originally obtained through N-long downloads on Windows,

Mac is built in directly. From this point of view, we have to say that Mac is much better than windows.

Some people say that the MAC operation is simple, and it is silly to use more,

In fact, Mac is more suitable for Program Development and operating system learning than windows, as long as it is a little enterprising.

This is my personal opinion. The angry man makes a decision to close the work ~

Related Article

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.