0

I'm building a pure Win32 program (no clr or any assembly) by VC 2012 (VC 2012 (VC11) as my compiler). It uses boost 1.58, wxWidget 3.0.2 series,gsl 1.8, jsoncpp, Open CV 2.4.10, etc... The development box is running Win7 64bits. I would like it to be a single executable and is able to run on both Win 7 32/64 so I built all of the above packages as libs myself by the same VC 2012. (thanks for cmake)...

It works fine on development box but not on a clean one that only installed VC redistribution packages. I got the error message box ask me to use the sxstrace and the message in event log has side-by-side error like below and I also tried the sxstrace and got similar error.

"D:\Release\xxxx.exe" 的啟用內容產生失敗。 找不到依存組合 Microsoft.VC90.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8"。 請使用 sxstrace.exe 進行詳細的診斷。

I've been searching around. All and answers simply says I should use all release build for all libs. Yes, it's true if I didn't I couldn't have the single executable at first place. It won't be able to link. (I learned it by made lots of mistakes) I've tried both MD or MT build for my program (not mix them together. They are separated test.). Either of the mode works. The same error remains. I've also installed over lots of VC2008 9.0.21022, -.30729.17, -30729.4148, -30729.6161, VC 2010 10.0.40219, VC 2012 11.0.61030 (x86/x64)

I really don't understand. It's pure win32 release build made by VC 2012. How come it requires VC90 debug dll?

I'll really appreciated if someone can give me more precise advice about how to resolve or even determine where and what goes wrong with the code or the lib I build.

Jason Hsu
  • 1
  • 1

3 Answers3

2

I will suggest that you use the following tool: Dependency walker.

By loading your executable on your PC (where it works) you should find out all the DLLs it uses and so discover any hidden dependencies in the (medium sized) library list on which your project depends (and in turn their dependencies).

This should help you point out DLLs that you have on your PC but not on freshly installed machines.

Niall
  • 30,036
  • 10
  • 99
  • 142
marom
  • 5,064
  • 10
  • 14
  • 1
    It seems that the DLL is already identified - it's a CRT debug dll. As far as I understand, the actual question is how come that it got linked into release build. – Nikolay Jul 16 '15 at 07:50
  • I've tried what you said. At the beginning I can see my program depends on msvcr110d.dll for some reason. After I add msvcrt.lib and msvcrtd.lib to the list of ignore library the dependecy gone (the debug dll is not VC90's) But the sxstrace error still remains. – Jason Hsu Jul 16 '15 at 08:00
0

A pure Win32 release build should not depend on DEBUG CRT dlls, that's for sure. The only project setting to control that is basically that MT/MD ("Runtime Library") setting. You want MT.

I would guess that you have the Debug CRT dll referenced somewhere in the source code (e.g. one of the libraries requires it to be linked in for whatever reason, maybe because there is #define DEBUG or something, thus overriding project settings.

You could try searching #pragma comment(lib, ...bla-bla-bla...) in the source code.

Nikolay
  • 10,752
  • 2
  • 23
  • 51
  • I'll try it later. I do use very limited #pragma comment(lib....) in my .cpps. If I use this syntax to refer a lib of a dll. Can this dll a debug version? – Jason Hsu Jul 16 '15 at 08:12
  • I'll try to search it later. I do use very limited #pragma comment(lib....) in my .cpps. But one addition question is, If I use this syntax to refer a few lib of dlls. Can this dll be a debug version? (btw, I just recall, I've walked through evey single dll my program directly use with the dependency walker, none of them depends on msvcr90d.dll. – Jason Hsu Jul 16 '15 at 08:26
  • You can refer any dll with this #pragma comment().. i.e. it does not care if it's debug or not. If none of your dlls depend on crt debug dll, then this must be the executable itself. You can try starting from a blank project, set /MD and then step by step look at the differences.. – Nikolay Jul 16 '15 at 08:49
  • Just try to load it with WinDbg. It works fine on my development box, however it still crashes on a clean box. On the clean box, I could not even see the information that it loads every dll but told me Connot load xxx.exe. I saw a short infor "win32 error on14001". I searched it from some other place. The error code says 'the application configuration is incorrect. Reinstall the application may fix this problem'. – Jason Hsu Jul 16 '15 at 11:24
0

It's resolved by myself. The project is about migrating a big legacy project. So there's a very small lib built by VC90 without source code. So be a detail person is the key to do this kind of job.

Jason Hsu
  • 1
  • 1