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 185009 - include errors for Qt Project, although it builds and runs
Summary: include errors for Qt Project, although it builds and runs
Status: RESOLVED INCOMPLETE
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 6.x
Hardware: All All
: P2 normal (vote)
Assignee: Vladimir Voskresensky
URL:
Keywords:
: 175983 184388 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-04-26 14:12 UTC by simpatico
Modified: 2010-06-07 16:07 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
code showing bug (818.88 KB, application/zip)
2010-05-06 16:15 UTC, simpatico
Details
code showing bug (623.44 KB, application/zip)
2010-05-06 16:16 UTC, simpatico
Details
configured project (43.01 KB, application/zip)
2010-05-07 12:01 UTC, Vladimir Voskresensky
Details
solves issue between semantic HL caches and parsing worker (17.06 KB, patch)
2010-05-19 11:41 UTC, Vladimir Voskresensky
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description simpatico 2010-04-26 14:12:04 UTC
I've the following declaration:
    void errorReceived(QAbstractSocket::SocketError socketError);
The error for QAbstractSocket is "unable to resolve identifier QAbstractSocket".

Although I've the include: #include <QtNetwork/QAbstractSocket>


Also, when I click on code assistance -> reparse ...,  the line #include <QtCore/QString> for instance reads: there are unresolved includes inside <QtCore/QString>, for extra  info hold, ...", which doesn't make sense, to me, at all! Holding doesn't present extra info.
If I reparse again these disappear. If I hit enter on a line in the doc, error becomes "cannot find include file <QtCore/QString>"!

The qt modules core, network, and gui are selected for the project.

How do you solve these include issues too?

I can reproduce this incorrect error highlighting after "Reparse
Project" even on Linux. Could you please file a bug? We'll fix it.
Comment 1 Alexey Vladykin 2010-04-26 14:25:02 UTC
Vladimir, could you please evaluate?
Comment 2 Vladimir Voskresensky 2010-04-27 12:34:18 UTC
what is the nb version?
what is your OS?
can you make a snapshot what is shown in tooltip over failed include directive (press Ctrl+hover line)
Comment 3 Alexey Vladykin 2010-04-27 14:30:10 UTC
We (me and Vladimir) reproduced this behavior once again. "Reparse Project" action sometimes leads to unresolved identifiers, unresolved includes, missing navigator and incomplete classes view showing one file instead of whole project.

We tracked this down to standalone files support. During reparse the file opened in editor migrates to an artificial standalone file project. This is the reason for unstable code assistance problems.

