473,385 Members | 1,370 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

DLL DEBUG MODE IN CPP

Here's the problem. I've been developing a C++ application since 2003 using
the default settings. Comes time to find all the memory leaks. I downloaded
a nifty package that won't work unless I use the debug library DLLs. I get
nothing but complaints from Visual Studio 2008. On <name-of-appProperty
Page I change Use of MFC to Shared DLL. This presents a problem. I am told
that the Linker is conflicted as follows: LINK : warning LNK4098: defaultlib
'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library. Oh my.
I told the IDE to do a debug compile and link. Apparently not all necessary
changes happened automagically. However, the build succeeded. Upon launch,
the loader complains as follows: This application has failed to start
because mfc90d.dll was not found. Re-installing the application may fix this
problem. Or --- it may not. Further fooling around produces complaints
about a manifest that either does not exist or contains nonsense. Question:
Is there a quick and easy way to shift from Standard Windows Libraries to DLL
Debug Mode that doesn't involve poke and hope?
--
William McIlroy

Aug 26 '08 #1
2 4070
--snip--

You cannot mix debug and release mode dlls, all modules
should be compiled with same switches. Also some preprocessor defines
must be same as they change the layout of internal classes.

Also you cannot deploy visual studio debug mode libraries,
you must debug on your own computer.

So you have created huge application with release mode only ? never
tested debug mode ? in debug mode there are quite a lot of checks which
help you to detect problems like memory leaks in early stages.

You can also use some memory leak detectors in release mode, e.g Purify
and GlowCode are such products, glowcode might still have demo version
to test.

ismo
Aug 26 '08 #2
I'm the original poster. It turns out the large C++ program that I developed
has suffered numerous automated migrations through Visual Studios 2003, 2005,
and 2008. The end result is a project that uses (the deprecated?) BSCMAKE to
do the build and there is no manifest. Troubles galore. And that is why it
was impossible for the IDE to create for me, as commanded, a working debug
version using the runtime DLLs. As a reminder, runtime debug DLLs are a
requirement of a 3rd-party product that is helpful in locating memory leaks,
which often arise in non-managed C++ projects. I'd really like to rewrite
the program in managed code, but I cannot do that now.

The solution was to call Microsoft. In discussions, jointly we decided the
best approach was to let Visual Studio 2008 create a brand new C++ console
project and feed it the old project source code (just the CPP and H files).
Immedately: problem solved!

The fly in the ointment was the unannounced default wide character set which
changed a clean compile to 350+ "errors." Eventually, I found the switch in
the IDE that turns Unicode off. All is now well. The 3rd party memory leak
finder works, too. But not under the 64-bit version of Vista. Well, you
can't have everything.
--
William McIlroy

"William McIlroy" wrote:
Here's the problem. I've been developing a C++ application since 2003 using
the default settings. Comes time to find all the memory leaks. I downloaded
a nifty package that won't work unless I use the debug library DLLs. I get
nothing but complaints from Visual Studio 2008. On <name-of-appProperty
Page I change Use of MFC to Shared DLL. This presents a problem. I am told
that the Linker is conflicted as follows: LINK : warning LNK4098: defaultlib
'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library. Oh my.
I told the IDE to do a debug compile and link. Apparently not all necessary
changes happened automagically. However, the build succeeded. Upon launch,
the loader complains as follows: This application has failed to start
because mfc90d.dll was not found. Re-installing the application may fix this
problem. Or --- it may not. Further fooling around produces complaints
about a manifest that either does not exist or contains nonsense. Question:
Is there a quick and easy way to shift from Standard Windows Libraries to DLL
Debug Mode that doesn't involve poke and hope?
--
William McIlroy
Aug 28 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mike C. Fletcher | last post by:
Every few months I get to working on a Python C extension (built with distutils) and discover a pointer error or the like where I'd like to be able to step into my DLL and see where the extension...
3
by: Max M. Power | last post by:
How can I tell if my C# code is running in debug mode? I need to execute some extra code only when my project has been compiled in debug mode. In release mode I don't want to execute this extra...
12
by: nospam | last post by:
All the documentation says that leaving an ASP.NET application in debug mode has a big performance hit. I can't detect any difference between debug and non-debug modes. Am I missing something or is...
7
by: Srinivasa Rao | last post by:
I have read in one article that when we compile the application in release mode, all the debug classes and properties will be automatically removed from the code. I tried to implement this thing by...
3
by: Rena | last post by:
Hi all, I have created a app. project and a library which will be used by the main project, however i do not know how to get into debug mode inside the library, although break point is set. is...
3
by: Haldun ALIML | last post by:
Suppose that you have below property in some class, #if DEBUG public string DebugInfo { get { return "INDEX : " + _name + "\n" + "Index Owner : " + _owner.Name + "\n" + "Index Column Count:...
6
by: pauldepstein | last post by:
To help me debug, I am writing a lot of information into a stream which I call debug. However, because of the large amount of time taken to print this information, I only want this printed while...
2
by: Dave Johansen | last post by:
I just converted a solution from Visual Studio 2003 to Visual Studio 2005 and the Debug mode seems to be running just fine, but the Release mode crashes on the following code: std::ifstream...
0
by: =?Utf-8?B?SmVmLnB0Yw==?= | last post by:
Hi, I am currently facing exactly the same issue with Visual Studio 2005. Did you find a way to solve this problem ? "AntonioSACE" wrote:
3
by: =?Utf-8?B?bG10dGFn?= | last post by:
We have developed a number of different applications (ASP.NET web site, Windows services, DLLs, Windows forms, etc.) in C# 2.0. We have developed and unit tested all these applications/components...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.