开始静态链接…
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)
: fatal error LNK1169: one or more multiply defined symbols found
静态连接失败
引用借用了别人的代码
引用的代码能静态编译
自己的的代码也没问题
但是加起来就出现这个问题了
论坛的也搜索过了
帖子说, 首先修改tools.ini的配置把show_command_line=yes和retain_intermediate_files=yes打开,然后再进行编译,编译之后把编译输出的 命令部分提取出来
无效
解决方法
extra_args=/NODEFAULTLIB:"LIBC.lib"
完美解决