gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-30 02:31:30 24 4
gpt4 key购买 nike

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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com