process.h fails compilation

I’m using Arduino 1.6.6. I just want to try process.h to run shell command line from Arduino. I compiled (by clicking the Verify button on the Arduino GUI) C:\arduino-1.6.6-windows\arduino-1.6.6\libraries\Bridge\examples\Process\Process.ino and I get this error. How do I fix this issue? Thanks

compilation error:

In file included from C:\arduino-1.6.6-windows\arduino-1.6.6\libraries\Bridge\src/Process.h:22:0,

from C:\arduino-1.6.6-windows\arduino-1.6.6\libraries\Bridge\examples\Process\Process.ino:16:

C:\arduino-1.6.6-windows\arduino-1.6.6\libraries\Bridge\src/Bridge.h: In member function ‘void BridgeClass::put(const String&, const String&)’:

C:\arduino-1.6.6-windows\arduino-1.6.6\libraries\Bridge\src/Bridge.h:39:15: error: ‘const class String’ has no member named ‘c_str’

put(key.c_str(), value.c_str());

^

C:\arduino-1.6.6-windows\arduino-1.6.6\libraries\Bridge\src/Bridge.h:39:30: error: ‘const class String’ has no member named ‘c_str’

put(key.c_str(), value.c_str());

^

exit status 1
Error compiling.

This report would have more information with
“Show verbose output during compilation”
enabled in File > Preferences.

This is how the code looks like
#include <Process.h>

void setup() {
// Initialize Bridge
Bridge.begin();

// Initialize Serial
Serial.begin(9600);

// Wait until a Serial Monitor is connected.
while (!Serial);

// run various example processes
runCurl();
runCpuInfo();
}

void loop() {
// Do nothing here.
}

void runCurl() {
// Launch “curl” command and get Arduino ascii art logo from the network
// curl is command line program for transferring data using different internet protocols
Process p; // Create a process and call it “p”
p.begin(“curl”); // Process that launch the “curl” command
p.addParameter(“http://www.arduino.cc/asciilogo.txt”); // Add the URL parameter to “curl”
p.run(); // Run the process and wait for its termination

// Print arduino logo over the Serial
// A process output can be read with the stream methods
while (p.available() > 0) {
char c = p.read();
Serial.print(c);
}
// Ensure the last bit of data is sent.
Serial.flush();
}

void runCpuInfo() {
// Launch “cat /proc/cpuinfo” command (shows info on Atheros CPU)
// cat is a command line utility that shows the content of a file
Process p; // Create a process and call it “p”
p.begin(“cat”); // Process that launch the “cat” command
p.addParameter("/proc/cpuinfo"); // Add the cpuifo file path as parameter to cut
p.run(); // Run the process and wait for its termination

// Print command output on the Serial.
// A process output can be read with the stream methods
while (p.available() > 0) {
char c = p.read();
Serial.print(c);
}
// Ensure the last bit of data is sent.
Serial.flush();
}

You really should have read the How to use this forum - please read post at the top of the index page and How to use this forum before posting.

ie Your code and any error messages should always be placed between code tags. Posting it inline as you have done makes it much harder to read or copy and paste for diagnosis.

It's still not too late to edit your post and do this. You'll make potential helpers much happier. :slight_smile:

I’m not getting any errors… 1.6.6 on OSX 10.11.1.

Do you get errors with this?

#include <Process.h>
void setup() { }
void loop() { }