gcc: –Wall: No such file or directory (In C) [closed] - c

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
The command line that I'm suppose to compile my program is:
gcc –Wall –o prs process.c
I'm getting these errors:
gcc: –Wall: No such file or directory
gcc: –o: No such file or directory
gcc: prs: No such file or directory
I'm sure that I'm in the correct directory. It works when I use gcc process.c and it runs perfectly.
My prof requires us to use that command line to compile, so I don't think I should change the compile command.

– is an en dash, which GCC is interpreting as a filename.
You need to use a regular hyphen (-).

Related

Specific executable file name creates syntax error in C [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 years ago.
Improve this question
I'm creating a project and I need to call my executable file name "cluster".
I created a makefile and as long as I call my executable file name by any name other then "cluster" and runs it, it works fine.
However, when I'm calling the file name "cluster" -> make all -> executing (with the name "cluster") I receive the following error:
The error message
What could be the cause of this error? I must be able to call the executable file name that specific name.
If you are on linux, type
which cluster
You will probably find a program called cluster on your path. To execute the one you have made, either change the name to something like Cluster or
./cluster testGraph8 outputfile
The ./ uses the one in the current directory.

problem with c about issue with clang 7 error? [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 years ago.
Improve this question
Picture of code
I have a problem with clang 7 error, I don't know what the issue is? Why is clang -o hello hello.c not working? I have already tried twice and the error repeated itself so I am unsure why the clang -o hello hello.c is not working.
Read the messages. The clang command told you:
/usr/bin/ld: cannot open output file hello: Is a directory
The “/usr/bin/ld:” part says the specific program “/usr/bin/ld” (which is the linker; it links object files into an executable file) is giving you this message.
The “cannot open output file hello” part says it cannot output the file named “hello”.
The “Is a directory” part says why there is a problem: “hello” is a directory, meaning it exists and is a directory, not a regular file, so it cannot be opened like a regular file. The linker wants to open it as a regular file so that it can write to it.
To fix this, either remove or rename the directory named “hello” (check what is in it first, to see if you want it) or use a different output file name in the clang command.

main.c:16:9: error: stray '\32' in program in C [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 years ago.
Improve this question
I am trying an example from the GNU C Programming Tutorial (page 93) that uses a few of the math library routines listed.
#include <stdio.h>
#include <math.h>
int main() {
double my_pi;
my_pi = 4 * atan(1.0);
/* Print the value of pi, to 32 digits */
printf("my_pi = %.32f\n", my_pi);
/* Print value of pi from math library, to 32 digits */
printf("M_PI = %.32f\n", M_PI);
return 0;
}
When I compile the file 'main.c' using MinGw using the command
gcc main.c -o main -lm
It gives the following error:
main.c:16:9: error: stray '\32' in program
16 : }
: ^
Error occurred because of using Turbo C to edit 'main.c' which adds → character at the end of the curly brackets. That is why compilation fails in MinGw..
The code \32 is an ASCII control character ^Z aka EOF - the End-Of-File (see https://en.wikipedia.org/wiki/End-of-file#EOF_character). It was appended at the end of the text file with some (DOS-like?) editing tool – or maybe you copied a source code and pasted it through some shell command to a file, which resulted in appending the EOF byte.
Try using some other editing tool to strip the last byte from your main.c file. Maybe adding a newline after the closing bracket would be good start.

Make ex3 returning "nothing to be done for 'ex3' [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
I'm attempting to learn c from http://c.learncodethehardway.org/book/ex3.html and during the exercise i am receiving a message that "Nothing to be done for ex3" when i try to compile the following code.
#include <stdio.h>
int main()
{
int age = 10;
int height = 72;
printf("I am %d years old.\n", );
printf("I am %d inches tall.\n", height);
return 0;
Why am i receiving this error and how can i avoid it in the future?
Edit:
Thanks for the help in this, i've corrected the missing 'age' code and here is the makefile
CFLAGS=-Wall -g
clean:
rm -f ex1
This is not an error message. It just means that there is nothing to be done for target "ex3". Probably because it is already built. Post the makefile and we might be able to shed more light into the issue.
If the makefile has something like the following:
ex3:test.c
gcc -o ex3 test.c
It means that the target ex3 depends on the file test.c; make will run the gcc command if and only if the last modified time of test.c is greater than that of ex3 (in other words, the source code is newer than resultant binary). You can touch the source code file to force a make:
touch test.c
you forgot to put age as an argument that is going to be printed. So, use:
printf("I am %d years old.\n", age );
instead of
printf("I am %d years old.\n", );

GCC link a directory [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Improve this question
I want compile a .c script with the gcc-compiler.
But i need to link a file and a directory. I need to link the file python3.lib and the directory D:\Python33\include.
But the linker doesn't work, here my code:
gcc main.c -lpython3 -l D:\Python33\include
The Error:
main.c:1:20: fatal error: Python.h: No such file or directory
#include <Python.h>
^
compilation terminated.
What is wrong? Thank you for help!
You are passing wrong parameters to gcc.
gcc main.c -L /path/to/lib/file/directory -lpython3 -I D:\Python33\include
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^

Resources