0

This is probably a very silly question with a very simple answer, but it has been torturing me for several days now. I want to try to compile notes.c and synthesize.c to see if the code I wrote in helpers.c for some of the functions the aforementioned programs need, y'know, works.

Compiling would seem to be a straightforward task, but I am struggling. This is the first problem set to involve a makefile, and I don't really understand how it works, or what I'm supposed to do to make it work.

I've tried typing just make into the command line, while inside the directory that holds all the relevant files, with both notes.c and synthesize.c open (and all the other files as well, for good measure). I get the error:

make: *** No targets specified and no makefile found. Stop.

I think I understand the first part, in that it means I have to tell the command line WHAT to make. That seems sensible.

When I typed make notes, I got this error:

*** No rule to make target `notes'. Stop.

But why wouldn't the command line be able to find the makefile? I downloaded all the files from CS50, and I haven't edited anything other than helpers.c (oh, and bday.txt). The Makefile is where it was when I first started - in the pset3/music/songs folder, along with all the other files I should need.

Am I not entering my command line argument correctly? Could it be a problem with the Makefile itself? Could something I have written in helpers.c be the problem?

I'm scared to tamper with anything in case I make things worse. I'm not sure what other information I might need to give in order for someone to help me.

I would really appreciate the help of any kind soul who takes pity on me. And I'm really sorry if someone has already asked a question like this before; I've been searching for days and couldn't find anything. I'm also sorry for how long this is. Thank you for reading this far, by the way.

1

You're on the right track, but I suspect your file structure isn't right, or you've misinterpreted something wrong.

All of the code files, *.c, *.h, the Makefile and the songs directory should be in the directory pset3/music, not in pset3/music/songs. Only the songs are in the songs subdir.

If you're looking at the IDE and there's a pointer that points to the right, next to songs, then the files below it are in the same parent directory as the songs directory. If the pointer points down and the following files are indented, then they are in the songs subdirectory.

So, make sure that your files are where they belong and that you are in the music directory, not the songs directory.

If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .