popen() error on Visual Studio environment (VS 2003, VS 2005, VS 2008)

Since this page is the most visited page, so i will translate what am doing here. If you had problem when calling the popen() function specially on windows environment, Here is how i solve this error :
The example error :
1>d:\myetc\research\main.cpp(4451) : error C3861: 'popen': identifier not found
1>d:\myetc\research\main.cpp(4510) : error C3861: 'pclose': identifier not found

the solution :
Insert
#include <conio.h>

if the error still exist/occur :
change FILE *gnuplotPipe = popen("gnuplot -persist","w");
into
FILE *gnuplotPipe = _popen("gnuplot -persist","w");

hope this help :)

Advertisements

6 thoughts on “popen() error on Visual Studio environment (VS 2003, VS 2005, VS 2008)

  1. Thank you, so much.
    Is the _ symbol, a way to use outdated or older ‘tools’?
    Refering to : “FILE *gnuplotPipe = _popen(“gnuplot -persist”,”w”);”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s