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.
Summary: | [newcodemodel] False 'cannot find include file' and related 'unable to resolve indentifier' | ||
---|---|---|---|
Product: | cnd | Reporter: | InfoGeek |
Component: | Code Model | Assignee: | Vladimir Voskresensky <vv159170> |
Status: | STARTED --- | ||
Severity: | normal | CC: | AE56, InfoGeek |
Priority: | P3 | Keywords: | NO82 |
Version: | 8.2 | ||
Hardware: | PC | ||
OS: | Linux | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: |
C/C++ Diagnostics log
Main file where include directory is marked as error. Full test case for the errors Test project using the Full test case. Expected test results/errors IDE "Help->About" Dialog Log after removing entire "/root/.netbeans" directory and loading MyApp project. Launched IDE with cleaned user dir and /root/tmp as ".tmpdir=" parameter |
Description
InfoGeek
2016-11-23 23:19:37 UTC
Could you, please, rename your "My Library" folder to something without space in path? I.e. "My_Library" project? and then change #include "My Library/files/SuperFile.h" to #include "My_Library/files/SuperFile.h" (In reply to Vladimir Voskresensky from comment #1) > Could you, please, rename your "My Library" folder to something without > space in path? I.e. "My_Library" project? It is not recommended to use paths with spaces for #include directives (In reply to Vladimir Voskresensky from comment #2) > (In reply to Vladimir Voskresensky from comment #1) > > Could you, please, rename your "My Library" folder to something without > > space in path? I.e. "My_Library" project? > It is not recommended to use paths with spaces for #include directives I am sorry, I forgot to mention that my library is actually: Project - "/root/MNT_Programming_C++_Linux/My Library" , but it points to all headers from: "/root/MNT_Programming_C++_Linux/My" so there's no space at the point of include paths(there would be with library paths, because binaries are created in the project but I am not even doing this step as it is irrelevant to include paths). So I am actually doing: #include "My/files/SuperFile.h" in the code, many apologies for the disinformation (I would edit the first post but I don't see an option to). Could you, please, open the file where you have unresolved directive, then (when cursor is in file) press Ctrl+Alt+Shift+M and select "Preprocessor States", then OK. In the Output you will see some logging. Please, attach log file (mentioned in the first line of log) here. Thanks, Vladimir. Created attachment 163023 [details]
C/C++ Diagnostics log
Created attachment 163024 [details]
Main file where include directory is marked as error.
could you, please, provide output in shell #ls /root/MNT_Programming_C++_Linux Output of ls on it is as expected: --------OUTPUT START-------------- My My Library --------OUTPUT END-------------- Those are two directories: "My" containing the include files. "My Library" project to build the library(pointing to My... interestingly enough all includes included in a similar fashion "My/something/someFile.h" for the library project also are not marked as errors and work well). Partially disregard my last comment about library files not marking as errors includes of header files... because they don't refer to the full paths such as "My/something/someFile.h" but all of them include just "someFile.h" and each include path is added per each respective file in project includes, such as "My/something/" for "someFile.h". Sorry, I'm probably polluting the debug process more than helping. could you, please, provide #find . Output from "find ." : --------OUTPUT START-------------- . ./My ./My/file ./My/file/MegaFile.cpp ./My/file/MegaFile.h ./My/file/UltraFile.cpp ./My/file/UltraFile.h ./My/files ./My/files/SuperFile.cpp ./My/files/SuperFile.h ./My/math ./My/math/Degrees.h ./My/net ./My/net/SonicSockets ./My/net/SonicSockets/SonicSocket.cpp ./My/net/SonicSockets/SonicSocket.h ./My Library ./My Library/.dep.inc ./My Library/build ./My Library/build/Debug ./My Library/build/Debug/GNU-Linux ./My Library/build/Debug/GNU-Linux/_ext ./My Library/build/Debug/GNU-Linux/_ext/365e969a ./My Library/build/Debug/GNU-Linux/_ext/365e969a/SonicSocket.o ./My Library/build/Debug/GNU-Linux/_ext/365e969a/SonicSocket.o.d ./My Library/build/Debug/GNU-Linux/_ext/51bdf150 ./My Library/build/Debug/GNU-Linux/_ext/51bdf150/MegaFile.o ./My Library/build/Debug/GNU-Linux/_ext/51bdf150/MegaFile.o.d ./My Library/build/Debug/GNU-Linux/_ext/51bdf150/UltraFile.o ./My Library/build/Debug/GNU-Linux/_ext/51bdf150/UltraFile.o.d ./My Library/build/Debug/GNU-Linux/_ext/e6003923 ./My Library/build/Debug/GNU-Linux/_ext/e6003923/SuperFile.o ./My Library/build/Debug/GNU-Linux/_ext/e6003923/SuperFile.o.d ./My Library/Makefile ./My Library/nbproject ./My Library/nbproject/configurations.xml ./My Library/nbproject/Makefile-Debug.mk ./My Library/nbproject/Makefile-impl.mk ./My Library/nbproject/Makefile-Release.mk ./My Library/nbproject/Makefile-variables.mk ./My Library/nbproject/Package-Debug.bash ./My Library/nbproject/Package-Release.bash ./My Library/nbproject/private ./My Library/nbproject/private/configurations.xml ./My Library/nbproject/private/cpp_standard_headers_indexer.cpp ./My Library/nbproject/private/c_standard_headers_indexer.c ./My Library/nbproject/private/launcher.properties ./My Library/nbproject/private/Makefile-variables.mk ./My Library/nbproject/private/private.xml ./My Library/nbproject/project.xml --------OUTPUT END-------------- Could you, please, share your project with me for analysis? You can clean up sources, if you'd like. But I need a reproducible test case. I will create your file system layout in my env to see the problem. Thanks! Vladimir. Created attachment 163049 [details]
Full test case for the errors
I have attached a zipped directory containing everything described(I've re-created it for a minimal test case). This directory "Mounted Directory" is actually an SVN directory on Windows that I mount on my VirtualBox Debian 8.6(jessie) x64 as "/root/SVN_Programming_C++_Linux" (but it should all be irrelevant since it just mounts on linux guest OS). I forgot to include the minimal test app project that is under "/root/test/MyApp". The next upload is going to be it. Created attachment 163050 [details]
Test project using the Full test case.
Created attachment 163052 [details]
Expected test results/errors
Thanks a lot for sharing a test case. Could you, please, insert here Help->About content Thanks! Created attachment 163053 [details]
IDE "Help->About" Dialog
I can not reproduce the problem. Everything is resolved correctly on my system. Could you, please, start IDE with clean userdir and send me your message.log, please, when you see unresolved includes. http://wiki.netbeans.org/FaqWhatIsUserdir http://wiki.netbeans.org/FaqLogMessagesFile Thanks! Also, please, add extra logging to be placed into message.log by starting IDE with -J-Dorg.netbeans.modules.cnd.apt.level=ALL Thanks Created attachment 163054 [details]
Log after removing entire "/root/.netbeans" directory and loading MyApp project.
Thanks for the log. Still no clue... Could you, please, check that the problem is really not with your virtual env. For instance, copy your /root/test and /root/SVN_Programming_C++_Linux to some other place (i.e. into /var/tmp/root/) and try to open and compile from there. (In reply to Vladimir Voskresensky from comment #23) > Thanks for the log. Still no clue... > > Could you, please, check that the problem is really not with your virtual > env. > For instance, copy your /root/test and /root/SVN_Programming_C++_Linux to > some other place (i.e. into /var/tmp/root/) and try to open and compile from > there. If I place the "My" directory (with .h files) in "/var/tmp/root/" and point to it, it works just fine and parses correctly in the editor. As soon as I point back to "/root/SVN_Programming_C++_Linux/" where the same "My" directory resides, it complains. Great! So, I think the reason could be in the different case-sensitivity of the mounted file system (which is from Windows, so it is case insensitive) and 'usual' case-sensitive Linux file system... So, we have a mix and it cause the problem... Let's try the following: - create "tmp" folder in your "/root" folder. Then start IDE with clean userdir and -J-Djava.io.tmpdir=/root/tmp Created attachment 163056 [details]
Launched IDE with cleaned user dir and /root/tmp as ".tmpdir=" parameter
(In reply to Vladimir Voskresensky from comment #26) > Let's try the following: > - create "tmp" folder in your "/root" folder. > > Then start IDE with clean userdir and -J-Djava.io.tmpdir=/root/tmp Still the same behaviour. pointing to "/var/tmp/root" works, the other "/root/SVN..." doesn't. The log seems to say that the parameter passing worked though? Not sure if it did what you wanted it to do. I don't really understand... You share/map whatever windows folder to a share name "Some_Share_Name" and you mount int in /etc/fstab : --------------------------------- Some_Share_Name /root/somePath vboxsf defaults 0 0 --------------------------------- Where would the case sensitivity come into play? It does seem like something is with the mounting... because I also tried a simple directory with "+" signs in it and it was fine. Then I tried mounting the same windows dir to "/var/tmp/poop" and it fails the same as "/root/SVN..." so I'm lost here. (In reply to InfoGeek from comment #28) > (In reply to Vladimir Voskresensky from comment #26) > > Let's try the following: > > - create "tmp" folder in your "/root" folder. > > > > Then start IDE with clean userdir and -J-Djava.io.tmpdir=/root/tmp > > Still the same behaviour. pointing to "/var/tmp/root" works, the other > "/root/SVN..." doesn't. The log seems to say that the parameter passing > worked though? Not sure if it did what you wanted it to do. > > > I don't really understand... You share/map whatever windows folder to a > share name "Some_Share_Name" and you mount int in /etc/fstab : > --------------------------------- > Some_Share_Name /root/somePath vboxsf defaults 0 0 > --------------------------------- > > Where would the case sensitivity come into play? All Linux native FS are case sensitive by default (so you can create easily two files: FileName and filename in the same folder) Windows folder mapped in the Linux env are in fact "windows FS", so you can not create 'FileName' and 'filename' in the same folder. This is where case sensitivity come into play. Although I really don't understand why it fails to resolve... I will add extra flag to force case sensitivity of the IDE. And we'll see if it helps > > It does seem like something is with the mounting... because I also tried a > simple directory with "+" signs in it and it was fine. Then I tried mounting > the same windows dir to "/var/tmp/poop" and it fails the same as > "/root/SVN..." so I'm lost here. One more experiment. Could you run the IDE with clean userdir and extra flags -J-Dos.name="Windows Vista" -J-Djava.io.tmpdir=/root/tmp make sure in advance that /root/tmp is existing folder on your mounted path (In reply to Vladimir Voskresensky from comment #30) > One more experiment. > > Could you run the IDE with clean userdir and extra flags > > -J-Dos.name="Windows Vista" -J-Djava.io.tmpdir=/root/tmp > > make sure in advance that /root/tmp is existing folder on your mounted path I'm sorry, I'm not sure here. What should I do when I start with these parameters? Should the windows folder be re-mounter under "/root/tmp" or is it just a directory for IDE? Should I be placing something in it? (In reply to InfoGeek from comment #31) > (In reply to Vladimir Voskresensky from comment #30) > > One more experiment. > > > > Could you run the IDE with clean userdir and extra flags > > > > -J-Dos.name="Windows Vista" -J-Djava.io.tmpdir=/root/tmp > > > > make sure in advance that /root/tmp is existing folder on your mounted path > > I'm sorry, I'm not sure here. What should I do when I start with these > parameters? Should the windows folder be re-mounter under "/root/tmp" or is > it just a directory for IDE? Should I be placing something in it? Once you said, that you use "/root/somePath" folder to mount in the virtual Linux the folder from Windows. After that I expect that inside /root/somePath on Linux you will see the content of Window's folder, right? What I'm asking for is: - when you in Linux, create "tmp" folder inside your /root/somePath (i.e. /root/somePath/tmp). I've asked you to make sure that "tmp" folder for the IDE is inside the mounted path on Linux - use that path to run IDE with clean userdir and redirected tmp dir: -J-Djava.io.tmpdir=/root/somePath/tmp added some logging and param -J-Dcnd.case.sensitive.fs=true to control case sensitivity changeset: 313465:cf8922bf122d [release82] That was just an example. I'm mounting my windows folder to "/root/SVN_Programming_C++_Linux". I have tried passing the parameter to set temporary folder on: 1) "/root/SVN_Programming_C++_Linux" 2) "/root/SVN_Programming_C++_Linux/tmp" as you just told me to; using my "/root/test/MyApp" to point to "/root/SVN_Programming_C++_Linux"... nothing works. And the -J-Dos.name="Windows Vista" flag doesn't work(Exception in Thread "main" java.lang.AssertionError: Platform not Recognized) as well as its variations "Windows 7" or "Windows7". could you try the following flag: -J-Dapt.use.clank=false (In reply to Vladimir Voskresensky from comment #35) > could you try the following flag: > -J-Dapt.use.clank=false THAT DID IT!!! What magic did you use and what does that mean? (In reply to InfoGeek from comment #36) > (In reply to Vladimir Voskresensky from comment #35) > > could you try the following flag: > > -J-Dapt.use.clank=false > > THAT DID IT!!! Great. > > What magic did you use and what does that mean? Switched you back to the old (not clang-based) include resolving approach :-) Btw, in the upcoming 8.2 update it will be fixed. But it would be great if you can help me to fix it for clang-based mode as well. I will add extra logging and will ask you to provide log traces. Are you OK? Thanks! Vladimir. (In reply to Vladimir Voskresensky from comment #38) > Btw, in the upcoming 8.2 update it will be fixed. > > But it would be great if you can help me to fix it for clang-based mode as > well. I will add extra logging and will ask you to provide log traces. Are > you OK? > > Thanks! > Vladimir. That would be the least I could do to repay your effort and contributions. Integrated into 'main-silver', will be available in build *201612030001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/886222538ed1 User: Vladimir Voskresensky <vv159170@netbeans.org> Log: fixing #269098 - False 'cannot find include file' and related 'unable to resolve indentifier' - added logging (transplanted from cf8922bf122d6b1524fb74d672553559e6fe0fb3) Bug is reproduced in development build only. *** Bug 246881 has been marked as a duplicate of this bug. *** |