How do debug if my application has the launching issue - visual-c++

we made one application on Visual Studio 2008 , it about to release. but now we are getting the crash while launching the application . could you please any give a suggestion how do i debug on this particular issue

You can run the Release build in the debugger, too. Turn on debug-info settings in both the compiler and linker tabs (I think that was not the default in vs2008 and there were two distinct places to set) but don't change any optimization options or other setting.
Then launch the program from the debugger. If the resulting EXE shows the crash when run normally but not when started via the debugger, there are more things to make the situations work the same (and that shows clues as to what is wrong, too). So let us know if that still doesn't reproduce.

There could be a lot of reasons for your application's Release is crashing.
Did you link proper Release libraries with your application in Visual Studio project configuration ?
Check your code for some missing Release specific code.
My best guess is you are not linking to proper libraries for the Release version of your application.
Also, one reason could be that your application may be trying to load some file that may not exist. This happens with me sometimes when my Release build of application does not find file that it needs (Eg: OpenGL application trying to load a shader file that is missing); and you don't check for errors.

Related

Why can't my program find the VC++ Runtime?

I'm trying to package Unison (not really my program) into an easy to use installer. Tl;dr: a screenshot.
When I install and run it on the test machine, it says This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix the problem.
The event log reveals that it can't find Dependent Assembly Microsoft.VC90.CRT.
Search reveals that the "missing" dll is in fact in C:\Windows\WinSxS
So what's wrong?

the program can not be started because MSVCR80D.dll is missing from your computer,try reinstalling the program to fix this issue

when i try to run a application developed in vc++ on windows7,i get popup window saying that"the program can not be started because MSVCR80D.dll is missing from your computer,try reinstalling the program to fix this issue."
I googled it,it says that this DDL may not be present in your system or it has been got corrupted,Now i searched this file, i get this file at 20 different folder in win7.
I am not getting which file has been corrupted or if it is missing then where it is mising?
can anybody tell in which folder ,this DDL is missing or might be corrupted?
Thanks in advance. .
You're trying to run a Debug version of your program on a machine which does not have VS installed. The MS*D.dll files are not redistributable - they are installed were VS is installed. If you want to run executables on other machines, compile them as Release. You might still need to deploy some files (depending on how you're linking to the CRT), but that won't be a problem.
Never ever distribute your DEBUG builds to customers. Always distribute Release build.
Yes, of course, in develoment environment having multiple machines, you may share Debug builds to other developers - provided others developers have debugging-tools (like VS) installed on their system along with Debug-binaries of shared DLLs (like MSVCRxx).
Are you using the same computer that compiled the program? If not, you need visual studio redistributable files to run it.
Search the internet for your version of visual studio or visual c++ redist, you'll find it.

Is it possible to check for the Visual C++ runtime at startup of an MFC application?

When an MFC application starts, is it possible to check for the Visual C++ runtime before the "application configuration" error is displayed?
I assume it must be done via pure Win32 API at some point before the CRT loads.
The error is coming from the operating system, before your program is even finished loading. There is no part of the program, not even initialization, which has run yet. Thus no way your program can eliminate the error message by itself.
Edit: You might be able to set the runtime DLL as a delay-loaded DLL to get your program loaded in the absence of the runtime. Then you'd have to substitute your own function for the .exe entry point and have it check for the existence of the runtime library. There are many technical difficulties associated with this approach, and I'm not even sure it would work at all - but it might be possible.
Well, you get that error because you're missing the redistributables. So instead of trying something like that, you should rather install the VC++ redistributables from Microsoft (as prerequisite for your application). I used to keep a list of the downloads here.

Why my App's Dll is not loading in win2000 and loading in XP

We have an installer application.
In that we have one dll related to our application.
We created setup with all respective files.
We used "Install Shield 6.3" and created a setup file.
After created build. The build is working in xp, not working in 2000.
It is showing error message as Couldn't load .dll only in win2000.
What could be the issue any idea?
Regards
Hara
It looks like one of the system/third party dll you are loading is either not available or of wrong version. Use a tool like dependency walker to check whether all the required dlls are available or not.
You have probbely missing prequsits that exits on XP but not on Win2000.
You need to run the Dependency Walker tool on Win2000 and load the problematic DLL, the tool will tell what is missing.
Try running installation with Filemon in the background, filtering with the missing DLL's name. Then, see where the DLL is searched for, and fix the problem. Hard to say without any further information, but first difference I have in mind is that the system folder in XP is C:\windows\system32, while in win2000 it is C:\winnt\system32. If you've hardcoded the system path for any reason, it might be the problem.

generate exe file

i have developed application in visual c++ 6.0,i have do exe of that application,i have done by using icnt.exe(install creator),but when i run my application exe file on other system which does't have the vc++ software it's showing dll files are missing,how could than i downloaded the dll files again it is asking other dll's files.i want run my application without installing vc++ software in windows,how can i solve it,plz help me i'm touble.
How to make Realease build? by default its debug build
thanks for reply.
As a wild guess, you have deployed the Debug build, which depends on DLLs that are not allowed to be shipped.
If that is the case, have VC6 create a Release build and deploy that.
You can verify which DLLs are required by your application with the depends.exe utility that came with Visual Studio.
Edit: The easiest way to get a release build when ready is to use the Batch Build command from the Build menu. It will let you pick among all of the known build types in the project, and choose to either build them clean (recommended) or to just bring them up to date.
It is also possible to switch the GUI to default to the Release build instead of Debug. That is the right thing to do if you actually need to run the debugger on the Release build. Note that both builds include debug symbols. The differences have more to do with which runtime libraries are linked, and certain optimizations such as making the assert() macro have no effect.

Resources