[英]Unable to add Google Test NuGet package to a Visual Studio Linux C++ project
I have a Linux C++ project in Visual Studio 2017 which contains unit tests, and I'm trying to add the Google test framework to it. 我在Visual Studio 2017中有一个Linux C ++项目,其中包含单元测试,并且我正在尝试向其中添加Google测试框架。 I have added the gtest NuGEt package to the project, and in every file that uses this, I have a
#include "gtest/gtest.h"
. 我已经将gtest NuGEt软件包添加到了项目中,并且在使用该文件的每个文件中,我都有一个
#include "gtest/gtest.h"
。 This works fine in a Windows-based unit test project, but in the Linux C++ project (all else being equal as far as I can tell), the NuGet package doesn't seem to be able to work, and when I compile I get the following error : 这在基于Windows的单元测试项目中可以正常工作,但是在Linux C ++项目中(据我所知,其他所有条件都相同),NuGet软件包似乎无法工作,当我编译时,我得到了以下错误:
gtest/gtest.h: No such file or directory.
gtest / gtest.h:没有这样的文件或目录。
Does anyone know why this doesn't work? 有谁知道为什么这不起作用?
That's because VS Linux projects are compiled and executed on a connected Linux machine (see Tools / Options / Connection Manager). 这是因为VS Linux项目是在连接的Linux机器上编译和执行的(请参阅工具/选项/连接管理器)。 Which in your case does not have Gtest installed.
您的情况下没有安装Gtest。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.