473,385 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Linux-like GCC compiler for WIndows?

Hi there,

I'm a grad student working on my university's Linux system, connecting
via the network and using the GCC compiler. My C programs take
advantage of Linux's < and operators to read stdin from a file and
write stdout to a file, as well as to read from a 2nd file that the
program takes as an argument. So a typical program gets executed like
this: "./prog infile <stdinfile >stdoutfile". (BTW, I'm not sure this
is considered good programming practice, but I do it anyway, so please
don't yell at me over this one...)

I'm looking for a way to run these programs when I'm offline. Does
anyone know a Windows (XP) version of the GCC compiler that allows me
to specify a file for stdin and hopefully also for stdout? Thanks so
much,

Adam

Jun 22 '07 #1
6 11131
You can do the same thing in the windows command prompt (i.e. app.exe < infile.txt
outfile.txt).

---Matthew Hicks

Hi there,

I'm a grad student working on my university's Linux system, connecting
via the network and using the GCC compiler. My C programs take
advantage of Linux's < and operators to read stdin from a file and
write stdout to a file, as well as to read from a 2nd file that the
program takes as an argument. So a typical program gets executed like
this: "./prog infile <stdinfile >stdoutfile". (BTW, I'm not sure this
is considered good programming practice, but I do it anyway, so please
don't yell at me over this one...)

I'm looking for a way to run these programs when I'm offline. Does
anyone know a Windows (XP) version of the GCC compiler that allows me
to specify a file for stdin and hopefully also for stdout? Thanks so
much,

Adam

Jun 22 '07 #2
On Jun 22, 10:24 am, "adam.kleinb...@gmail.com"
<adam.kleinb...@gmail.comwrote:
Hi there,

I'm a grad student working on my university's Linux system, connecting
via the network and using the GCC compiler. My C programs take
advantage of Linux's < and operators to read stdin from a file and
write stdout to a file, as well as to read from a 2nd file that the
program takes as an argument. So a typical program gets executed like
this: "./prog infile <stdinfile >stdoutfile". (BTW, I'm not sure this
is considered good programming practice, but I do it anyway, so please
don't yell at me over this one...)

I'm looking for a way to run these programs when I'm offline. Does
anyone know a Windows (XP) version of the GCC compiler that allows me
to specify a file for stdin and hopefully also for stdout? Thanks so
much,

Adam
<OT>
You're looking for Cygwin.

http://www.cygwin.com/

It's essentially a Unix-like environment for Windows users. You can
get your shell of choice and the GNU set of tools (gcc, gdb, etc).
Takes up a few hundred megabytes of disk space, but quite handy for
Windows people who desire some sort of Unix-like environment.
</OT>

Jun 22 '07 #3
On Jun 22, 8:24 am, "adam.kleinb...@gmail.com"
<adam.kleinb...@gmail.comwrote:
Hi there,

I'm a grad student working on my university's Linux system, connecting
via the network and using the GCC compiler. My C programs take
advantage of Linux's < and operators to read stdin from a file and
write stdout to a file, as well as to read from a 2nd file that the
program takes as an argument. So a typical program gets executed like
this: "./prog infile <stdinfile >stdoutfile". (BTW, I'm not sure this
is considered good programming practice, but I do it anyway, so please
don't yell at me over this one...)

I'm looking for a way to run these programs when I'm offline. Does
anyone know a Windows (XP) version of the GCC compiler that allows me
to specify a file for stdin and hopefully also for stdout? Thanks so
much,
Your question is not a C question. Questions about tools are off-
topic.

BTW:
http://sourceforge.net/project/showf...?group_id=2435
Tragically, Mingw's distribution has a stone-age gcc/g++, so I use
this one:
http://www.thisiscool.com/gcc_mingw.htm

Jun 22 '07 #4
On Fri, 22 Jun 2007 15:24:38 -0000, in comp.lang.c ,
"ad************@gmail.com" <ad************@gmail.comwrote:
>I'm looking for a way to run these programs when I'm offline. Does
anyone know a Windows (XP) version of the GCC compiler
whats wrong with gcc for windows? STFW....
>that allows me
to specify a file for stdin and hopefully also for stdout?
You can do that with any command-line application. You can build those
just as easily with VisualC or BorlandC as with gcc.
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Jun 22 '07 #5
"ad************@gmail.com" wrote:
>
I'm a grad student working on my university's Linux system, connecting
via the network and using the GCC compiler. My C programs take
advantage of Linux's < and operators to read stdin from a file and
write stdout to a file, as well as to read from a 2nd file that the
program takes as an argument. So a typical program gets executed like
this: "./prog infile <stdinfile >stdoutfile". (BTW, I'm not sure this
is considered good programming practice, but I do it anyway, so please
don't yell at me over this one...)

I'm looking for a way to run these programs when I'm offline. Does
anyone know a Windows (XP) version of the GCC compiler that allows me
to specify a file for stdin and hopefully also for stdout? Thanks so
much,
Why do you need anything? Just run the programs from a command
line prompt window. Gcc is available everywhere, one Windoze
incidence is via DJGPP.

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>
<http://www.aaxnet.com/editor/edit043.html>
cbfalconer at maineline dot net

--
Posted via a free Usenet account from http://www.teranews.com

Jun 22 '07 #6
Cygwin looks like the one for me. Thanks everyone!

Adam

Jun 24 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: John | last post by:
"Networking software maker Novell on Monday boosted its Linux portfolio with the acquisition of Linux software maker Ximian for an undisclosed sum. The purchase of Ximian's desktop Linux software...
0
by: Eric Raymond | last post by:
When installing the rpms (or the tar file) onto Red Hat Enteprise Linux AS Beta 1 (Taroon), we get the follwing error: Installing all prepared tables /usr/bin/mysql_install_db: line 1: 7690...
383
by: John Bailo | last post by:
The war of the OSes was won a long time ago. Unix has always been, and will continue to be, the Server OS in the form of Linux. Microsoft struggled mightily to win that battle -- creating a...
3
by: Thomas Casanova | last post by:
Hi, I am compiling a MSVC++ project on linux gcc 3.3.4. gcc is whimsical about templates. It does understand the declaration of the template type PointerList. It scream the error :...
1
by: srihari | last post by:
Hai, I am trying to install IBM DB2 8.1 on Red Hat linux 8.0. My machine is Intel XEON 64bit. The installation went well except for the creation of tools catalog. When I tried to install the tools...
5
by: cranium.2003 | last post by:
hi, Here is my code #include <iostream.h> int main() { cout <<"HI"; return 0; } and using following command to compile a C++ program g++ ex1.cpp -o ex1
1
by: rada.lambretha | last post by:
Configuring Linux as a Firewall * Making installation choices * Introducing iptables * Using iptables commands * Simplifying things with firewall GUIs * Adding proxy functionality As...
3
by: Paddy | last post by:
Hi, I am am falling at the first hurdle when trying to access a library using ctypes. I have a file libucdb.so which the file command says is shared object, but I cannot get it to load: Any...
4
by: james457 | last post by:
Hi all, I am writing a linux testbed for wireless sensor networks. The core objective is to test data transfer between any two nodes. The network runs using tree topology. One node in the network...
2
by: tvnaidu | last post by:
valgrind error - "failed to start tool 'memcheck' for platform x86-linux" no such file or dir copied all lib and bin files which are generated after I compiled valgrind package, when I run my exe...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.