I'm trying to run a program with command line arguments. I keep getting the following error:

This application has failed to start because libgcc_s_dw2-1-.dll was not found. Re-Installing the applicatiob may fix this problem.

I have no clue what to do with this. The code works on the school computers but neither my laptop nor my tower. Can anyone offer some help? I've looked on line, but the "solutions" were way too technical and far above my noob head - often I couldn't get past the jargon. I tried re-installing gcc to no avail, heck finding and installing a C++ compiler felt like a herculean task. Has anyone encountered this and if so could they possibly offer a simple (or simply stated solution?)

Are you using some external library? Anything other than the standard libraries? If so, verify that the libraries you are linking to have been built with the same version of MinGW (or close to it) as the one you are using. This "dw2" version of this DLL is an obsolete file newer versions don't use (and don't install), but if an external library that you use is built to still be using it, you'll get this kind of errors.

Hi. I'm sorry, this is the over my head part...as in, I'm not sure what you're asking, so my answer may seem weird, so please thanks for replying and bearing with my rookie-ness

This is a simple program I am writing:

#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{

    cout << argv[1];
    cout << argv[2];


}

The program is called cmmdLine - I've compiled it, and I get the the error when I run it from the command prompt - I go to the directory that has the .ccp, .obj, and .exe and run the exe - (also this happens when I double click the .exe -

OK - Figured it out.

For posterity and just in case anyone has the same problem.

A while back I installed Perl, and was doing some perl coding. That changed an enviornmental variable.

To resolve I:

(1) Went to the bin folder of MinGW
(2) Right clicked "My Computer" from the desktop icon (very important - not a shortcut)
(3) When to the advanced tab
(4) Went to enviornment variables
(5) and pasted the path to my MinGW bin folder.

I hope this (A) makes sense, and (B) Helps someone in the future, as I found it to be a very frustrating problem and I couldn't find the soluytion on line.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.