cygwin gcc problem.

meeran

meeran

@meeran-rxMtFb Oct 26, 2024
Hi...

I am trying to compile a c file using gcc in cygwin shell. But i am getting an error "no input file".. I have checked the path for nearly hundred times.. The path name is cent percent right and the file exists...
My problem is pictured below,

C:\cygwin\bin\gcc -Wall -O2 "/cygdrive/c/virtutech/src/misc/cygwrap/cygwrap.c" -o "/cygdrive/c/virtutech/src/misc/cygwrap/mysimics/cygwrap.exe"
gcc: /cygdrive/c/virtutech/src/misc/cygwrap/cygwrap.c: No such file or directory

gcc: no input files

Can anyone help me to get out of this situation.... Please....

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • KenJackson

    KenJackson

    @kenjackson-mBf7HF Oct 12, 2011

    I see you are using backslashes for the command path. Are you running this in Windows CMD or a Cygwin bash?
    You really should be working in bash, but it might work in CMD.

    In CMD, try getting rid of the quotes ("). I think CMD will pass them to gcc, whereas bash would consume them.

    Otherwise, what's your current directory? Can you cd to /cygdrive/c/virtuech/src/misc/cygwrap? And then run this:
    gcc -Wall -O2 cygwrap.c -o mysimics/cygwrap.exe
    Also, does the mysimics directory exist?
  • meeran

    meeran

    @meeran-rxMtFb Oct 13, 2011

    Thank you very much Ken...

    Actually i am not manually doing this process.. I have to create a workspace for my simics simulation project.. I gave the below command in my cygwin bash shell in order to create a workspace....

    "MEERAN@RABIYATHRAJA-HP ~$ /cygdrive/c/virtutech/bin/workspace-setup.bat mysimics

    The above batch file do various task to create a workspace as below.

    Setting up Simics workspace directory: mysimics
    Created directory: C:\cygwin\home\MEERAN\mysimics
    Created directory: C:\cygwin\home\MEERAN\mysimics\.workspace-properties
    Created directory: C:\cygwin\home\MEERAN\mysimics\modules
    Compiling 'cygwrap' wrapper
    C:\cygwin\bin\gcc -Wall -O2 "/cygdrive/c/virtutech/src/misc/cygwrap/cygwrap.c" -
    o "/home/MEERAN/mysimics/cygwrap.exe"
    gcc: /cygdrive/c/virtutech/src/misc/cygwrap/cygwrap.c: No such file or directory
    
    gcc: no input files
    The last four lines where the workspace-setup.bat tries to compile the cygwrap is the place of war here. I have checked the path of cygwrap.c and it exists. And the compile operation is automated not manual...

    Please help me...
  • KenJackson

    KenJackson

    @kenjackson-mBf7HF Oct 13, 2011

    Is the virtutech directory under C:\ or under C:\cygwin\?

    Your .bat file is saying it's under C:\.

    GCC is being executed, but it can't find the file, so that path must be wrong.
    My first guess is that virtutech is really under C:\cygwin, not C:\.
    If that's the case, just delete "/cygdrive/c".

    gcc /virtutech/src/misc/cygwrap/cygwrap.c ...

    Otherwise, verify that path. Something in it is wrong.


    BTW, using a .bat file guarantees you are using the Windows CMD shell instead of bash.
    That can work, but it's a shame. Bash is wonderful. I encourage you to use it.