I have C++ projects on Windows 7 + NetBeans + MinGW. They worked very well for years. Yesterday, because of hardware problem, I have to use a new Windows 7 PC. I installed NetBeans with imported profile from old installation. I copy MinGW and my project folders over to the new PC. But then none of them works.
I create a Hello World C++ program. Clean & Build on NetBean ok, but when Run it said RUN FAILED
. Run it on dos prompt, it said The application was unable to start correctly (0xc0000013)
. Changed the file extension of the source from .cpp
to .c
, it works fine. Searched the net, found [MS-ERREF].pdf
the error code means STATUS_NO_MEDIA_IN_DEVICE
which doesn't seem related.
Search further, found a software Dependency Walker
, run it and found that Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.
Went through the DLL tree and found 3 export points missing: InterlockedExchange in KERNEL32.DLL
, __p__environ in MSVCRT.DLL
and __p__fmode in MSVCRT.DLL
. I can find __p__environ
in MinGW's include\stdlib.h
but not __p__fmode
.
Some posts said that mixing 64 bits dll with 32 bits appn may be the cause. But my projects are all mixed and they worked well in my old PC. Appreciate if anyone can tell me where to look for the causes.
EDIT:
Further testing my Hello World
program and found that if I use cpp header, like #include <cstdlib>
or #include <iostream>
, the compiler cannot find them. So I re-install MinGW but it makes things worse. Now I cannot even compile any cpp, with or without cpp's #include
. Clean & Build the program lead to
make.exe[2]: *** [build/Debug/MinGW-Windows/TestCPP.o] Error 1
make.exe[2]: Leaving directory `/f/NetBeans_Projects/test-cpp'
make.exe[1]: *** [.build-conf] Error 2
make.exe[1]: Leaving directory `/f/NetBeans_Projects/test-cpp'
make.exe": *** [.build-impl] Error 2
Please help.