fatal error LNK _X

 1、fatal error LNK1295: '/OPT:NOREF' not compatible with '/LTCG:incremental' specification; link without '/LTCG:incremental'

  Properties -> General -> Whole Program Opt -> "No Whole Program Opt"

 

 

2、error LNK2019:unresolved external symbol __imp__fprintf referenced in function _ShowError 

  Properties -> Linker -> Input -> Additional Dependencies -> 添加 “legacy_stdio_definitions.lib;” 

//出现这个问题的原因是vs2015默认编译时将许多标准库采用内联方式处理,因而没有可以链接的标准库文件,所以要专门添加标准库文件来链接标准库中的函数。

 

 3、error LNK2019: unresolved external symbol __imp____iob_func referenced in function _ShowError

  在源文件中添加: extern "C" { FILE __iob_func[3] = { *stdin,*stdout,*stderr }; }

 

posted @ 2018-03-06 10:27  sev  阅读(541)  评论(0编辑  收藏  举报