Sen*_*ful 11 c linker open-source driver wdk
我正在尝试编译开源项目Programmer Dvorak.问题是它有点旧,并且不使用当前版本的构建工具构建.
您可以在我项目的Google代码页上看到我在线修改的完整源代码.版本2是原始项目中未修改的源文件.修订版3是我做出所有重大更改的地方.您可以在此处看到两个修订版之间的差异.
剩下的唯一明显问题是一些LINK警告:
section '.edata' (40000040) merged into '.data' (C0000040) with different attributes.) - 我在这里问了一个独立版本的问题..CRT section exists; there may be unhandled static initializers or terminators)我该如何修复这些警告?我可以忽略它们吗?
尽管有这些警告,它仍然会产生一个exe.但是,如果我继续运行它,它将无法正确安装,我需要求助于系统还原才能再次安装正式版本.
这可能是因为警告或仅仅是因为我没有正确修改项目.
我还需要做些什么来使这个项目可以安装?
它说您需要Windows DDK,但似乎Windows驱动程序工具包已经取代它,所以我得到了它.我只安装了"Build Environments".
Readme.txt,你应该运行:build-layout && build-installer
Run Code Online (Sandbox Code Playgroud)
build-layout.bat运行.我不得不修改这个文件(参见这里的差异):
WinDDK路径被修改,因为我有一个较新的版本(MOD-1).set PATH=... %WINDDK%\bin\x86\x86;因为link.exe位于那里(MOD-2)而被添加.set INCLUDE=,%WINDDK%\inc\wxp改为%WINDDK%\inc\api,因为该wxp文件夹不存在,我最好的猜测是该api文件夹是必需的,因为它包含kbd.h,kbddvp.c使用(MOD-3).set LIB=,%WINDDK%\lib\crt被修改为%WINDDK%\lib\crt\i386,所以libcmt.lib可以找到.见下面的MOD-7.(MOD-4)fkbddvp.mak运行.我不得不修改这个文件(参见这里的差异):
CL32从更改$(WINDDK)\bin\x86\cl.exe为$(WINDDK)\bin\x86\x86\cl.exe,第一个.exe不存在,我相信这是我应该使用的.exe.(MOD-5)CL64从更改$(WINDDK)\bin\win64\x86\amd64\cl.exe为$(WINDDK)\bin\x86\amd64\cl.exe,这是我最好的猜测,丢失.exe的位置.(MOD-6)-opt:nowin98按照Bobby的建议删除警告LNK4224(即/OPT:NOWIN98 is no longer supported).(MOD-10)libc.lib我正在使用而不是使用不存在的libcmt.lib.我读过这篇文章建议使用这个文件.(MOD-7)cabarc,我使用的是makecab带makecab-dir.ddf.我把我最好的猜测是如何与这个新工具执行相同的逻辑.(MOD-8)build-installer.bat运行.我不得不修改这个文件(参见这里的差异):
cabarc和我修改它使用makcab,类似于MOD-8,除了在这里它创建.matic文件的.ddf文件.(MOD-9)如果你想看到它,这是完整的输出:
>build-layout && build-installer
"C:\WinDDK\7600.16385.1\bin\x86\x86\cl.exe" -nologo -c -I..\inc -Zp8 -Gy
-W3 -WX -Gz -Gm- -EHs-c- -GR- -GF -Zl -Oxs -D_WIN32_WINNT=0x0501 -Fokbddvp32.o
bj kbddvp.c
kbddvp.c
rc kbddvp.rc
Microsoft (R) Windows (R) Resource Compiler Version 6.1.6908.0
Copyright (C) Microsoft Corporation. All rights reserved.
link -machine:ix86 -nologo -dll -base:0x5FFF0000 -subsystem:native -def:
kbddvp.def -noentry -merge:.edata=.data -merge:.rdata=.data -merge:.text=.data
-merge:.bss=.data -ignore:4078,4070 -section:.data,re -stack:0x40000,0x1000 -op
t:ref,icf -release -out:kbddvp32.dll kbddvp32.obj kbddvp.res
Creating library kbddvp32.lib and object kbddvp32.exp
LINK : warning LNK4254: section '.edata' (40000040) merged into '.data' (C000004
0) with different attributes
LINK : warning LNK4254: section '.rdata' (40000040) merged into '.data' (C000004
0) with different attributes
LINK : warning LNK4254: section '.text' (60000020) merged into '.data' (C0000040
) with different attributes
LINK : warning LNK4254: section '.bss' (C0000080) merged into '.data' (C0000040)
with different attributes
"C:\WinDDK\7600.16385.1\bin\x86\amd64\cl.exe" -nologo -c -I..\inc -Zp8 -
Gy -W3 -WX -Gz -Gm- -EHs-c- -GR- -GF -Zl -Oxs -DBUILD_WOW6432 -D_WIN32_WINNT=0x
0501 -Fokbddvp64.obj kbddvp.c
kbddvp.c
link -machine:amd64 -nologo -dll -base:0x5FFE0000 -subsystem:native -def
:kbddvp.def -noentry -merge:.edata=.data -merge:.rdata=.data -merge:.text=.data
-merge:.bss=.data -ignore:4078,4070 -section:.data,re -stack:0x40000,0x1000 -o
pt:ref,icf -release -out:kbddvp64.dll kbddvp64.obj kbddvp.res
Creating library kbddvp64.lib and object kbddvp64.exp
LINK : warning LNK4254: section '.edata' (40000040) merged into '.data' (C000004
0) with different attributes
LINK : warning LNK4254: section '.rdata' (40000040) merged into '.data' (C000004
0) with different attributes
LINK : warning LNK4254: section '.text' (60000020) merged into '.data' (C0000040
) with different attributes
LINK : warning LNK4254: section '.bss' (C0000080) merged into '.data' (C0000040)
with different attributes
"C:\WinDDK\7600.16385.1\bin\x86\x86\cl.exe" -nologo -c -Folauncher.obj l
auncher.c
launcher.c
link -machine:ix86 -nologo -subsystem:windows -release -nodefaultlib -ou
t:launcher.exe launcher.obj kernel32.lib libcmt.lib user32.lib shell32.lib
libcmt.lib(cpu_disp.obj) : warning LNK4210: .CRT section exists; there may be un
handled static initializers or terminators
makecab /F makecab-dir.ddf
Microsoft (R) Cabinet Maker - Version 5.1.2600.5512
Copyright (c) Microsoft Corporation. All rights reserved..
27,686 bytes in 4 files
Total files: 4
Bytes before: 27,686
Bytes after: 8,140
After/Before: 29.40% compression
Time: 0.19 seconds ( 0 hr 0 min 0.19 sec)
Throughput: 144.58 Kb/second
iexpress /N /Q /M kbddvp.sed
1 file(s) copied.
Microsoft (R) Cabinet Maker - Version 5.1.2600.5512
Copyright (c) Microsoft Corporation. All rights reserved..
60,290 bytes in 16 files
Total files: 16
Bytes before: 60,290
Bytes after: 16,876
After/Before: 27.99% compression
Time: 0.27 seconds ( 0 hr 0 min 0.27 sec)
Throughput: 221.34 Kb/second
Run Code Online (Sandbox Code Playgroud)
小智 1
AMD64?我认为这就是问题所在。
也许问题只是您同时使用 32 或 64 ISA 的文件的问题。
喜欢:
kbddvp32.dll kbddvp64.dll
尝试使用适合您的平台 ISA 的那些,然后删除其余的。
| 归档时间: |
|
| 查看次数: |
1723 次 |
| 最近记录: |