共用方式為


連結器工具警告 LNK4078

找到多個具有不同屬性的「區段名稱」區段

LINK 找到兩個或多個具有相同名稱但不同屬性的區段。

這個警告可能是由匯入連結庫或導出舊版 LINK 或 LIB 所建立的檔案所造成。

重新建立檔案並重新連結。

範例

LNK4078也可能因為重大變更所造成:init_seg在 x86 上命名的區段是可擦寫的,現在為只讀。

下列範例會產生LNK4078。

// LNK4078.cpp
// compile with: /W1
// LNK4078 expected
#include <stdio.h>
#pragma warning(disable : 4075)
typedef void (__cdecl *PF)(void);
int cxpf = 0;   // number of destructors to call
PF pfx[200];   // pointers to destructors.

struct A { A() {} };

int myexit (PF pf) { return 0; }

#pragma section(".mine$a", read, write)
// try the following line instead
// #pragma section(".mine$a", read)
__declspec(allocate(".mine$a")) int ii = 1;

#pragma section(".mine$z", read, write)
// try the following line instead
// #pragma section(".mine$z", read)
__declspec(allocate(".mine$z")) int i = 1;

#pragma data_seg()
#pragma init_seg(".mine$m", myexit)
A bbbb;
A cccc;
int main() {}