今天第一次尝试写一个单元测试,用的vs2013自动生成的测试工程,在最后build的时候出现了这个错误。
看起来是在说我的被测试单元的obj不能在预编译的时候link。在网上找了一些解决办法,有的说是vs出错了,重新build一下就好(这个最扯的);有的说是exe调用的库之间的依
赖关系不对,要调整包含顺序,但是我这里一个dll调用另一个obj,不存在这种问题啊。
后来在msdn查到了关于这个错误的解释:
https://msdn.microsoft.com/en-us/library/3ay26wa2(v=vs.110).aspx
precompiled object not linked in; image may not run
If you use precompiled headers, LINK requires that all of the object files created with precompiled headers must be linked in. If you have a source file that you use to generate a precompiled header for use with other source files, you now must include the object file created along with the precompiled h