Linker Tools Warning LNK4098

http://msdn.microsoft.com/en-us/library/6wtdswk0.aspx

defaultlib 'library' conflicts with use of other libs; use /NODEFAULTLIB:library

You are trying to link with incompatible libraries.

Note Note

The run-time libraries now contain directives to prevent mixing different types. You will receive this warning if you try to use different types or debug and non-debug versions of the run-time library in the same program. For example, if you compiled one file to use one kind of run-time library and another file to use another kind (for example, single-threaded versus multithreaded) and tried to link them, you will get this warning. You should compile all source files to use the same run-time library. See the Use Run-Time Library (/MD/MT/LD) compiler options for more information.

You can use the linker's /VERBOSE:LIB switch to determine which libraries the linker is searching. If you receive LNK4098 and want to create an executable file that uses, for example, the single-threaded, non-debug run-time libraries, use the /VERBOSE:LIB option to find out which libraries the linker is searching. The linker should print LIBC.lib and not LIBCMT.lib, MSVCRT.lib, LIBCD.lib, LIBCMTD.lib, or MSVCRTD.lib as the libraries searched. You can tell the linker to ignore the incorrect run-time libraries by using /NODEFAULTLIB for each library you want to ignore.

The table below shows which libraries should be ignored depending on which run-time library you want to use.

To use this run-time library

Ignore these libraries

Single-threaded (libc.lib)

libcmt.lib, msvcrt.lib, libcd.lib, libcmtd.lib, msvcrtd.lib

Multithreaded (libcmt.lib)

libc.lib, msvcrt.lib, libcd.lib, libcmtd.lib, msvcrtd.lib

Multithreaded using DLL (msvcrt.lib)

libc.lib, libcmt.lib, libcd.lib, libcmtd.lib, msvcrtd.lib

Debug Single-threaded (libcd.lib)

libc.lib, libcmt.lib, msvcrt.lib, libcmtd.lib, msvcrtd.lib

Debug Multithreaded (libcmtd.lib)

libc.lib, libcmt.lib, msvcrt.lib, libcd.lib, msvcrtd.lib

Debug Multithreaded using DLL (msvcrtd.lib)

libc.lib, libcmt.lib, msvcrt.lib, libcd.lib, libcmtd.lib

For example, if you received this warning and you want to create an executable file that uses the non-debug, single-threaded version of the run-time libraries, you could use the following options with the linker:

/NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:libcd.lib /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:msvcrtd.lib



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
linker: Warning: "/system/lib/libavformat.so" unused DT entry: unknown (type 0x24 arg 0x11ae8) (ignoring) WARNING: linker: Warning: "/system/lib/libavformat.so" unused DT entry: unknown (type 0x24 arg 0x11ae8) (ignoring) linker: Warning: "/system/lib/libavformat.so" unused DT entry: unknown (type 0x23 arg 0xa80) (ignoring) WARNING: linker: Warning: "/system/lib/libavformat.so" unused DT entry: unknown (type 0x23 arg 0xa80) (ignoring) linker: Warning: "/system/lib/libavformat.so" unused DT entry: unknown (type 0x25 arg 0x4) (ignoring) WARNING: linker: Warning: "/system/lib/libavformat.so" unused DT entry: unknown (type 0x25 arg 0x4) (ignoring) linker: Warning: "/system/lib/libuapi_securec.so" unused DT entry: unknown (type 0x24 arg 0xc4c) (ignoring) WARNING: linker: Warning: "/system/lib/libuapi_securec.so" unused DT entry: unknown (type 0x24 arg 0xc4c) (ignoring) linker: Warning: "/system/lib/libuapi_securec.so" unused DT entry: unknown (type 0x23 arg 0x8) (ignoring) WARNING: linker: Warning: "/system/lib/libuapi_securec.so" unused DT entry: unknown (type 0x23 arg 0x8) (ignoring) linker: Warning: "/system/lib/libuapi_securec.so" unused DT entry: unknown (type 0x25 arg 0x4) (ignoring) WARNING: linker: Warning: "/system/lib/libuapi_securec.so" unused DT entry: unknown (type 0x25 arg 0x4) (ignoring) CANNOT LINK EXECUTABLE "./mytest2": cannot locate symbol "av_timecode_make_smpte_tc_string2" referenced by "/system/lib/libavformat.so"... linker: CANNOT LINK EXECUTABLE "./mytest2": cannot locate symbol "av_timecode_make_smpte_tc_string2" referenced by "/system/lib/libavformat.so"...
最新发布
06-03
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值