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 257652 - Unable to use remote folders in include headers in code assistance
Summary: Unable to use remote folders in include headers in code assistance
Status: RESOLVED WORKSFORME
Alias: None
Product: cnd
Classification: Unclassified
Component: Remote (show other bugs)
Version: 8.1
Hardware: PC Windows 10 x64
: P2 normal (vote)
Assignee: issues@cnd
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-20 18:46 UTC by antoniocs
Modified: 2016-01-22 09:55 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
ctrl+shift+alt+M DUMP (15.94 KB, text/plain)
2016-01-21 17:18 UTC, antoniocs
Details

Note You need to log in before you can comment on or make changes to this bug.
Description antoniocs 2016-01-20 18:46:18 UTC
I have set up a remote c project and I am using curl in my C application (I am just using a virtual machine to run this project).
I have installed curl and can compile just fine (the headers are all in /usr/include/ folder) in my remote host by going to the command line and running make (I am using a custom makefile).

But in netbeans the line

#include <curl/curl.h>

Is in red and any usage of Curl variables/functions are also in red.
I had this issue when I tried to use mysql and the only way was to copy to my local machine the header files and then add the location in the include directories setting but I found this solution terribly inefficient.

If I have setup the project as a remote project and netbeans is able to connect to the remote host why can't I add include dirs from the remote host? (not that I should need to in this case because its in the default headers file if I am not mistaken)

I believe this is an oversight and should be fixed.
Comment 1 Alexander Simon 2016-01-20 19:36:12 UTC
Try to specify "///usr/include" for remote include paths.
"///" will prevent path conversion from local to remote file system.
Comment 2 antoniocs 2016-01-20 20:28:38 UTC
That did not do anything.
Comment 3 Vladimir Kvashin 2016-01-21 07:24:03 UTC
Could you please do the following:
while staying in editor with red-underlined #include
- press Ctrl-Alt-M
- check "General File Information" and "Preprocessor States"
and press OK.
IDE will show lots of internals concerning this file in output window.
Please attach this information.

It would be fine if you also attach the IDE log, see
http://wiki.netbeans.org/FaqLogMessagesFile

(Please note that there could be host and user name and file paths you would probably like to strip)
Comment 4 Vladimir Voskresensky 2016-01-21 15:26:13 UTC
(In reply to Vladimir Kvashin from comment #3)
> Could you please do the following:
> while staying in editor with red-underlined #include
> - press Ctrl-Alt-M
Ctrl+Alt+Shift+M
Comment 5 antoniocs 2016-01-21 17:18:29 UTC
Created attachment 158211 [details]
ctrl+shift+alt+M DUMP
Comment 6 antoniocs 2016-01-21 17:22:09 UTC
I have attached the file.

I am now in a new project where <curl/curl.h> is ok but the mysql files are not (even after putting in the header directory, which you can see in the dump)

#include <my_global.h>
#include <my_sys.h>
#include <mysql.h>

Those line are all in red as is anything to do with MySQL such as:

 static MYSQL *conn;

I have restarted netbeans and there were no changes.
Comment 7 Vladimir Voskresensky 2016-01-22 09:55:22 UTC
Thanks for the trace.
There is
System Include Paths:
rfs:vagrant@127.0.0.1:9417/usr/include

so, <curl/curl.h> should resolve if you claim there is /usr/include/curl/curl.h on your remote machine which you access through localhost using port forwarding at port 9417.

-----------
as to mysql files.

You've added your include settings to the incorrect field. Instead of 
Include Headers (used for -include <file> compiler option) you should use Include Directories (used for -I<dir> compiler option).
If your include setting is supposed to be specified as absolute path (i.e. /usr/lib/mysql/include) then use it in format:
///usr/lib/mysql/include
to prevent file path mapping.

Btw, there is an easy way:
Go to Tools->Options->C++->Code Assistance
select Tool Collection of your remote host and add your path to mysql as system include path. 
Then you don't need to change it in Code Assistance options of your projects 

Hope it helps,
Vladimir.
P.S. Closing as works-for-me. Please, reopen if you still have issues