OpenSSL VS/VC project configuration and make

Source: Internet
Author: User

Many people know how OpenSSL is compiled on Windows. However, many people are eager to know how to compile OpenSSL by clicking the "generate" menu item in an IDE such as vs2005, click the green arrow above for debugging or one-step tracking. How easy it is to execute Perl on the command line... & MS/do_ms & nmke... it's much easier. Unfortunately, because vs IDE and command line makefile are not at the same level, it's not easy to do this, or even if you can do it, you must first use Perl... the nmake command series can be configured. If you don't need it, your workload will be heavy. First, I will analyze what needs to be done to configure the vs environment:
1. Prepare the header file and source file. This is not a simple task, because vs2005 compiles all files added to the project by default. For example, when compiling libeay32.dll, if you add files that do not need to be compiled, as a result, there will be a lot of inexplicable errors in the dependency relationship, and you will need to remove the files that should not be compiled one by one. In this process, if you remove the files that other files depend on, this will make your head bigger. The remaining 2nd steps will cause you to crash;
2. Configure the header file. This step is very important. Because most open-source code is cross-platform and developed based on traditional Unix systems, many codes provide configure programs. After you run it, the most important thing is done. It can generate a new header file based on the current platform, or define some macros based on the current platform, and then overwrite the old header file with the new header file, in fact, we can use the above Perl... after the do_ms script is completed, you can see how complicated the script is. Now you want to do it manually. If you really want to, try it.
After completing the above two steps, you can click "generate" and the green triangle, but do you think this is worth it? If you have done the above two steps manually,... try it. The premise of all the above is that you do not want to use the Perl .. do_ms command. If you are willing to use it, the workload may be simpler, but there are also some steps to do it:
1. Enter the OpenSSL root directory;
2. Run the Perl configure VC-WIN32;
3. Run MS/do_ms;
4. View ms/NTDLL. Mak;
5. Run all $ (CP) $ (src_d)/./xxx. h $ (incl_d)/xxx. H. You can write another script and execute it;
6. Create an empty vs2005 project. Note that it is best to delete all directories created by vs for you, which are of no use to you.
7. set all $ (CC)/fo $ (obj_d)/yyy. OBJ $ (app_cflags)-C $ (src_d)/dirdir/yyy. YYY in C. C is added to vs2005 project, of course, VC project can also be, in order to facilitate management, it is best to use "filter" for classification;
8. the key to configuring this project attribute is "'add include directory' in C/C ++". Otherwise, the header file cannot be found during compilation, in addition, it is based on whether you compile the DLL, OpenSSL, or apps, and whether the program configuration is compiled into a DLL or an EXE;
7. Generate it, and ensure that you are successful;
Conclusion: after reading the above steps, we found that IDE and make in vs2005 or VC are not in parallel, in fact, make has helped you solve the dependencies between the compilation process and the link process in the previous work, while vs or VC requires you to configure the dependencies yourself, in fact, vs does not want you to use ide To compile and open the source code. Generally, almost all Microsoft code is directly created one by one on the basis of, therefore, there is no problem of preparing source files. Another Microsoft does not want you to use vs to write code that can run on Linux, so you do not need to configure the source files, therefore, Microsoft IDE is convenient for programmers who only write applications on the Microsoft platform. However, for open-source code compilation, make should be honest and practical, if you are used to make, you will not get used to GDB. Make is not at the same level as Microsoft's Ide. Configure and make solve the dependency, while Microsoft's graphic ide only aims to better compile and debug the code on its own platform. Even so, microsoft also provides command line programs.

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.