Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.
Paul A Bristow
I'm using NetBeans 7.2 on Windows 7 and can build and run gcc 4.6 toolchain OK, so I'm now trying to get a 4.7 version working.
So I've installed
and got as far as building a "hello world" my_program OK, but when I run from Netbeans I get
RUN FAILED (exit code 127)
Running my_program.exe (from the ../dist/debug/ folder) from a Windows command line brings up a Windows window with message:
"The procedure entry point __gxx_personality_sj0 could not be located in the dynamic link library libstdc++-6.dll"
I have version of libstdc++-6.dll in c:/mingw32/bin/ (and one in c:/mingw/bin too) dated 20 sep 12 (expected date), but it would seem not to be right?
My Path contains both c:\mingw\ bin and \c:\mingw32\bin.
Suggestions most welcome?
The libstdc++ DLL is linked to the libgcc DLL that comes with a toolchain. MinGW.org and MinGW-w64 use different settings for both, and you are mixing a libstdc++ DLL from MinGW.org with a libgcc from my build.
Never put two toolchains in your PATH. Point your IDE to the absolute path of the executables, or set up a per-toolchain environment with some sort of startup scripts that set the PATH correctly.
You can immediately resolve this problem by copying the proper libstdc++ (and libgcc, although this isn't strictly necessary) to the same directory as the exe you are trying to run.
Paul A Bristow
Thanks for this correct information. On reflection, I realised that having both in my PATH was a mistake. And copying the 'right' dll also works, as your suggest.
Also what I'd really, really like is to get the Clang compiler also working on NetBeans, preferably idiot-proof so that the toolchain is immediately recognised and the right .exes installed. As *nix newbie, I'm not sure I understand what to download and how to install. Are there are more novice-friendly blow-by-blow instructions available? do I need a beta or recent NetBeans version?
You can get a functional 32-bit Clang compiler which uses GCC 4.6.3's libstdc++ by downloading my packages:
- Clang 3.1
- GCC 4.6.3 dw2
Read the readme in the Clang 3.1 directory. You'll need to unzip both in the same directory (Clang uses "gcc.exe" for linking and searches relative to its location for the C++ and system headers).
As for Netbeans support: try cloning a GCC config and replacing all occurences of "gcc.exe" with "clang.exe" and "g++.exe" with "clang++.exe". IDE and build system support for Clang is weak, especially on Windows where it is even worse because everyone thinks Clang works with VS.
Paul A Bristow
I installed both into c:\mingw32-dw2 and created a new toolchain based at c:\mingw32-dw2/bin, and changed the two exes gcc.exe to clang.exe and c++.exe to clang++.exe.
This works to allow me to compile and run a 'hello world' and a Boost.test including the test_unit_test library (but fails to link to a library because I haven't built them using Clang yet ;-)