简体   繁体   English

使用MinGW / Cygwin的NetBeans IDE 8中不正确的C ++自动完成

[英]Incorrect C++ Autocompletion in NetBeans IDE 8 using MinGW/Cygwin

I am using the following combination for C++ development: 我将以下组合用于C ++开发:

First of all: I am able to compile source code both with MinGW and with Cygwin. 首先:我能够使用MinGW和Cygwin编译源代码。 The problem I describe in this question is related to both environments (or NetBeans). 我在此问题中描述的问题与两种环境(或NetBeans)有关。

Depending on the C++ standard to use for the project (see screenshot), the autocompletion doesn't work correctly in NetBeans IDE. 根据项目使用的C ++标准(请参见屏幕截图),自动完成功能在NetBeans IDE中无法正常工作。 In addition the behaviour of the autocompletion isn't consistent between using MinGW and Cygwin. 另外,在使用MinGW和Cygwin之间,自动补全的行为不一致。

NetBeans IDE 8.0中的C ++标准

If using C++98 with MinGW Distro, the "new" language features of C++11 aren't auto-completed ( correct behaviour ): 如果将C ++ 98与MinGW Distro结合使用,则C ++ 11的“新”语言功能不会自动完成( 正确的行为 ):

NetBeans IDE 8.0中的C ++ 98自动完成

If using C++11 with MinGW Distro, the "new" language features of C++11 are auto-completed, but std::vector (maybe some others too) isn't fully autocompleted ( incorrect behaviour ): 如果将C ++ 11与MinGW Distro一起使用,则C ++ 11的“新”语言功能会自动完成,但是std::vector (也许还有其他一些)不会完全自动完成( 错误的行为 ):

NetBeans IDE 8.0中的C ++ 11自动完成

If using Cygwin, I am unable to get autocompletion to work correctly with std::vector at all, regardless of the C++ standard choosen in the IDE. 如果使用Cygwin,则无论在IDE中选择了C ++标准如何,我都无法自动完成以完全使用std::vector正常工作。

Therefore I assume that the problem is maybe related to some missing or superflucios macro definitions in the NetBeans IDE configuration for each environment. 因此,我认为问题可能与每种环境的NetBeans IDE配置中的某些缺少的或多余的宏定义有关。

Again: I am able to compile the code, regardless of the auto completion errors. 再次:无论自动完成错误如何,我都可以编译代码。

  1. What can cause the problem described? 什么原因可以导致所描述的问题?
  2. Do you know a solution for the problem? 您知道该问题的解决方案吗?

I already asked a similar question here some time ago. 前段时间我已经在这里问过类似的问题。 The problems described there seem to be fixed in NetBeans IDE 8.0, since new C++11 features are detected properly. 由于可以正确检测到新的C ++ 11功能,因此其中描述的问题似乎已在NetBeans IDE 8.0中修复。

Update 1 has been released to NetBeans 8.0, which fixes many bugs according C++11 and it's code assistance. Update 1已发布到NetBeans 8.0,该版本根据C ++ 11及其代码帮助修复了许多错误。 You can see the fixed bugs here . 您可以在此处查看已修复的错误。 Please update and test again. 请更新并再次测试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM