473,804 Members | 2,195 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 11148
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.securityfoc us.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
1543
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 will complement Novell's efforts to sell tools for managing networks of Linux servers, the company said. Novell plans to create a business unit called Novell Ximian Services. Executives from the two companies said the union will help drive...
0
2389
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 Segmentation fault /usr/sbin/mysqld --bootstrap --skip-grant-tables --basedir=/ --datadir=/var/lib/mysql --skip-innodb --skip-bdb Installation of grant tables failed The log file simply shows a start and a stop of the server.
383
12284
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 poor man's DBMS, a broken email server and various other /application/ servers to try and crack the Internet and IS markets. In the case where they didn't spend their own money to get companies to
3
2019
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 : 'PointerList' is used as a type, but is not defined as a type. from this sources code: class TableFormat
1
8104
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 catalog as a post installation task I get some java error. $ db2 CREATE TOOLS CATALOG SYSTOOLS USE EXISTING DATABASE TOOLSDB FORCE SQL22209N The DB2 Administration Server encountered an unexpected Java error on host "". I have jdk1.3 already...
5
5692
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
2621
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 Linux gains increasing acceptance in corporate datacenters and
3
11292
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 help would be appreciated: dmccarthy: file /opt/questasim_6.4/questasim/linux/libucdb.a /opt/
4
2928
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 is the "Driver". This node is connected using serial port to a linux PC. What I am trying to write is the software on this linux PC that will drive data transfer in the network. The "Driver" node, taking commands from the software running on...
2
9603
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 with valgrind, I am getting above error, any idea? lib/ -rw-r--r-- 1 0 0 27934 default.supp -rwxr-xr-x 1 0 0 4636305 cachegrind-x86-linux -rwxr-xr-x 1 0 0 4891451 callgrind-x86-linux...
0
9715
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10600
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9175
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7642
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6867
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5535
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4313
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3835
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.