Solved

Problem use DLL under Borland C++ 5.01

Posted on 1998-01-24
2
240 Views
Last Modified: 2008-02-26
I build single project with 1 APP and 3 DLL. If I link APP and DLLs with STATIC runtime library I get runtime error in operator new and delete. If I link APP and DLLs with DINAMIC runtime library -- no problem. Why? How correct this problem?
0
Comment
Question by:Nightmare090197
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 22

Accepted Solution

by:
nietod earned 100 total points
ID: 1178827
answer comming.
0
 
LVL 22

Expert Comment

by:nietod
ID: 1178828
I suspect that you have cases where one of the Dll (or EXE) allocates memory with new and another DLL (or EXE)frees it with delete.  If you have static linked libraries this won't work because each Dll and each Exe will have seperate "private" versions of the run-time library and therefore separate heaps for allocating objects.  When one Dll (or EXE) goes to free an object that was allocated by another Dll (or exe) it looks in its own heap and gets "confussed" and you crash.  If you use the Dll version of the runtime library, then there is only one "instance" of the library and therefore only one heap that is shared by the seperate Dlls and EXEs, thus no problem.  Solution--use the Dll runtime library.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question