Netbeans Remote C ++ Development "There is no rule to create a 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 just create a new C / C ++ project, select the remote host that I have already configured. When I add a .ccp file with the corresponding .h file, I get this error. I don’t even have to use or include these files with anything. It seems that Netbeans may not correctly create a Makefile to represent the addition of these files to the project?

+6
source share
2 answers

The problem is that I used absolute paths for my project. Lesson learned, when developing remote projects using Netbeans, you cannot use absolute paths unless the exact locations of the projects on both machines match.

To configure Netbeans to use relative paths, click "Tools" on the menu bar and select "Options." Press the "C / C ++" button at the top and go to the "Project Settings" tab. The second option, "File path mode:" should be set to "Always relative." This will allow the Makefile to find and compile the file correctly.

+6
source

Well, given the output, you should add the file to the make file (or Netbeans), which is not where it should be. Therefore, he thinks that this is an undeclared goal, as goals, on which the real goal depends, and .cpp files, on which the compilation goal depends, are on the same line. I would suggest that you make sure the makefile is in the right place, and therefore, if you follow the exact path, you must find the place where the file should be, or you are setting the vpath variable to look at the directory where the file should be . Else this may give further help as the error message sounds exactly the same.

+2
source

Source: https://habr.com/ru/post/899064/


All Articles