Use code: blocks to compile the VC Program (1)

Source: Internet
Author: User
Why keep the distance close? Since VC already exists, why should I use code: blocks? Microsoft's recent Internet access is an opportunity. For a long time, it began to feel uncomfortable to use piracy. as a result, RAR and zip are replaced with 7zip (recommended), word is replaced with open office, and Adobe Reader is replaced with Foxit (recommended ), IE is also replaced with chrome, although IE is free, right, when should I change to Linux? I don't know ...... after talking a lot of nonsense, start with the question. I have been using pirated vs for many years. I would like to extend my thanks again to mongogaiz. VS has many benefits, except for the care of the girl-in-law, as well as the rich plug-ins, and reliable compilation (the same program I use mingw-GCC is crashed and I am not satisfied with it ), fantastic Smart Tips. it's all about him, but it's getting slower and slower to start. It's often a zombie and a super head, but I can't say it. so code: blocks debut, the following 1000 words introduction code: blocks advantages, please google. I can only say one sentence: Code: blocks is free and open-source, with Fast startup speed, small block header, and many functions. the disadvantage is that intelligence is not enough. the configuration is complex (actually the advantage. how to use code: blocks to compile a VC program? 1. install the Windows SDK. For native C ++ development, you only need to download the Platform SDK, which is about MB. if you want. net (commonly known as CLR), it takes about 1000 MB to host code programming. for all the installation programs, go to: msdn --> Developer Center 2. installation code: blocks. 3. configuration code: blocks. to put it bluntly, the menu is settings -- compiler and debugger. I have installed vs9 (a bit tricky :). You can only install the SDK, which contains a compiler. Its location is generally in: "C:/program files/Microsoft sdks/Windows/v6.0a/bin" may be slightly different, but it is almost the same. See, set the folder where the compiler (rc.exe,link.exe,rc.exe) is located and set the system folder of the header file, such. h. for the position of this header file, see y of Dog Day. Upoo added a watermark to me, but I still want to thank him for his figure bed, dog day, thank you. (In fact, dogs are very loyal animals. Do not eat dog meat. Thank you. ad End Time) We can see the detailed settings. I don't need to say more. if you only install the SDK, your path is only the first line. you don't have to worry about installing the SDK as little as possible. this problem occurs only when a part of the SDK file is installed in your pocket. we know that in addition to the header file, there is also a link to the OBJ file which is the required system library file. For example, we need to call the: messageboxw function in our program. I remember it was in user32.dll, so we need to link user32.lib. now you know, we also need to set up common link libraries. see: You can see what ole32.lib and gdi32.lib are my personal preferences. If you don't need the functions in those libraries, you don't need to link them. next, you need to set the path of these library files. For details, see:. The path setting is very similar to that of the header file. If you only install the SDK, then your path is only the first line. don't worry Installing the SDK only requires a lot of things. this problem occurs only when a part of the SDK file is installed in your pocket. note that compiler, linker, and resource compilerare three tables. We have already set the following one, and the last one is to set it to rc.exe to compile your resource file (resource. RC), the position of the header file used, basically the first line of the RC file is: # include "resource. H "and resource. the first line of H is: # include <windows. h> generally, the path set is the same as that set the system header file, for example, "C:/program files/Microsoft sdks/Windows/v6.0a/include ". in other words, the famous button IDs such as idok and idcancel are all in windows. the. h header file is defined. after so many posts, we have come to an end. you can create a Windows GUI Program And then compiled. specifically, file --> New --> project and select Win32 GUI project. The following is similar to. at this point, some people may wonder that some projects require gdi32.lib and some projects require gdi32plus. lib, do I need to modify it in such a way every time? Of course, this is not required. The general settings are described above. for example, most Win32 programs require the GDI32 and Kernel32 libraries. You can add the default link options to these two libraries. In the future, each project will automatically connect to these two libraries. but how to configure a specific project? This won't stop pasting. in the management column on the left, select the project tab, right-click yourprojectname, select Properties from the menu, and click Project's build option in the pop-up window. You will be familiar with the following items, just remember that it only works for your current project. finally, this is (1). Have you noticed it? So there is (2 ). why? Because I have always compiled with makefile, the programmer's nature is: control everything. So stay tuned (2) ...... You want to use MFC? I hate MFC. Although I started from MFC, I think I will understand more from Win32. MFC instantly put me on a tall building, but in order to climb higher, I had to climb to the base building first and then climb again. MFC is only applicable to one professional. All he does is the core algorithm, which may be cross-platform. Therefore, he does not need to care about windows!

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.