Jump to content

gcc is not recognized.

- - - - -

  • Please log in to reply
2 replies to this topic

#1
sly

sly

    Newbie

  • Members
  • Pip
  • 3 posts
I am trying to compile a program as training from command with the c language and this is the scenario

c:\djgpp\bin\kstudent\executing a simple c program>gcc compile_code.c -o compilecode.o -lm

'gcc' is not recognized as an internal or external command,operable program or batch file.


please help! i am new to this.

#2
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,118 posts
  • Location:Vancouver, Eh! Cleverness: 200
Hello sly, you will have to either type the full path "C:\(path to gcc)\gcc compile_code.c -o ..." or set up the location of GCC in your PATH variable.

I will assume a general version of Windows you have:
  • Right click my computer and click properties
  • Click the advanced tab
  • Click environmental variables
  • Find PATH (or Path or path) in system variables and edit it
  • Important: type the path to your gcc bin location (i.e. c:\djgpp\bin\) although ensure a semicolon is placed behind it to delimit the paths.
    previous contents that should not be modified;c:\djgpp\bin
Why is this needed? The command prompt or program must know where to look for the gcc executable to be able to call it from anywhere. Calling "ping" for example calls ping.exe in the Windows folder, because the Windows folder is in Path!

Alexander.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#3
sly

sly

    Newbie

  • Members
  • Pip
  • 3 posts
Hay Thanks,Great:thumbup1:




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users