LINUX--GCC Simple usage

Source: Internet
Author: User

GCC is the most commonly used under Linux C compiler, corresponding to the CPP has the corresponding g++ tool, Debug has GDB, but it will not be used.

Personally feel that GCC is really a good thing, can be programmed directly under the gedit and then write a shell script with GCC compiled, no more than some IDE trouble, some of the IDE is not only difficult to use and there will be some inexplicable error. 1. Gcc-o Hello hello.c compiled and linked as an executable file named Hello 2. Gcc-i/usr/include Hello.c/usr/lib/libm.a-i contains the header file, then compiles the link as an executable file, and finally the static library file 3. Gcc-c test1.c test2.c compiled for TEST1.O and TEST2.O 4. AR crv mylib.a test1.o test2.o the. o file into a static library Ranlib MYLIB.A make the library file available to create your own library file do not forget to build the header file 5. Gcc-o test test.c./include/usr/local/ contains examples of dynamic libraries 6. When the program cannot find the library file, you can change the configuration in/etc/ and then execute ldconfig to take effect. LDD XXX command can query the function library required by the XXX program. More information about GCC can be obtained through the man GCC and info gcc.

LINUX--GCC Simple usage

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: 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.