Imobilis
Imobilis

Reputation: 1489

Eliminate whitespaces in directory command-line arguments

A number of folders I possess have name with spaces. This apparently causes a problem when attempting to compile a source file located in such folder. How do I ignore whitespaces for gcc compilation?

Upvotes: 0

Views: 119

Answers (2)

Arjun Sreedharan
Arjun Sreedharan

Reputation: 11453

You can escape spaces using \

eg:

$ gcc -o bin /media/code\ folder/code.c

Upvotes: 0

moffeltje
moffeltje

Reputation: 4669

Use quotes around your command

gcc "C:\my file.c" -o "C:\my folder\my file.exe" 

Upvotes: 2

Related Questions