gcc won't compile simple C program on Interix- Windows 7 x64 - c

I just set up Interix on my new workstation here at the lab. Originally, I was just going to set up the x64 tools (you know, the ones from Interop), but when I did that, some things didn't work. Then I went ahead and installed the x86 tools. I'm assuming the 32-bit tools are getting used.
I went ahead and transferred over a file I was working on with Interix on an x86 machine. Basic C program, nothing fancy. Just something we're working on in class. I can open it using NEdit and Vim and the like, but it won't compile, no matter what shell I issue the gcc command in. Here's the error I'm getting:
gcc: error trying to exec 'cc1': execvp: No such file or directory
As I'm relatively new to POSIX-compliant systems, I'm not sure how to fix this. Can one of you fine individuals tell me how to fix this in layman's terms?
EDIT:
If you're looking to do UNIX work on Windows... just use Cygwin. I'm editing this to tell you this because you are probably lost and looking up answers on Google. Windows 8 removed Interix anyways.

Related

Including basics library of C (unistd.h) on window

I've been programming at my school on a Mac for one month. We did C programming on an UNIX shell.
Now i'm back at home and I use my own PC that is on window 10. I have tried to make a similar set up, but i don't know much about all that. I installed git and bash, this made it like a UNIX shell. Also I have installed the gcc compiler.
So, now that i'm making a basic program, it should be working but when I make the include <unistd.h>, the shell can't find it.
I know my question is probably silly but I really couldn't find how to solve the problem. I downloaded the unistd.h file.
I also found this http://processors.wiki.ti.com/index.php/Compiler/diagnostic_messages/5
It explain that i should be putting the .h folder in some kind of defined path, but I don't know how to do that.
Does anyone know how I can fix this?
If you installed gcc as part of mingw or something similar, it should have included a unistd.h. Just having the gcc compiler is not likely to get you very far.
You probably want to start over and install something different than you did (mingw or cygwin or just set up a vm as suggested) that provides a more complete environment.

Can you code a shell for Linux using Windows OS and Dev-C++ IDE? Do shells work the same way for both operating systems?

I'm studying computer engineering and we have a class called operating systems where they lecture us about how OSes handle stuff etc. This week we were given a homework which requests us to code a shell that works on Linux. The problem is, they tought us literally nothing on how to code a shell so we are supposed to do some research and figure it out.
I found this guide online and it seemed perfect to me: link
Code, with explanations, what else could I ask for.
Now, I'm using a Windows PC and I use Dev-C++ IDE with GCC compiler. Can I code a shell that works on Linux with my current setup or do I have to install Linux? Are there any major differences between how shells run on these OSes?
If you want to write a shell for Linux, you want to target GNU/Linux which is basically POSIX with some extensions.
Dev-C++ by default uses MinGW GCC as its compiler, providing a Win32 API.
Win32 and POSIX are completely and fundamentally different. A shell written for one will not even slightly resemble the other.
Instead, you have several options:
Dev-C++ can optionally use Cygwin GCC, providing a more GNU/Linux-like experience on Windows. You need to take great care not to rely on any Cygwin-specific functionality like how it automatically translates pathnames and line terminators. You'll still need access to a Linux install to verify that it works.
Windows 10 lets you install WSL, a more modern Linux compatibility layer for Windows. Dev-C++ doesn't explicitly states it support it, so you may need to edit and compile separately, and may lose debugging functionality. You'll still need access to a Linux install to verify that it works.
Just run Linux in a VM. The only thing to care about is getting your shell working.
I would suggest saving yourself a ton of trouble right now and just download/install an Ubuntu image in VirtualBox.

Compiling with Make command in any IDE

I spent ages searching and couldn't find anything that helped.
I'm doing a project in college where I have to create a virtual disk and file system using C. Most of the code was given already and we need to compile using a Makefile. Using the standard "Build" command fails to compile the software. I've never used Makefiles before and I don't really know how they work but there were some basic instructions given on how to compile with it. I tested it out in Terminal and if I go to the file location and type make it compiles fine and I can run the binary executable file that is created. The problem is that doing this is not only tedious but it doesn't let me use the debugger built in to Xcode.
Is there any way that I can set Xcode to run this make command instead of just building the way it does now? I also installed Eclipse and can code passably well in that if anyone can tell me how to do something similar there.
EDIT: I'm pretty much willing to use any software at this point. I have spent days trying to find a way compile inside an IDE with a Makefile. I also have Visual Studio on a Windows computer and have been trying to figure out how to compile with that, also to no avail. If anyone could please help me I would be so grateful.

Installing PortAudio for use with Cygwin on Windows 7

I'm trying to get PortAudio to work on my computer. I've been using Cygwin and gcc to make applications in C, but I'm completely clueless as to how I might go about getting PortAudio to compile and work on my system.
I've found info on PortAudio's website for getting it to work with Microsoft Visual Studio, but I'm not using that IDE (or any for that matter. Just been working in Notepad++ and running things from the command line).
If anyone has any info for how I might get this to work, or where I might look for an answer, it would be much appreciated!
Thanks!
-Justin
You should be able to follow the PortAudio instructions for Linux.
As it says in the instructions, "You might need to use yum, or some other package manager, instead of apt-get on your machine". In the case of Cygwin, that probably means using the Cygwin setup.exe program.

Compiling a GTK+ application for windows from linux

I'm new to linux and have been learning gtk+ the past couple of days, and was wondering how you would go about compiling an application to run on windows instead of linux (ubuntu). I found this while doing a quick search but my knowledge of linux is non-existent at the moment so not sure how to proceed with the tutorial. Are there any alternative methods to do this?.
I've only compiled on Windows and used Cygwin to test 'nix versions (before going right into a 'nix OS and compiling), but looks like this might get you started.
Compiling in other OS does not make sense while you can't disribute your binary without testing it on the target platform.
Then why not to compile on the same platform?

Resources