Error using wget in c++ -
I have downloaded wget from gnuwin32 and I try to run commands in C ++ program using the system () function I am here. I have Visual Studio because I am using the Windows OS 2012 my compiler runs on wget command line, but when I put it in the system function is my error " 'wget' internal or external command, operative program or batch file Has not been identified in the form "
Here is my code:
#include & lt; Cstdlib & gt; # Include & lt; Iostream & gt; #include & lt; String & gt; using namespace std; int main () {string str = string ("wget -O test.csv \" http: // ") +" somewebsitelink \ ""; Const char * x = str.c_str (); Cout & lt; & Lt; Str & lt; & Lt; Endl; System (x); System ("pause"); Return 0; } In fact, the visual studio is probably overwriting your normal path. Simply put the complete path manually:
The system ("c: / path / wget ...");
Comments
Post a Comment