0
我是trying to compile an open-source project。如何解決link.exe中的LNK4254警告?
步驟之一涉及到運行一個.mak
文件,該文件具有以下行:
kbddvp32.dll: kbddvp32.obj kbddvp.res
$(LINK32) -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 -opt:nowin98 -stack:0x40000,0x1000 -opt:ref,icf \
-release -out:[email protected] $**
...變爲:
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 -opt:nowin98 -stack:0x400
00,0x1000 -opt:ref,icf -release -out:kbddvp32.dll kbddvp32.obj kbddvp.res
...當執行時,會產生下列警告:
LINK : warning LNK4224: /OPT:NOWIN98 is no longer supported; ignored
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
我嘗試閱讀documentation for warning LNK4254,但我對link.exe知之甚少,無法理解如何解決它。
文件kbddvp.def
包含:
LIBRARY KBDDVP
EXPORTS
KbdLayerDescriptor @1
的.mak
文件鏈接到this page它似乎是基於關閉的,而且是-merge:
部分首先使用的原因。我意識到這個頁面說你可以使用MSKLC 1.4,但是它不支持我想實現的所有功能。
我該如何解決這些LNK4254警告,還是我可以放心地忽略它們?