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!

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?

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.