GhostMember
GhostMember

Reputation: 111

Compiling a C program issue in the terminal

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.

Upvotes: 0

Views: 156

Answers (1)

Domi
Domi

Reputation: 24508

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

Upvotes: 3

Related Questions