This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 271224 - Code completion utterly fails for basic STL library std::string, std::map, etc. Identifier not found!
Summary: Code completion utterly fails for basic STL library std::string, std::map, et...
Status: RESOLVED WORKSFORME
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Completion (show other bugs)
Version: 8.2
Hardware: PC Linux
: P1 normal (vote)
Assignee: issues@cnd
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-02 23:19 UTC by unclefester
Modified: 2017-08-07 20:38 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Unable to resolve identifier string. (71.84 KB, image/png)
2017-08-02 23:19 UTC, unclefester
Details
C++ code assistance headers (39.62 KB, image/png)
2017-08-03 10:14 UTC, unclefester
Details

Note You need to log in before you can comment on or make changes to this bug.
Description unclefester 2017-08-02 23:19:59 UTC
Created attachment 164891 [details]
Unable to resolve identifier string.

1. Install NB 8.2 patch 2 with normal C++ plugins.
2. Create C++ app. Accept all defaults.
3. In main.cpp add simple std::string variable.

Problem: "Unable to resolve identifier string." 

Code assistance is broken for the simplest possible task.

See screenshot.

The sample app builds without error.
Comment 1 soldatov 2017-08-03 06:58:03 UTC
Which GCC version you are using? Which Linux you are using? Different GCC versions uses different C++ headers and default C++ standards.
Comment 2 unclefester 2017-08-03 10:14:43 UTC
Created attachment 164893 [details]
C++ code assistance headers
Comment 3 unclefester 2017-08-03 10:20:47 UTC
(In reply to soldatov from comment #1)
> Which GCC version you are using? Which Linux you are using? Different GCC
> versions uses different C++ headers and default C++ standards.

GCC 4.8. Same GCC with same headers work correctly under NB 7.4. See supplemental attachment.  Settings were imported directly from working NB 7.4 during installation.  No intervening changes were made to OS or compiler.

uname -a
Linux 4.4.0-87-generic #110~14.04.1-Ubuntu SMP Tue Jul 18 14:51:32 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 14.04.5 LTS
Release:	14.04
Codename:	trusty
Comment 4 soldatov 2017-08-03 12:30:25 UTC
You have invalid compiler settings. Why did you add /usr/include/... paths? Also I see absolutely empty 'Macro Definitions' table.

I think 'Restore Defaults' button will fix your compiler settings (Options > C/C++ > Build Tools tab)
Comment 5 unclefester 2017-08-03 14:56:09 UTC
You are correct. Setting the defines by the default button fixed the immediate problem with the std namespace. Removing the extra /usr includes fixed other problems in my projects.

As I said, these settings were copied from a working NB 7.4 instance and were somehow needed to get it working.  For 7.4 I recall that these settings were cribbed from a forum post when sensible settings did not work.

The default define button is very helpful.  Better still would be if NB could propose what it needed for sensible header file defaults for the C++ compiler.

Good work.  Thank you for your help.