Xcode Command Line action

Source: Internet
Author: User

question: What does Command line Tools for Xcode do?

Answer: Command line Tools has git, xcrun, xcodebuild, gcc, gdb, make, etc.

Installing and using the GCC command-line tool under Macin this way, you do not have to use Visual C + + under Windows.  Apple no longer defaults to installing command-line tools like GCC after Xcode4, and if you need to use command-line tools (GCC, gdb, make, etc.) to develop, after installing Xcode in AppStore, open Xcode.  Select Xcode----> Preferences, Open the dialog box, and select Downloads. Under Components , download command line Tools.  After the download is complete, as shown in. Once the installation is complete, you can use GCC in the terminal. Here is the version that looks at GCC. To view GCC versions and information:gcc-v 
Compiled, the a.out is automatically generated, which is the executable file, not the target file:gcc test.cExecute, show running result:./a.out when executed, displays the execution time, using the Times command:Time ./a.outThe user can also change the compiled file name by using the option-O, using the following command line to give the a.out a result:gcc-o result test.cThis time, execute the newly named file:./result
-C option: Only compile the source code (. c file) into the target code (. o file), but skip the connection step. It makes it faster and easier to manage when compiling multiple C programs. By default, the target code file that is established by GCCthere is only one. o extension. gcc-c test.c  - s option: tells GCC to stop compiling after the C program file has produced the assembly language file, the default file name extension for the assembly language file that is generated is. S. gcc-s test.c
-E option: Instructs the compiler to preprocess only the input files, and the preprocessed output will be sent to the standard output instead of being stored in the file.gcc-e test.c
If you have more than one version of GCC installed, to specify that you want to run a version of GCC, the command is as follows, note the case:gcc-v 2.6.3-v
Show Warning: The command to use the switch-W control warning message in GCC is as follows:Gcc-wall-o Test test.cBrowse Files:Cat test.cTo edit a file using vim:Vim test.cMove the cursor to the relevant file, make the changes, and save the changes. Enter the command:: w!To exit the VIM edit state, enter the command:: Q

Xcode Command Line action

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.