c++ - Clion 警告 glm::dot returnType 但无论如何编译

标签 c++ opengl clion glm-math

GLfloat test = glm::dot(glm::vec3(1.0f,1.0f,1.0f),glm::vec3(1.0f,1.0f,1.0f));

这可以编译并正常工作,但 Clion-IDE 坚持认为存在错误。

Types 'GLfloat' and 'glm::highp_vec3' are not compatible.

我是否必须取消警告,或者是否有更优雅的方法来解决这个问题。

最佳答案

不幸的是,

CLion 选择实现自己的 C++ 解析器 ( using ANTLR ),它并不完美,尽管它正在变得更好。所以在编译器成功编译代码的情况下出现检查警告的原因是 CLion 解析器在某处出错。您的编译器是理解 C++ 的更好来源,因为……好吧,它是一个编译器。

要关闭检查警告,您可以执行以下操作之一:

Suppressing inspections in the editor

  1. Set the cursor to the highlighted code issue in the editor.
  2. Press Alt+Enter, or click the light bulb icon intentionBulb to expand the suggestion list.
  3. Depending on the issue, you will see either quick-fixes related to the inspection or the Inspection "" options item.
  4. Use the up/down arrow keys to select this item and then press the right arrow key or just click the right arrow rightArrowInMenu next to this item. Pressing the left arrow key, or Escape hides the suggestion list.
  5. In the inspection options list, select the desired suppress action: The inspection will be suppressed with special comments in the corresponding piece of code.

Suppressing inspections from the Inspection tool window

  1. After running code analysis, select a code issue, for which you want to suppress the inspection, in the Inspection tool window.
  2. Click hectorBack on the toolbar of the Inspection tool window, or just right-click the selected inspection.
  3. Choose the desired suppress action. For example: The inspection will be suppressed with special comments in the corresponding piece of code.

来源:https://www.jetbrains.com/help/clion/2016.1/suppressing-inspections.html

关于c++ - Clion 警告 glm::dot returnType 但无论如何编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37613842/

相关文章:

c++ - 什么是 undefined reference /未解析的外部符号错误,我该如何解决?

java - OpenGL LWJGL 可调整大小的纹理立方体

c++ - 改变RGBA颜色后OpenGL以16种颜色绘制

c - 为什么我的 OpenGL 代码不呈现方格纹理

c++ - 我如何克服这个错误 C2679 : binary '>>' : no operator found which takes a right-hand operand of type 'const char []'

java - 欧拉计划 N# 8 JAVA

c++ - 如何获取C++变量声明

C++ 程序在重新执行时加速

CLion - 回车?\r

c++ - CMake 无法正确地将 ultralight ui 库链接到 Clion 2019.1.2 中的可执行文件