Use cygwin to compile cocos2d-x code

Source: Internet
Author: User

Convert from: Use cygwin to compile cocos2d-x code

1. The first step is to find the local installation location where cygwin is installed. For example, my website is c: \ cygwin \ home \ administrator.

2. Modify the. bash_profile file in the directory and open it in a text editor. Add the following code at the end of the file: ndk =/cygdrive/D/tools/eclipse_android/Android-ndkexport ndk Is the local storage location of Android ndk.3, install cygwin, the main installation components: autoconf2.1automake1.10binutilsgawkgccgcc-coregcc-G ++ gcc-mingwgcc4-coregcc4-g ++ gdbmakepatchperltar4, after installation, enter the cygwin interface, enter the following command:
4. The cygwin installation package is required:

The file on the left is very important. It is downloaded to a local component to simulate some files in the Linux system. 5. After configuring the above files, you can package and compile the cocos2d-x code under cygwin, saving the trouble of copying files under the Ubuntu VMware Workstation Virtual Server. Cygwin, developing a Linux program in WIN (reprinted) Qian Kun yixiao csdn (17:17:39)Many Windows users are not used to Linux development environments. Although I would like to try it out, I am often afraid that the Linux system will disrupt my normal life: 1> install the Linux system and break down the windows system, resulting in my failure to live normally; 2> Linux development is too difficult to get started. writing the first helloworld is no less difficult than Java, and the Environment configuration is hard to understand. My opinion on this is: whether the road is flat or steep, you will always go. If you are willing to invest in the Linux development community, you will not install the Linux system, it cannot be imagined that the work environment will not be configured. (In fact, you really need to understand the principles of a lot of things, otherwise it is difficult to troubleshoot: for example, disk boot principle, partition structure principle, LINUX partition structure and file system, environment variable settings, a wide variety of compressed package installation package unzip installation method, user management permission management and other common commands, so that the driver installation system, culture, and so on, are trivial ).(Http://www.fanqiang.com) This article tries to skip this difficult step to enable a Linux simulator in a Windows environment (basically the same as the command line development environment below Linux), in just 20 minutes, it teaches you how to make a pure helloworld compiled by GCC in Linux. It's like trying it before buying a snack. Isn't it a pleasant thing? (Note: In fact, cygwin not only has this simulation function, but it is also a very effective tool for porting UNIX <--> win programs, and someone uses it for Embedded System Development) 1. What is cygwin?To answer this question, you 'd better Google "cygwin's history" and perhaps get a more detailed answer. In short, cygwin is a Linux Simulation Environment running on the Windows platform. It is a free software developed by Cygnus solutions. (The company has developed many good things, famous for its ECOs, but it is now acquired by RedHat ). Many friends do not understand the differences and connections between Linux and Unix. I would like to give a brief introduction here. UNIX is a registered trademark. It is an operating system that can be authorized to use only when a large number of conditions are met and a considerable fee is paid. Linux is a clone version of UNIX, it is an operating system created by its founder Linus and many world-renowned hackers. Why is there a lot of software between Linux and UNIX that can be easily transplanted? Because Linux also meets the POSIX specifications, the operating mechanism is similar to Unix.
  Here is a reference to the Internet (Source: http://blog.csdn.net/glock18/archive/2004/07/10/38275.aspx ),It is used to explain how cygwin works: Cygnus first improved GCC, GDB, gas and other development tools so that they can generate and explain Win32 target files. Then they will port these tools to the Windows platform. One solution is to greatly modify the source code of these tools based on Win32 APIs, which obviously requires a lot of work. Therefore, they adopt a different method-they write a shared library (cygwin DLL), and call the Unix-style calls (such as fork, spawn, signals, select, sockets, and so on) are encapsulated in, that is, they are based on
Win32 API writes a simulation layer of the UNIX system library. In this way, as long as the source code of these tools and the shared library are connected together, you can use the cross compiler on the unix host to generate a tool set that can run on the Windows platform. Based on these development tools transplanted to the Windows platform, Cygnus gradually uses other tools (almost no need to modify the source code, but only need to modify their configuration scripts) the software is transplanted to Windows. In this way, running bash, development tools, and user tools on Windows seems to work on UNIX. For more information about cygwin implementation, see http://cygwin.com/cygwin-ug-net/highlights.html#cygwininstallation.The Installation File of cygwin can be easily found by Google. At present, there are two types of websites in China: "network installation version" and "Local installation version. The standard release version should beNetwork Installation version. There is no difference between the two. The following describes the installation process. Step 1. Click the Installation File (setup.exe) after the download. the first screen is the GNU copyright description. Click "next (N)-> ",Go to the installation mode selection screen.Step2. the installation modes include "Install from Internet", "Download Form Internet ","Install from local directory. "Install form Internet" is installed directly from the Internet, suitable for fast network. If you are not as fast as you are, or you want to save the downloaded installation file after installation, you should choose "Download Form Internet" Next time you no longer download and directly install it ", download and install the file (about 40 MB ). In fact, the so-called "Local installation version" is also a package that someone else downloads all files from the Internet (applicable to China's national conditions)  Step select the installation Destination path and the path of the installation source file, and then enter the path where the installation package is selected.Note that this is a major event. I did not see this step during the first installation. The GCC was not installed, and thus the file could not be compiled.+ AllDefault + Admin default .... + DevelDefault + Editors default ....As shown in, you can double-click a node in the Treeview to change its status, such as default, install, uninstall, and reinstall. The default status is default. Many tools are not installed by default. Here, I chose install on the default next to the all line and install it all to avoid future problems. (Note: The tree control here is different from the one below win. You can try to point it on all and on default next to all, and there will be different responses)Step 4. Click next and the installation is successful. It automatically creates a shortcut on your desktop.  Now, let's start my Linux journey. Double-click cygwin to enter the system.First, we will introduce several simple Linux commands. PWDShow current pathCDChange the current path. If no parameter exists, enter the home directory of the corresponding user.LsList Files in the current directory. This command has n multiple parameters, such as LS-AlPSList Current System ProcessesKillKill a processMkdir: create a directory rmdir: Delete the directory RMDelete an objectMVFile Name or directory nameManOnline HelpLessDisplay the last few lines of a fileMost Linux commands have many parameters and can be used in combination. Therefore, whenever you do not know or cannot remember which parameter to use, you can use man to find the switch. For example, if you want to find how to use ls, you can enter $Man lsSystem Echo information: ls (1)FSFLs (1)NameLs-list directory contentsSynopsisLs [Option]... [file]...DescriptionList information about the files (the current directory Default ).Sort entries alphabetically if none of-cftusux Nor -- sort. -A, -- all Do not hide entries starting. -A, -- almost-all Do not list implied. And .. -B, -- escape Print octal escapes for nongraphic characters -- Block-size = size Use size-byte Blocks

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.