• 如何只利用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,点击下载

  • 相关阅读:
    html的下拉框的几个基本使用方法
    中国大概能用的NTPserver地址
    index_ss hint 使用的运行计划变化对照
    sizeof,终极无惑(上)
    Android源代码学习之六——ActivityManager框架解析
    RelativeLayout经常使用属性介绍
    sharepoint 2013 个人网站公共母板页路径地址
    Binder机制1---Binder原理介绍
    Linux makefile 教程 很具体,且易懂
    虚拟短信
  • 原文地址:https://www.cnblogs.com/qrlozte/p/4381885.html
Copyright © 2020-2023  润新知