Starting NetBeans with standalone file support turned off (-J-Dcnd.disable.standalone.files=true) resolved all the mentioned code assistance problems. Unfortunately the cnd.disable.standalone.files handling was incorrect and didn't actually turn off standalone files. I fixed this in http://hg.netbeans.org/cnd-main/rev/b3f50885f6e9
Comment 4 Vladimir Voskresensky 2010-04-28 10:47:05 UTC
Will try to fix standalone file provider based issues
Comment 5 Leonid Lenyashin 2010-04-28 10:56:36 UTC
Is it a justification for upgrading priority? Please state the reason in a clearer way.
Comment 6 Vladimir Voskresensky 2010-04-28 14:25:56 UTC
*** Bug 184388 has been marked as a duplicate of this bug. ***
Comment 7 Vladimir Voskresensky 2010-04-28 15:23:44 UTC
(In reply to comment #5)
> Is it a justification for upgrading priority? Please state the reason in a
> clearer way.
User visible issue which sometimes needs reparse of the project (can be time consuming).
Comment 8 Vladimir Voskresensky 2010-04-28 15:36:55 UTC
*** Bug 175983 has been marked as a duplicate of this bug. ***
Comment 9 Quality Engineering 2010-05-01 05:19:17 UTC
Integrated into 'main-golden', will be available in build *201005010200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/
User: 
Log:
Comment 10 Vladimir Voskresensky 2010-05-03 12:30:07 UTC
we (me and Alexander) made a lot of improvements in handling standalone files and their life cycle. Now issues is fixed.
Comment 11 simpatico 2010-05-06 16:15:44 UTC
Created attachment 98578 [details]
code showing bug
Comment 12 simpatico 2010-05-06 16:16:26 UTC
Created attachment 98579 [details]
code showing bug
Comment 13 Vladimir Voskresensky 2010-05-06 20:37:58 UTC
from private letter:
-----------
Still issues.

I've attached 2 Qt NB projects that compile and run under Qt Creator. In NB i've the same issue as before. The new thing is that findfiles includes QXT, but which is correctly configured, as Qt creator and the nb compiler show:

"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE=/usr/bin/qmake SUBPROJECTS= .build-conf
/usr/bin/qmake VPATH=. -spec macx-g++ -o qttmp-Debug.mk nbproject/qt-Debug.pro
mv -f qttmp-Debug.mk nbproject/qt-Debug.mk
"/usr/bin/make" -f nbproject/qt-Debug.mk dist/Debug/GNU-MacOSX/findfiles
g++ -c -pipe -g -gdwarf-2 -arch i386 -Wall -W -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Qt4.6/mkspecs/macx-g++ -Inbproject -I/Library/Frameworks/QtCore.framework/Versions/4/Headers -I/usr/include/QtCore -I/Library/Frameworks/QtNetwork.framework/Versions/4/Headers -I/usr/include/QtNetwork -I/Library/Frameworks/QtGui.framework/Versions/4/Headers -I/usr/include/QtGui -I/Library/Frameworks/QtWebKit.framework/Versions/4/Headers -I/usr/include/QtWebKit -I/usr/include -I/usr/local/Qxt/include/QxtCore -I/usr/local/Qxt/include/QxtGui -I. -Inbproject -I. -F/Library/Frameworks -o build/Debug/GNU-MacOSX/main.o main.cpp
In file included from main.cpp:2:
controller.h:3:36: error: QxtGui/QxtGlobalShortcut: No such file or directory
In file included from main.cpp:2:
controller.h:14: error: ISO C++ forbids declaration of ‘QxtGlobalShortcut’ with no type
controller.h:14: error: expected ‘;’ before ‘*’ token
controller.h:15: error: ISO C++ forbids declaration of ‘QxtGlobalShortcut’ with no type
controller.h:15: error: expected ‘;’ before ‘*’ token
make[2]: *** [build/Debug/GNU-MacOSX/main.o] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2

BUILD FAILED (exit value 2, total time: 1s)

The other project cannot find string in SqlException.h
------------------
Comment 14 Vladimir Voskresensky 2010-05-07 10:34:12 UTC
(In reply to comment #12)
> Created an attachment (id=98579) [details]
> code showing bug

this attachment is irrelevant to this bug.QXT based project is incorrectly compiled, because you have specified incorrect include paths and does not specify frameworks to compiler. Qt Creator can append automatically missed paths and libs, because it knows where they are located (they are tightly connected)
Comment 15 Vladimir Voskresensky 2010-05-07 10:34:43 UTC
(In reply to comment #11)
> Created an attachment (id=98578) [details]
> code showing bug

I will check on Mac this attached project to see what's wrong
Comment 16 Vladimir Voskresensky 2010-05-07 11:54:06 UTC
I have checked your project "Shared" and made one fix. After that to configure project all what is needed:
- remove Makefile
- open IDE
- choose "Shared" folder in Automatic mode in New Project -> Project From Existing Code 
=> all is configured && built && code assistance is configured correctly as well

(I have removed Makefile, because it has priority, when I removed it => *.pro file was detected as input for qmake and all is done correctly)
In your case (without fix) you can do:
- instead of Advanced use Custom mode and select configure based instead of Make based build
- after finishing run Clean && Build for project

http://hg.netbeans.org/cnd-main?cmd=changeset;node=5b89be2cd404
Comment 17 Vladimir Voskresensky 2010-05-07 12:01:07 UTC
Created attachment 98618 [details]
configured project
Comment 18 Vladimir Voskresensky 2010-05-07 12:12:41 UTC
I have filed issue #185689 to ask automatic mode choose qmake as the first choice
Comment 19 Quality Engineering 2010-05-10 09:12:43 UTC
Integrated into 'main-golden', will be available in build *201005100200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/
User: 
Log:
Comment 20 simpatico 2010-05-10 12:25:05 UTC
I was given this version that solved this bug:

Product Version: NetBeans IDE Dev (Build cnd-main-3460-on-100504)
Java: 1.6.0_19; Java HotSpot(TM) 64-Bit Server VM 16.2-b04-271
System: Mac OS X version 10.6.3 running on x86_64; MacRoman; de_DE (nb)
Userdir: /var/tmp/cleandir

Any changes?

Also, is this the link?

http://bits.netbeans.org/dev/nightly/latest/zip/netbeans-trunk-nightly-201005100200-src.zip
Comment 21 simpatico 2010-05-13 18:47:16 UTC
I don't understand how is this fixed. Even the hello Qt project from the samples shows parsing errors, let alone the project SS I had sent. 

Maybe if I do X and Y that will solve the issue. But why is this needed? A reparse of the project, clean and build, should be enough is not it?

My eclipse team mates are not having any issues.
Comment 22 Vladimir Voskresensky 2010-05-13 21:50:34 UTC
The problem is that we can not reproduce your issue. In all available computers with Qt installed sample works fine.

Can you attach screenshots of "sample" project with errors?
If you have failed #include <file> directives, please, provide screenshot when your hold Ctrl button and move mouse over <file> (there should be popup with analyzed paths)
Comment 23 Vladimir Voskresensky 2010-05-14 09:29:11 UTC
I can not anything without requested info from user
Comment 24 Vladimir Voskresensky 2010-05-18 07:30:20 UTC
Probably we have reproduced this issue (not parsed <list> file in Quote) which can be the reason of lost code model info for Qt as well

Alexander will try to figure out why we have lost parsing of file
Comment 25 Quality Engineering 2010-05-19 06:06:39 UTC
Integrated into 'main-golden', will be available in build *201005182201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/
User: 
Log:
Comment 26 Vladimir Voskresensky 2010-05-19 07:37:06 UTC
will work further on it
Comment 27 Vladimir Voskresensky 2010-05-19 11:39:33 UTC
I have proof of concept fix for the following problem:
- when project is not completely parsed and 
- user opens file in which semantic HL is shown => some caches are filled up
- after that parsing worker return early in ProjectBase.onFileIncluded without forcing parse activity
Comment 28 Vladimir Voskresensky 2010-05-19 11:41:15 UTC
Created attachment 99192 [details]
solves issue between semantic HL caches and parsing worker

patch to record the idea. If we'd like to integrate fix => patch should be improved (needs some refactorings with move classes from modelimpl to apt)
Comment 29 Alexander Pepin 2010-05-20 11:15:08 UTC
Starting showstopper process
Comment 30 Alexander Simon 2010-05-24 12:53:45 UTC
change set in cnd-main:
http://hg.netbeans.org/cnd-main/rev/8f2445127086
Comment 31 Alexander Simon 2010-05-24 13:27:43 UTC
The change set
http://hg.netbeans.org/cnd-main/rev/8f2445127086
is a refactoring that introduces a new wrapper for APTMacroMap.State -> PostIncludeData.
Change set does not introduce new behavior and does not have side effects (except creating new object).
Change set will be used as a base of extending PostIncludeData for new cached data.
So change set is safe and right.
Comment 32 Vladimir Voskresensky 2010-05-24 17:11:33 UTC
fixed in cnd-main
http://hg.netbeans.org/cnd-main/rev/872c663b8df5
Comment 33 Alexander Simon 2010-05-24 17:39:55 UTC
Fix reviewed. It safe and fixes issue.
Comment 34 Alexander Pepin 2010-05-24 17:57:17 UTC
verified in rc1 with provided dev jar files. Please push the fix into release69 clone.
Comment 35 Vladimir Voskresensky 2010-05-24 18:04:40 UTC
integrated in release69:

http://hg.netbeans.org/release69/rev/7a1d4636cab5
http://hg.netbeans.org/release69/rev/88fb3b510f0e
Comment 36 Quality Engineering 2010-05-25 07:30:42 UTC
Integrated into 'main-golden', will be available in build *201005250001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/8f2445127086
User: Vladimir Voskresensky <vv159170@netbeans.org>
Log: refactoring for #185009: include errors for Qt Project, although it builds and runs
-- encapsulate post include macro state into PostIncludeData
Comment 37 Alexander Pepin 2010-05-25 12:50:13 UTC
verified in rc1 (20100524) build.
Comment 38 simpatico 2010-06-07 09:30:03 UTC
Longiging to tell you that it never worked for me, on my mac. Try to just create a new qt project and look at the main.c file to see exec in return app.exec(); underlined in red reading 'unable to resolve identifier exec'. If you run it, it works.
Comment 39 Vladimir Voskresensky 2010-06-07 15:15:16 UTC
Unfortunately we can not reproduce this issue on our available Mac PCs.
What I see when create sample project is:
- form.show is unresolved, but this is due to absence of file which is generated during build
- app.exec() is resolved

Btw, what is displayed when you call completion after app.| ?
Comment 40 simpatico 2010-06-07 15:35:10 UTC
http://screencast.com/t/MmVkMTQ3

Screencast of how to reproduce. Very simple. You are using a different test case.

I hope it helps.
Comment 41 Vladimir Voskresensky 2010-06-07 16:07:16 UTC
This is great :-)
Thanks for the help, but it does not help yet :-(
Can you continue with screencast and do the following:
- call code completion after app.
- hold ctrl+alt and hover mouse over #include directive to see tooltip
- ctrl click on QApplication to go to declaration of class

Thanks,
Vladimir