Programming Technology-cross-platform code debugging-general Linux technology-Linux programming and kernel information. The following is a detailed description. In development, for code reuse, we always separate the Core algorithms from the interface,
The Core algorithms are generally written in C and hope that the code can be compiled and run on other platforms. At Microsoft
There are VC on the platform, and gcc is used on Unix and some embedded platforms (palm. If the code is compiled
Porting is hard enough. It is best to support code writing. If you work in the company, you can have more
Machines, one with 2000, and one with linux, have to copy the code or use Telnet to use the server,
If there is only one computer, it will be miserable. install two operating systems, restart and switch the operating system.
There is a software here to solve this problem and work on the same source code in windows.
Use VC and gcc for simultaneous compilation and debugging. It is cygwin. I use vc6.0 and gcc2.95.2.
1. Install cygwin
First, install cygwin, which is a product of cygnus.com and download it from its website,
You can install it on the internet directly. Do not forget to select the gcc option during installation.
2. Code directory
My code directory is ZCore. Below is a subdirectory. The subdirectory Build contains two sub-subdirectories:
VC and gcc respectively Save the VC project file and the gcc Makefile; the subdirectory Src is the code directory;
The sub-directory Doc contains code Readme and other instructions (not used to English code with Chinese comments), Code
To compile it into a static library. The compiling environment of VC is needless to say. Let's look at how to build the compiling environment of gcc.
Makefile has to be written by myself. My cygwin does not have the Makefile auxiliary tool. Run cygwin.
3. Shadow directory
First, mount the win32 Directory to the posix directory and run mount to check whether
The mount path. My ZCore path is: d: studyzcore. I want to film it into/zcore,
Command: "mount d:/study/zcore ". There is a warning, but no problem. Now
You can use the mount command to view more information. This information is stored in the registry.
[HKEY_CURRENT_USERSoftwareCygnus SolutionsCygwinmounts v2/zcore]
Run the "umount/zcore" command to uninstall the SDK ".
4. gcc Compilation
Use "cd/zcore/build/gcc" To Go To The compilation directory and make.
In this way, you can use gcc to compile code debugging with VC, and it will be much easier to transplant code to other environments in the future.
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