gcc on windows

This is a discussion on gcc on windows within the C Programming forums, part of the General Programming Boards category; hello everybody I have installed gcc for windows( gcc-2.95.2-crtdll.exe ). i have set the required path and other things. The ...

  1. #1
    the c-dil
    Join Date
    May 2005
    Posts
    12

    gcc on windows

    hello everybody

    I have installed gcc for windows(gcc-2.95.2-crtdll.exe ).
    i have set the required path and other things.
    The command gcc -v is correctly giving the version and other
    things.
    That means gcc is installed correctly.


    Now i tried to run a simple program saved in the bin folder .
    file name is first.c

    gcc -o first.exe first.c ..... gives
    GCC.EXE :first.exe : no such file or directory
    GCC.EXE : no input files

    I know this is very simple but please help me out
    Thanks
    Rajat kochhar

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    Is your current working directory the bin folder?
    My best code is written with the delete key.

  3. #3
    the c-dil
    Join Date
    May 2005
    Posts
    12
    yes my current working directory is the bin folder. Now then......
    Rajat kochhar

  4. #4
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >Now then......
    Sorry, but I find that incredibly rude. If you don't want my help, I have better things to spend my time on. If you do want my help, you would do well to choose your words carefully when shrugging off my suggestions.
    My best code is written with the delete key.

  5. #5
    Registered User
    Join Date
    Jun 2005
    Posts
    1
    I could be wrong, but I believe the syntax for the gcc command requires that you put the source file before the executable. So you specified first.exe as the input file, but of course first.exe doesn't exist yet so the command gives an error.

    I could be wrong, but the symptoms match and I frankly can't think of anything else.

    Edit: I just checked the man page for gcc. So much for my suggestion. Good luck.
    Last edited by Sirus; 06-07-2005 at 09:48 AM.

  6. #6
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,047
    It's looking for first.exe as the source file.

  7. #7
    FOX
    Join Date
    May 2005
    Posts
    188
    Newer GCC versions don't have that limitatation.

  8. #8
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,047
    I just looked it up.

    gcc -g -c first.c -o first.o
    gcc -o first.exe first.o

    This is how my cc.bat does it. Another option would be to edit your cc.bat file (change all '.cpp's to '.c's) and save it as ccc.bat (I did that a while ago). Or you could get RHIDE.

    dwk

  9. #9
    the c-dil
    Join Date
    May 2005
    Posts
    12
    Quote Originally Posted by Prelude
    >Now then......
    Sorry, but I find that incredibly rude. If you don't want my help, I have better things to spend my time on. If you do want my help, you would do well to choose your words carefully when shrugging off my suggestions.

    Sorry sir , if you felt bad I didn't really mean that.
    Rajat kochhar

  10. #10
    Super Moderator
    Join Date
    Sep 2001
    Posts
    4,913
    Sorry sir , if you felt bad I didn't really mean that.
    I wondered if you had meant it that way - I saw you were from New Delhi. Well to make it worse, Prelude's not really, "sir", it's more, "ma'am"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. LoadFromFile() causes Windows 98 to freeze?
    By MidnightlyCoder in forum Windows Programming
    Replies: 8
    Last Post: 03-17-2006, 01:23 PM
  2. Question..
    By pode in forum Windows Programming
    Replies: 12
    Last Post: 12-19-2004, 06:05 PM
  3. IE 6 status bar
    By DavidP in forum Tech Board
    Replies: 15
    Last Post: 10-23-2002, 05:31 PM
  4. Manipulating the Windows Clipboard
    By Johno in forum Windows Programming
    Replies: 2
    Last Post: 10-01-2002, 09:37 AM
  5. Gnu Gcc with Windows
    By JasonLikesJava in forum C++ Programming
    Replies: 0
    Last Post: 03-06-2002, 11:40 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21