易语言编译报错提示:

LIBC.lib(crt0dat.obj) : error LNK2005: __cinit already defined in Libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: _exit already defined in Libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: __exit already defined in Libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: __cexit already defined in Libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: __c_exit already defined in Libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: __C_Exit_Done already defined in Libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: __C_Termination_Done already defined in Libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: __exitflag already defined in Libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: __wpgmptr already defined in Libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: __pgmptr already defined in Libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: ___winitenv already defined in Libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: __wenviron already defined in Libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: ___initenv already defined in Libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: __environ already defined in Libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: ___wargv already defined in Libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: ___argv already defined in Libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: ___argc already defined in Libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: __winminor already defined in Libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: __winmajor already defined in Libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: __winver already defined in Libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: __osver already defined in Libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: __umaskval already defined in Libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : warning LNK4006: __cinit already defined in Libcmt.lib(crt0dat.obj); second definition ignored
LIBC.lib(crt0dat.obj) : warning LNK4006: _exit already defined in Libcmt.lib(crt0dat.obj); second definition ignored
LIBC.lib(crt0dat.obj) : warning LNK4006: __exit already defined in Libcmt.lib(crt0dat.obj); second definition ignored
LIBC.lib(crt0dat.obj) : warning LNK4006: __cexit already defined in Libcmt.lib(crt0dat.obj); second definition ignored
LIBC.lib(crt0dat.obj) : warning LNK4006: __c_exit already defined in Libcmt.lib(crt0dat.obj); second definition ignored
LIBC.lib(crt0dat.obj) : warning LNK4006: __C_Exit_Done already defined in Libcmt.lib(crt0dat.obj); second definition ignored
LIBC.lib(crt0dat.obj) : warning LNK4006: __C_Termination_Done already defined in Libcmt.lib(crt0dat.obj); second definition ignored
LIBC.lib(crt0dat.obj) : warning LNK4006: __exitflag already defined in Libcmt.lib(crt0dat.obj); second definition ignored
LIBC.lib(crt0dat.obj) : warning LNK4006: __wpgmptr already defined in Libcmt.lib(crt0dat.obj); second definition ignored

查了一下,原因是:libc.lib 和 libcmt.lib有符号冲突,libcmt.lib已经包含了libc.lib的函数。

解决办法:修改易语言安装目录下的tools文件夹下的link.ini,尾部添加:

extra_args=/NODEFAULTLIB:LIBC.LIB

之后即可正常静态编译。

Related Posts: error LNK2005: __cinit already defined in Libcmt.lib(crt0dat.obj) 解决办法 :

avatar