16
votes
Accepted
Error: "make: *** No rule to make target `mario'. Stop."
This is a very common question asked by new students. The make command is used to compile the source code and generate an executable program. While there are complexities to this process (more ...
8
votes
Cannot use make: "Nothing to be done for whodunit.c"
You are most probably doing
make whodunit.c
which should be
make whodunit
I also often get confused with these. So there is a way to think for it, always remember, you want to create executable ...
5
votes
Accepted
How to configure make to execute a specific compilation command?
Two ways to configure make to execute a specific compilation command with specific options are:
Makefiles
Environment Variables
Assuming you have a source code file of a C program named prog.c, to ...
5
votes
Accepted
How to make my makefile match the Appliance
When run without a makefile, Make takes its cues from environment variables set in your shell (specifically, those loaded in /etc/profile.d/appliance50.sh).
To get the same behavior from Make as it ...
4
votes
Compile using make without the appliance in Kubuntu
In Linux you can do:
export CC=clang
export CFLAGS="-ggdb3 -O0 -std=c99 -Wall -Werror -lcs50 -lm"
and then run:
make argv-2
I don't use Windows, but I believe it uses set instead of export.
NB: ...
4
votes
Accepted
3
votes
Error: "make: *** No rule to make target `mario'. Stop."
I thought I was in the correct directory, but I wasn't. (I’m a super newbie.)
Execute to show what workspace you’re in “print working directory”:
pwd
Execute to "list":
ls
Execute to “change ...
3
votes
How does "make" know how to compile if no "Makefile" is specified?
If there's no Makefile in the same directory as the program that you're trying to compile, make uses its default configuration. In the appliance, make uses some environment variables to run the ...
3
votes
No Rule to Make Target
You should first navigate to the directory where hello.c exists then just run make hello!
3
votes
No Rule to Make Target
the command/file name combination is case sensitive - make sure you have named your file "hello" rather than "Hello". If it's capitalised, try "make Hello"
3
votes
Accepted
*** No rule to make target `hello'. Stop
Looking at the screen capture, I would say that hello doesn't compile because you are not in the directory that contains hello.c. It would appear that you are trying to execute the make hello command ...
2
votes
No Rule to Make Target
Other way which helped me is typing: cd (you will moved into default directory).
Then type ls and hope you'll see your file there.
2
votes
No Rule to Make Target
If any of these solutions above have not solved your problems, here's another solution:
the word after command "make" should be the same as the file name.
example:
File name:hello.c
Command should be ...
2
votes
Why "make" doesn't throw error when I include some libraries like "string.h"?
First, .h files are not libraries. Rather, they're libraries' header files. More on that here! The string library, as @Hassan Javed said, is part of the C standard library. And it's linked by default. ...
2
votes
Accepted
Nothing to be done for `adder'
Make sure the file named adder has the extension .c. Also make sure you're executing this command
make adder
NOT
make adder.c
2
votes
How does the Makefile from pset 6 work?
The makefile can be confusing at times because a lot of the steps are left out for simplicity sakes, and implied by make using default behaviour.
It might make a bit more sense if you manually ...
2
votes
Accepted
automatically link cs50 when using make? - not using appliance
cs50.h is a header file. Header files are NOT linked. They are included. What is linked is a library binary file.
If you have successfully installed the cs50 library according to the instructions ...
1
vote
Accepted
pset1 greedy.c won't compile using "make" but will using "clang"
are you trying
make greedy.c
?
if yes, try this;
make greedy
1
vote
Accepted
How do I resolve a `for loop initial declarations` error while compiling?
This problem was most likely caused by the original make compilation settings in the Appliance. A simple update50 command fixed it, as the poster noted in a comment to the original post.
The for loop ...
1
vote
I get the error message "undefined reference to 'GetInt'" but I already put #include <cs50.h> at the beginning of my program
I run update50 on the terminal and the problem was resolved :D
1
vote
Accepted
I get the error message "undefined reference to 'GetInt'" but I already put #include <cs50.h> at the beginning of my program
If you haven't already, run update50. There's a bug in the built-in-terminal in gedit that this fixes. Alternatively, use the standalone Terminal app rather than the one in gedit, as that works fine....
1
vote
"make" not working ("undefined reference to GetString")
I can assume that you have broken or not set CFLAGS and LDLIBS environment variables. In the same folder try to create a file called makefile and place the next lines inside it:
CC=clang
CFLAGS=-...
1
vote
Problem with cs50.h header file!
I solved the cs50.h problem by updating my appliance.
For updating open the terminal in the appliance and type--
update50
After the process is completed, cs50.h will work..
1
vote
Unable to 'make hello-2'
You never linked the CS50 library binary file to your program using the -lcs50 option on compilation!
1
vote
How does "make" know how to compile if no "Makefile" is specified?
When run without a makefile, Make takes its cues from environment variables set in your shell (specifically, those loaded in (specifically, those loaded in /etc/profile.d/appliance50.sh).
To get the ...
1
vote
Accepted
Memory leaks found in system programs
Is this a serious problem whenever I use these programs? Why might the
programmers who wrote these programs ignore the advice about
preventing memory leaks?
Check out the top Google result for ...
1
vote
How do I connect VirtualBox to the Internet without hardware virtualization?
I used VirtualBox under linux Ubuntu 14.04 without hardware virtualization, and switched to HAV only some days after I started the course. You should be able to access Internet without HAV.
On this ...
1
vote
Nothing to be done for conditions
I wasn't using Dropbox, but I got the same error. I discovered that I had named the source code file conditions-0 instead of conditions-0.c. The compiler doesn't know what to do without the .c ...
1
vote
Nothing to be done for conditions
As @lethaljd has pointed out, make sure you're in the same directory as the file named conditions.c then execute
make conditions
You can change directories using the cd command. Also, the produced ...
Only top scored, non community-wiki answers of a minimum length are eligible