C-free (Configuring GCC, Visual C + +, Borland C + + compilers)

Source: Internet
Author: User
Tags codelite

C-free (Configuring GCC, Visual C + +, Borland C + + compilers)

I used to vc++6.0 when I wrote a simple C + + code, but I had to give up because there was a compatibility problem with VC6.0 under Windows7. After trying out a number of c/c++ide, this article recommends several lightweight ides, if it is done engineering, under Windows is certainly recommended vs.

At present, most of the tools that most people write in a simple c/C + + code are available in two main ways: 1) Some text editors (such as Vim, Gedit, Sublime, notepad++, EditPlus, etc.) with gcc;2) IDE.

For the first choice we do not discuss today, interested friends can own Baidu or Google. Some of the most common lightweight Ides are recommended below.

1) MinGW Developer Studio

Accustomed to the vc6.0++ interface of friends can try this IDE, it is built with the GCC compiler, interface and vc++6.0 surprisingly similar, startup speed is relatively fast.

: http://koti.mbnet.fi/vaultec/mingwstudio.php

2) dev-c++

The IDE believes most people are not unfamiliar, but it seems that after releasing the 4.9 version, there is no update. Later by another team in charge of the update, and replaced the name, changed to Orwell dev-c++,dev-c++ built-in is also the GCC compiler, in a sense, this IDE is very good.

: http://sourceforge.net/projects/orwelldevcpp/

3) Codeblocks

Codeblocks is a cross-platform open-source and C + + IDE, a lot of friends have a unique love for this IDE must have its highlights, like friends can try.

: http://www.codeblocks.org/

4) CodeLite

The CodeLite is also an open source C/s cross-platform IDE that supports the three main operating systems of Windows, Linux, and Mac.

: http://downloads.codelite.org/

5) C-free

C-free is a c/c++ide written by a nation that supports a variety of compiler settings and supports engineering transformations across multiple Ides.

: http://www.programarts.com/cfree_ch/index.htm

All in all, the above 5 lightweight Ides are a good choice, you can eliminate their preferences and the interface style of habitual to choose. Personal comparison like C-free this IDE, below to explain how to configure the C-free, let yourself write code more comfortable.

Since the GCC compiler with the C-free 5.0 built-in MinGW is 3.4.5 version, very old, here I recommend upgrading the GCC compiler version. Here's a look at how to upgrade the C-free compiler.

1. Download and install MinGW

Download Tdm-gcc,:http://tdm-gcc.tdragon.net/download First, this address is the latest version of TDM-GCC download page. I downloaded a slightly older version of 4.7.1.2,:http://sourceforge.net/projects/tdm-gcc/files/tdm-gcc%20installer/previous/1.1006.0/, Select Tdm-gcc-4.7.1-2.exe to download (note the version, if it is a 64-bit system, download the 64-bit version).

After the download, install the installation, the following is the initial interface:

  

Be careful not to check the "Check for updated files on the TDM-GCC server" below. Then choose "Create" to install all the way next (but note that the best installation path does not have Chinese and white space). My installation path is C:\MinGW32.

After installation, open cmd, enter gcc, if prompted "No input files" means the installation is successful. Then write a simple Hello World program and try the GCC command line. Create a new hello.c file under the E drive and enter the code:

1234567 #include<stdio.h>int main(void){  printf("hello world!\n");  return0;}

  

If you print out Hello World, the GCC installation is successful.

2. Configuring a new version of the GCC compiler for C-free

Open C-free, choose Build-Build options,

  

It can be seen that its own GCC compiler is 3.4.5 version, very old. Then click the small arrow next to Debug, select "New Configuration",

  

Select "MinGW" in the "Compiler type" column, take care not to select "MinGW", and then configure the name to fill in a random line, you will need to manually specify the MinGW installation path after

  

  

Once you are sure, you can see that you have successfully created a new TDM-GCC compilation configuration.

  

Then notice that when you create the project, you select different compilation configurations as needed:

  

Here's a test of the difference between the old GCC compiler and the new version of the GCC compiler. Here is the test code:

123456789 #include <iostream>usingnamespacestd;intmain(intargc, char*argv[]){    char*s = "hello";    intn = strlen(s);    return 0;}

  

Then create a project, and when you build the configuration selection, be careful to select "TDM-GCC" and the following is the result of the new GCC compiler compilation:

  

The difference between the two compilers is self-evident, so I recommend using c-free or upgrading the compiler.

If additional compilation settings are required, such as compiling the code according to the C99 Standard or the C89 standard, you can configure it yourself

  

I've only configured the warning message here, and the rest is the default configuration, because not all warning messages are displayed when compiling the code, and some warning messages can be very important, so I set up to display all warnings at compile time.

  

Simply tick "Enable all complier warnings" in the "wanrings" option.

In addition, when I wrote the code, I found that if I included the limits.h header file, I found that it would always be an error:

Lib\gcc\mingw32\4.7.1\include-fixed\syslimits.h:7:25:error:no include path in which to search for limits.h

Tip the header file cannot be found, and then I find that the "include-fixed" path is not in the Include files, so just add the path.

Then re-establish the new project (note that you must re-establish the project), including Limits.h header file will not error.

In addition C-free support other projects for conversion, just select "Tools"-"engineering conversion" can be.

  

If you don't want to use the GCC compiler, you can, of course, configure other types of compilers, such as Visual C + + complier, Borland C + + Compiler, to suit your needs.

The following is a list of Visual C + + compiler and Borland C + + compiler compilers, similar to the configuration method above.

Visual C + + Compiler (Visual C + + 2003 Toolkit): http://download.csdn.net/detail/onino_info/2887618

Borland C + + Compiler 5.5:http://download.csdn.net/detail/oldcatredhat/1044177

The above is only a personal view, and I recommend c-free here, not to indicate that Codeblocks, CodeLite (the 2 IDE is a very outstanding IDE) and other IDE is not good, everyone's coding habits and use of the IDE's preferences are different, choose the right one for their own.

C-free (Configuring GCC, Visual C + +, Borland C + + compilers)

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.