Modify compiler options to convert DLL and Windows Projects

Source: Internet
Author: User
Image:
 


Image:
 

Modify the compiler option to convert a DLL project to a Windows project.



Sometimes the compilation type of the project needs to be converted.


For example, compile a Windows program into a DLL or compile a DLL project into a console for convenience of debugging.


In the open-source project gh0st of codediyer by cloud, the debugging version is the console release piece and the DLL



Haha, this is mainly for vc6, but it is not very different from the vs series.


If it is Delphi or another IDE compiler, it may be different. I have never used it and I do not know it.






1. Differences between projectoptions in link options


The option after/nologo is used to set the compilation subsystem type


DLL type:/DLL


Console is/subsystem: Console


Windows:/subsystem: Windows






2. In Preprocessor definitions of the (C/C ++) Compilation Option


DLL is


Win32, _ debug, _ WINDOWS, _ MBCS, _ usrdll, mydll_exports


Console is


Win32, _ debug, _ console, _ MBCS


Windwos is


Win32, _ debug, _ WINDOWS, _ MBCS





3. Key Points of DLL project Conversion


If the DLL is converted to Windows or console, you need to remove the export function from the DLL.




4. output file name and Path


You can specify the output file name and path in the output file name of link.


After the compilation type is modified, you can modify the file name here to switch the file name after compilation.





Based on the above three items, you can switch between Windows console and DLL files.



I just drew two images.

Related Article

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.