1,105,363 Community Members

Problem using gcc in Cygwin

Member Avatar
m_ishwar
Junior Poster in Training
59 posts since Aug 2010
Reputation Points: 13 [?]
Q&As Helped to Solve: 3 [?]
Skill Endorsements: 0 [?]
 
0
 

Hello everyone. I am trying to compile this simple code using gcc under Cygwin terminal.

//A function that just returns a value//
int my_function()
{
    return 0xbaba;
}

I saved the code as basic.c
I issue the command
$gcc basic.c
in the Cygwin terminal

And I get the error:
gcc: error: spawn: No such file or directory

I already had enough trouble installing GCC under Cygwin. Cant figure out what this means. Please Help!
Thanks in Advance!

Member Avatar
rubberman
Senior Poster
3,999 posts since Mar 2010
Reputation Points: 513 [?]
Q&As Helped to Solve: 501 [?]
Skill Endorsements: 87 [?]
 
0
 

I have used cygwin for many years and never had a problem installing gcc with it (multiple versions of gcc in one cygwin instance, just like my linux systems). Have you tried uninstalling, and reinstalling cygwin, and when you have the package page showing as to which packages to install, did you enable gcc then, or did you try it after cygwin was installed?

Member Avatar
m_ishwar
Junior Poster in Training
59 posts since Aug 2010
Reputation Points: 13 [?]
Q&As Helped to Solve: 3 [?]
Skill Endorsements: 0 [?]
 
0
 

I am going through a tutorial for OS Development and I need a compiler like GCC and the Linker ld associated with it to get the binaries for the OS. I tried with the GCC integrated with MinGW
There was a error saying
"pe operations on Non-PE file" when using ld that comes with MinGW
I learnt form the Internet it was because ld requires an elf system.
So I installed Cygwin and then installed binutils, GCC and some other utilities which I dont know about. When I tried compiling with Cygwin, I got the error. I am at a total loss because no one else on any forum has encountered such a discrepancy while using Cygwin.
By the way, will working in Linux for OS Kernel development help? I heard it provides more support for OS development than Windows

Question Answered as of 10 Months Ago by rubberman
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article