Maybe this is a little bit esoteric, let's see how it goes.
I'm writing a c++ program using NetBeans 7 on a Windows 7 x64 box, but building on a remote development host, which is actually an Ubuntu Server 10.4 x64 virtual machine running on VirtualBox 4.
Source files are shared using VirtualBox shared folders. I've been able to create projects, build and debug them with no problems.
However, the code assist features of NetBeans keep on complaining that none of my include files can be found, and therefore I get a code assist "unable to resolve identifier" error for every single function call.
This is not very surprising, as the include files are actually in /usr/include, which is not part of the shared folder scheme, and therefore are not directly readable by NetBeans (it can and should read them using ssh though). But I would expect for NetBeans to allow me to set remote directories for code assist. I've looked through many settings and haven't found anything resembling what I'm looking for.
Sure, it's possible to just ignore this errors, but apart from me being near-OCD, that would be th开发者_如何转开发e same as disabling code assist, and I really appreciate it when the IDE tells me about a typo or other things that can be done with code assist.
Any ideas?
You might want to try the following settings in Netbeans, which solved my problem of code assist on remote hosts:
1) Project Build Settings
a - Right-click on the project in the project pane, select "Properties"
b - Expand "Build" and click "C++ Compiler"
c - In the "Include Directories", make sure you set the correct Configuration (Debug or Release) at the top, click the "..." to open the "Include Directories" window
d - Put the full path of the include directory. Notice that when you click "Select", Netbeans will automatically prepend the Windows path information. Since you are developing on a remote Linux host, you must now click the "Edit" button and edit this path to resemble the Linux file path (without the C:)
2) Netbeans Code Assistance Options
a - In the Netbeans menu bar, click "Tools" and then "Options"
b - Click "C/C++" at the top, then select the "Code Assistance" tab
c - Make sure the "Tool Collection" is set to the proper remote host at the top
d - For bot the "C Compiler" tab and the "C++ Compiler" tab, click "Add" and manually type the full path to the directory you want Code Assist to index.
e - Again, when you click "Select", Netbeans will automatically prepend the Windows path PLUS change the slashes to Windows slashes (ugh)... so now you must click "Edit" and edit those paths to represent the correct Linux syntax
Hope that helps!!
精彩评论