gcc fails with spawn: No such file or directory

后端 未结 7 2228
醉梦人生
醉梦人生 2021-02-13 13:41

I downloaded Ruben’s build of Cygwin GCC.

However upon running it seems unable to compile any files

$ touch foo.c

$ gcc foo.c
gcc: error: spawn: No such file         


        
7条回答
  •  不知归路
    2021-02-13 14:21

    Make sure the source file extension is in lowercase (i.e. main.c, not main.C):

    $ gcc -o main main.C
    $ gcc: error: spawn: No such file or directory
    
    $ gcc -o main main.c
    $ # all good
    

    This only refers to the case of the extension as given to the gcc, the actual source file can have the extension in whatever case you want.

    Explanation: This is from my experimenting with cygwin and gcc, I don't know the actual reason for this behavior.

提交回复
热议问题