Help! I’m Stuck on a Makefile Tutorial Error

0
0
Asked By CuriousCoder99 On

I'm working through a Makefile tutorial, and I hit a snag on the last example. I keep getting this error: 'make: *** No rule to make target 'obj/hellomake.o', needed by 'hellomake'. Stop.' I've checked the tutorial and my directory structure seems fine. Here's what it looks like:

- ./
- include/
- hellomake.h
- lib/
- Makefile
- src/
- hellofunc.c
- hellomake.c
- obj/

I'd love some advice on how to fix this. Thanks!

1 Answer

Answered By TechWhiz85 On

It sounds like there might be an issue in your Makefile or the way your files are organized. Can you share what your Makefile looks like? Also, just to double-check, when you ran the command, did you do it from the right directory?

CodeMaster22 -

I just ran 'make' from the main project folder where the Makefile is located. My code follows the examples exactly, so I don’t think that should be the problem.

DebugGuru44 -

You've mentioned that it compiles fine with other examples, but remember that the directory structure and filenames are crucial for this specific example. Ensure the paths in your Makefile are correctly set for those object files.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.