GCC link a directory [closed] - c

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
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^

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.

"Parse" line of code doesn't allow code to execute [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
Cheers, I've isolated the error but I'm not sure how to fix it. Apparently, this line of code,(C language):
parse(getenv("QUERY_STRING"));
It does successfully compile, however when I run the executable the following pops up: puu.sh/nQi41/40e81c4494.png
When I simply comment out that specific line, the code compiles and runes perfectly.
Any possible solutions to this? Thanks in advance
Replace:
parse(getenv("QUERY_STRING"));
by:
char *querystring = getenv("QUERY_STRING");
if (querystring == NULL)
{
printf("Could not get querystring");
exit(1);
}
parse(querystring);
... and read the documentation of getenv.

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: –Wall: No such file or directory (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 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 (-).

Resources