I'm trying to compile this assignment but I keep receiving this message I read that the file name should match the folder name but the file's name is cash.c and it is in a folder named cash under the pset1. This happened both in the Mario and hello assignments I fixed them by chance but it still happens. How can I fix it?
The overall rule is this: If you're trying to compile a file, let's call it
myfile.c, then you need to be in the same directory as myfile.c and you need to issue the command
make myfile, but not followed by a period or by .c.
You can check to see if the file is there with this command:
This is the simple rule. There are more complicated rules that you'll learn later, such as compiling programs with multiple source code files and a makefile file.
For this though, if you're not in the right directory and the source code file isn't in that directory, it will fail. Also, if you've written a .h file of the same name, it needs to be there too.
If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)