zoukankan      html  css  js  c++  java
  • 如何只利用NMAKE+CL+LINK写WIN32程序

    关键是
    1.包含<Windows.h>及其他的相关头文件
    2.在LINK指令中最起码要加上KERNEL32.LIB USER32.LIB GDI32.LIB(不需要制定其路径,因为NMAKE, CL和LINK都来自VS,这3个LIB文件都是默认配置好的),这三个LIB文件包含了所需的其他DLL的信息。当然,不止这三个,但这三个是最基本的,如果还需要其他的,建议可以打开VS创建一个WIN32 project,然后通过Project>Properties>Linker>Input (or Command line)查看还需要哪些其他的LIB文件

    补充说明:

    摘自下面demo的Makefile
    "For more libraries of WINAPI you can create a WIN32 application in VS and inspect the project's linker options.
    Select Project>Properties>Linker>Input (or Command line) so you can see all LIB files needed by a WIN32 applicatin.
    These 3 LIB files contain names and reference information of the dynamic-link libraries to be bound to the generated exe file."


    摘自Programming Windows 5th Edition, by Charles Petzold
    "As normal, during the compile stage, the compiler generates an .OBJ (object) file from the C source code file.
    During the link stage, the linker combines the .OBJ file with .LIB (library) files to create the .EXE (executable) file.
    You can see a list of these library files by selecting Settings from the Project tab and clicking the Link tab. In
    particular, you'll notice KERNEL32.LIB, USER32.LIB, and GDI32.LIB. These are "import libraries" for the three
    major Windows subsystems. They contain the dynamic-link library names and reference information that is bound
    into the .EXE file. Windows uses this information to resolve calls from the program to functions in the
    KERNEL32.DLL, USER32.DLL, and GDI32.DLL dynamic-link libraries"

    这是一个HELLO WORLD的WIN32 DEMO,点击下载

  • 相关阅读:
    将excel中的sheet1导入到sqlserver中
    .net中 Timer定时器
    Exception异常处理机制
    算法
    八、上网行为管理
    获取网站路径绝对路径的方法汇总
    Window逆向基础之逆向工程介绍
    Java Web代码审计流程与漏洞函数
    创建一个Java Web项目,获取POST数据并显示
    七、虚拟专用网
  • 原文地址:https://www.cnblogs.com/qrlozte/p/4381885.html
Copyright © 2011-2022 走看看