【发布时间】:2018-09-25 15:13:59
【问题描述】:
我正在用 Vulkan 编写一个项目,它可以编译并运行良好。代码和往常一样,但是在一些软件更新(Steam、Visual Studio 等)之后,出现了一个错误。
我提到了蒸汽,因为它导致了一个单独的运行时错误。与此处相同的错误:https://www.reddit.com/r/vulkan/comments/8ybq6f/need_some_help_debugging/e29qptx/
不管怎样,行:
const std::vector<const char*> validationLayers = { "VK_LAYER_LUNARG_standard_validation" };
类似的使用std::vector 和std::array 给我错误:Ambiguous symbol 'const std::vector<const char*>'
我的包含和定义如下:
#define GLFW_INCLUDE_VULKAN
#define GLM_FORCE_RADIANS
#define STB_IMAGE_IMPLEMENTATION
#include <glfw3.h>
#include <glm.hpp>
#include <gtc/matrix_transform.hpp>
#include <stb/stb_image.h>
#include <iostream>
#include <stdexcept>
#include <functional>
#include <vector>
#include <set>
#include <algorithm>
#include <fstream>
#include <string>
#include <array>
#include <chrono>
#ifdef NDEBUG
const bool enableValidationLayers = false;
#else
const bool enableValidationLayers = true;
#endif
因此,如果有办法抑制这个特定的错误突出显示,或者如果存在真正的冲突,我很想知道它在哪里/如何做到这一点。
就像我说的,它仍然运行良好,但是看着我的滚动条并看到一堆红色标记,通常表明我的程序没有编译,这很烦人。
【问题讨论】:
-
你的意思是智能感知显示错误? Visual Studio 的哪个版本?
-
@AlanBirtles 是的,智能感知。我在 CE 2017, 15.8.5 我也刚刚发现当我将语言标准设置为 C++14 时我没有收到错误
-
intellisense 不是一个完整的编译器,总有一些边缘情况会失败,将其报告给微软并过滤掉 intellisense 错误,直到他们修复它stackoverflow.com/questions/14713391/…
-
对我来说还不清楚是什么问题。我没有看到
vulcan与该问题有关。此外,在Ambiguous symbol的情况下,至少应指出两个符号,以便清楚导致歧义的原因。 -
哦,看来问题出在 ReSharper 上,毕竟不是智能感知。还是谢谢你。