错误:VS单元测试出现LNK2019错误

解决方法:

To link the tests to the object or library files

If the code under test doesn't export the functions that you want to test, you can add the output .obj or .lib file to the dependencies of the test project. Modify the test project's properties to include the headers and library or object files that are required for unit testing.

  1. In Solution Explorer, on the shortcut menu of the test project, choose Properties. The project properties window opens.

  2. Select the Configuration Properties > Linker > Input page, then select Additional Dependencies.

    Choose Edit, and add the names of the .obj or .lib files. Don't use the full path names.

  3. Select the Configuration Properties > Linker > General page, then select Additional Library Directories.

    Choose Edit, and add the directory path of the .obj or .lib files. The path is typically within the build folder of the project under test.

  4. Select the Configuration Properties > VC++ Directories page, then select Include Directories.

    Choose Edit, and then add the header directory of the project under test.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值