0

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.

senderj
  • 400
  • 1
  • 9
  • 1
    It may that the problem is too old version of MSVCRT.DLl. Maybe the new Windows 7 PC isn't updated to Service Pack 1? Maybe you can work around by installing redistributable for later version of Visual C++? – Cheers and hth. - Alf Jan 08 '16 at 04:07
  • @Cheers, thanks for the reply. I installed Visual C++ 2013 Redistributable, but problem remains. I also reinstall MinGW in the new PC, but it seems making things worse. Now I can't even compile. Compiling any cpp 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` – senderj Jan 08 '16 at 09:44
  • Compiling outside NetBeans and at the cmd, it gives the same msg `The application was unable to start correctly (0xc0000013)`. Checked `MinGW\bin\g++.exe` with Dependency Walker, many delay dll were missing, such as `API-MS-WIN-CORE-WINRT-L1-1-0.DLL` – senderj Jan 08 '16 at 09:48
  • I ended up reinstall both NetBeans and MinGW. Now compiling in NetBeans is working. `Dependency Walker` is really out-dated. It reports missing `dll` even for a working `exe`. Thanks for the help. – senderj Jan 14 '16 at 03:04

0 Answers0