CDT Custom Build

I have a class in my project that I need to compile with an external tool, and the output of this file is .cpp.

I tried right-clicking the .h file that I want to transfer to the external tool, the selected properties -> C ++ Build -> Settings, and added the command and output, as shown in the image below;

Custom build settings

When I create a project, it does not call the command as passed and therefore cannot get the result. I tried the command through the terminal and worked, I want to get eclipse to send the command when I select Project-> Build or Cleanup . Does anyone know what I'm doing wrong?

Then I added the full path to myclass.h in a command like this ~/Document/project/myproj/src/myclass.h . Now, when I try to "Clear or Build", I get an error message:

**** Build configuration Debugging for myproj project ****

make all make: No rule to make target src/member.o, needed by myproj. Stop.

+4
source share
1 answer

I solved this problem by doing .. /src/myclass.cpp and ../ src / myclass.h for both the command and the output.

And then create the Target build through "Project" → "Make Targets" → "Create". In the "Target Name" type something like boot2, and then uncheck the "Same as target name" box. Enter the name of the generated file using "../src/myclass.h". Click OK to close the dialog box.

Then click “Project” → “Make Targets” → “Create”, select boot1, and the class was generated successfully.

0
source

All Articles