简体   繁体   English

无法将Google Test NuGet程序包添加到Visual Studio Linux C ++项目

[英]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.

相关问题 如何在Visual Studio 2013中的C ++项目中编译和链接谷歌测试,但是NuGet包管理器安装了Gtest? - How to compile and link google tests in C++ project in Visual Studio 2013 but with Gtest installed by NuGet Package Manager? Visual Studio C++:带有谷歌测试的单元测试 exe 项目? - Visual Studio C++: Unit test exe project with google test? 将GNU / Linux C ++包导入Windows上的Visual Studio - Importing a GNU/Linux C++ package into Visual Studio on Windows 为 Visual C++ 创建 nuget 包 - Create a nuget package for Visual C++ 最简单的方法是“移植”Visual Studio C ++项目以在Linux上编译? - Easiest way to “port” a Visual Studio C++ project to compile on Linux? 如何在Linux上有效地编译Visual Studio C ++项目 - How to compile a visual studio c++ project on linux efficiently Visual Studio C++ 项目为Linux,如何运行.out文件? - Visual Studio C++ Project for Linux, how to run .out file? 将 Visual Studio C++ 项目迁移到 Linux 和 CMake - Migrating a Visual Studio C++ Project to Linux and CMake 从 Visual Studio 解决方案和项目(不是 cmake)中的非托管 (C++/C) 代码创建 Nuget 包 - Create Nuget package from unmanaged (C++/C) code in Visual Studio Solution and projects (not cmake) Visual Studio C ++和Linux - Visual Studio C++ and Linux
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM