Reputation: 1014
I am following this and this to add an Icon to my Executable
I am getting Error
make: *** No rule to make target 'resources.o', needed by 'Project_Name'. Stop.
I have:
- created resources.h
- created resources.rc (Already checked that path inside file is correct)
- added #include "resources.h" to my main.cpp
- added prebuilt option
windres ../resources.rc -O coff -o ../resources.o
- added linker object resources.o
Still looks like something is missing. The files resource.rc and resource.h are included in my project
Upvotes: 0
Views: 340
Reputation: 1014
I have managed to find the solution myself. Eclipse builds following directory structure:
project_name
- Release
- Debug
- .settings
Because gcc/g++ is called to build .o files in the Release/Debug folder, and .cpp and .h files are in project_name the same must go with .rc files - seems like I have mistaken the folders in linked explanation
I put resource.rc and .ico in project_name, and as with .cpp I am making .o files one folder below
So this is the right command in
Project->Properties->C/C++ Build->Settings->Build Steps->Pre-build->Command
windres ../resources.rc -O coff -o ./resources.o
and in
Project->Properties->C/C++ Build->Settings->Tool Settings->Linker->Miscellaneous->Other objects
add 'resource.o'
And most important: to avoid 'no rule to make target' none of mentioned files should be added to the project
Upvotes: 1