I’m using MinGW (originally installed with mingw-get-inst-20120426.exe) in combination with Eclipse for C/C++ (Indigo SR2) under Windows 7 Starter 32bit and I’ve just upgraded to gcc/g++ 4.7.0 :
mingw-get update
mingw-get upgrade
I fixed the problem of Eclipse keeping the old version’s reference ( https://bugs.eclipse.org/bugs/show_bug.cgi?id=206372#c2 )
But when I try to run a program as simple as this one, it crashes:
#include <iostream>
#include <cstdlib>
using namespace std;
int main (int argc, char* argv[])
{
cout << "one = " << 1 << "\n";
return EXIT_SUCCESS;
}
When I tried debugging, the problem seems to come from the cout line:
cout << "one = " << 1 << "\n";
If I step over it, Eclipse signals me this error:
No source available for "libstdc++-6!_ZNSo9_M_insertIlEERSoT_() at 0x6fc868a8"
Here is a screenshot of the IDE just after clicking “Step Over” that line: https://i.stack.imgur.com/QexxQ.png
The same program worked fine before, but now it doesn’t.
I’ve even created a new project (I didn’t touch anything in the compiler/linker options), but the same problem remains.
Does anyone have a solution, please ?
Thank you in advance for your help 🙂
Found it ! 😀
As mentioned by Dennis it appears that the runtime dll is different than the one using when linking.
Actually, Eclipse linked against C:\mingw\bin\libstdc++-6.dll but when executing, another one was used (i.e. C:\Program Files\gnuplot\bin\libstdc++-6.dll >_<) because gnuplot (that I installed a long time ago, nice piece of software by the way 😉 ) added its installation directory to the PATH (even though C:\mingw\bin was in the PATH too) (it added some other environment variables as well)
I was so mad, I removed everything related to gnuplot lol (i.e. its path from PATH, its environment variables and I uninstalled the program). I also removed Cygwin (even though it wasn’t in the PATH, but I haven’t use it for a long time, so…)
Then, I upgraded to 4.7
I also did the Eclipse thing
And now everything is fine:
🙂
If it helps, I used Dependency Walker to determine what runtime dll was used by the executable (just load the exe in Dependency Walker, then, right-click on LIBSTDC++-6.DLL > Properties )