2006-08-16

warning LINK 4098

1. 如警告訊息所提示的,於 Linker 的 Command Line 中,加入 /NODEFAULTLIB:LIBC ,即可將警告訊息關掉。
根據 MSDN 上之說法 ,吾人可以把 /VERBOSE:LIB 加入 Linker 的 Command Line 中,如此可以知道, Linker 到底搜尋了哪些 libaries ,把不要的 library 利用 /NODEFAULTLIB:library 關掉,可以讓 Linker 不要產生這個警告。

NODEFAULTLIB:msvcrt.lib NODEFAULTLIB:libcmtd.lib NODEFAULTLIB:msvcrtd.lib 。

此解決方案可說是一種鴕鳥心態的作法,因為我們只知道如何將警告訊息關掉,並不知道產生此訊息的真正原因為何?

2.重新檢視專案中指定使用的 library ,是否有混用的情形。
Linker 不允許將 debug 與 non-debug 版本混用,同時它亦不允許將 single-threaded 與 multithreaded 版本混用。

以 shortie 的例子,發生問題的專案,於 debug configuration 中使用了 CUnit 的 release 版本之 library ,這就是問題的所在。

shortie 只要重新編譯 CUnit ,令其產生 debug 版本的 library ,再使用於發生問題的專案, Linker 不需要加入任何 /NODEFAULTLIB 的選項,就不會產生這個警告訊息。

copy fromCine


+++++++++++++++++++++++++

#Question:

I get these link errors when linking with the Chilkat VC++ library:

LINK : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification


#Answer:

There's a README.html file included with the distribution, which tells what additional Microsoft libraries need to be linked in. You should add these:

wininet.lib, rpcrt4.lib, crypt32.lib, ws2_32.lib

to your list of libs in your VC++ linker options.


copy from chilkasoft

No comments:

Post a Comment