0

I am trying to compile a C program in the terminal.

This is my command:

gcc -1 string -o syncing.c -o syncing

This is my result:

clang: error: no input files

I know that -1... indicates the library I used, syncing.c is the C file I am trying to compile.

What am I doing wrong with my command or is it something else?

I am only using standard libraries.

7

1 Answer 1

3

Please read up on how to use GCC, GCC command-line options and also official command-line documentation. You are telling it that syncing.c is your output file. But you want it to be your input file.

Also, I am not so sure on the -1 there. You might want to have a look at this on how to include/link external libraries. Here are more examples on that.

You probably meant something like:

gcc syncing.c -lstring -o syncing
Sign up to request clarification or add additional context in comments.

7 Comments

The first link is weird. Opening it results in the browser prompting for a file location, not opening it as a normal HTML page (the content is actually HTML). At least in Firefox 106.0.2 ("Always ask you where to save files" is enabled, but that shouldn't really matter for .html files). E.g., is there a special character in the file part of the URL?
Is the web server sending something weird?
@PeterMortensen Thanks for the feedback. After 9 years, documentation has evolved. I added some hopefully slightly more future-proof links now. Hopefully that helps
Thanks. Though, looking at the question again, it is probably not about GCC, but Clang.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.