Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Netbeans Remote C++ Development "No rule to make target" Error

When creating a simple Remote C++ Development application in Netbeans, I get the following error:

gmake[2]: Entering directory '/path/to/project'
gmake[2]: *** No rule to make target '/path/to/project/cpp/file'
gmake[2]: Leaving directory '/path/to/project'

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

To reproduce this error I simply create a new C/C++ Project, select a remote host that I have already configured. When I add a .ccp file with a corresponding .h file, I get this error. I don't even necessarily have to use or include those files with anything. It appears that Netbeans may not properly build the Makefile to represent the addition of those files to the project?

like image 600
ossys Avatar asked Oct 11 '11 16:10

ossys


2 Answers

The problem is, I was using absolute paths for my project. Lesson learned, when developing remote projects using Netbeans, you can not use absolute paths unless the locations of the projects on both machines match exactly.

To configure Netbeans to use relative paths, click the "Tools" option in the menu bar and select "Options". Click the "C/C++" button at the top, and go to the "Project Options" tab. the second option, "File Path Mode:" needs to be set to "Always Relative". This will allow the Makefile to correctly find and compile the file.

like image 78
ossys Avatar answered Sep 19 '22 23:09

ossys


Well, considering the output you must have added a file to the makefile (or Netbeans did) that isn't there where it is supposed to be. Therefore it thinks that it is a undeclared target, as targets, the actual target depends on, and the .cpp files the target depends on to compile, are in the same line. I would suggest that you make sure that the makefile is in the correct place and therefore if you follow the exact path you should end up where the file should be, or you configure the vpath variable to consider the directory where the file should be. Else this might give further help as the error message does sound quite the same.

like image 28
Sim Avatar answered Sep 23 '22 23:09

Sim