473,405 Members | 2,300 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,405 software developers and data experts.

c99 and popen()

I just tried to compile a program that has popen() and pclose() in it,
with -std=c99 in gcc. And it returns that it is an implicit declaration of
function popen, so it's probably not in the stdio.h include which it is
from c90. How do I get popen() in c99?

/Fredrik

Feb 3 '06 #1
3 4002
"Fredrik Svensson" <fr***@dtek.chalmers.se> wrote in message
news:Pi*******************************@senter.dtek .chalmers.se...
I just tried to compile a program that has popen() and pclose() in it,
with -std=c99 in gcc. And it returns that it is an implicit declaration of
function popen, so it's probably not in the stdio.h include which it is
from c90. How do I get popen() in c99?


It's a Posix function. Inspect that header to see if there's some
macro you have to define to enable the declaration of popen.
Otherwise, you're probably out of luck.

P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com
Feb 3 '06 #2
Fredrik Svensson wrote:
I just tried to compile a program that has popen() and pclose() in it,
with -std=c99 in gcc. And it returns that it is an implicit declaration
of function popen, so it's probably not in the stdio.h include which it
is from c90. How do I get popen() in c99?


popen and pclose are not part of standard C so if you want to use them
you need to do some implementation specific magic. comp.unix.programmer
might be a good place to ask.
--
Flash Gordon
Living in interesting times.
Although my email address says spam, it is real and I read it.
Feb 3 '06 #3
in comp.lang.c i read:
"Fredrik Svensson" <fr***@dtek.chalmers.se> wrote in message
news:Pi*******************************@senter.dte k.chalmers.se...
I just tried to compile a program that has popen() and pclose() in it,

It's a Posix function. Inspect that header to see if there's some
macro you have to define to enable the declaration of popen.


even better, follow the posix guidelines for enabling features. which you
can discuss with other posix/unix-ish programmers in comp.unix.programmer.

--
a signature
Feb 5 '06 #4

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

Similar topics

2
by: Stuart McGraw | last post by:
When I run (Python 2.3.3) this script on a MS Windows 2000 machine: import os print "1st popen..." f = os.popen ("echo " + u"\u0054\u0045\u0053\u0054.txt") print f.read () print "2nd popen..."...
17
by: bastiaannaber | last post by:
I am trying to write a program which uses popen but I have a problem. I want to detect if the program I call with popen has ended. For example: #include <stdio.h> #include <sys/types.h>...
2
by: Maarten van Veen | last post by:
A long story made short, I've build a python/cgi website consisting of two pages. Page1 has a html form in which you can input a series of queries. Then via Popen it starts a pythons search script,...
2
by: Greg Ercolano | last post by:
When I use os.popen(cmd,'w'), I find that under windows, the stdout of the child process disappears, instead of appearing in the DOS window the script is invoked from. eg: C:\type foo.py import...
3
by: Jesse | last post by:
Hi all, I have a problem using wget and Popen. I hope someone can help. -- Problem -- I want to use the command: wget -nv -O "dir/cpan.txt" "http://search.cpan.org" and capture all it's...
12
by: Eric_Dexter | last post by:
I am trying to modify a programming example and I am coming up with two problems... first is that I can't seem to pass along the arguments to the external command (I have been able to do that with...
15
by: Daniel Klein | last post by:
I'm trying to get popen to work on Windows. Here's a simplified example of what I'm trying to get working: I have a hw.c program as follows: #include <stdio.h> main() { printf ("Hello...
25
by: Jeremy Banks | last post by:
Hi. I wondered if anyone knew the rationale behind the naming of the Popen class in the subprocess module. Popen sounds like the a suitable name for a function that created a subprocess, but the...
1
by: Mark Shewfelt | last post by:
Hello, I am attempting to use Popen() in a Windows service. I have a small Win32 .exe that I normally run through the os.popen2() function. I've written a class to work with the input and output...
3
by: Roger Davis | last post by:
Hi, I am brand-new to Python but am an experienced C/Unix programmer. I am rewriting in Python some old shell scripts that do lots of stuff like set output = `cat this | grep that | whatever...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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
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,...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...

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.