?
Solved

Problem use DLL under Borland C++ 5.01

Posted on 1998-01-24
2
Medium Priority
?
242 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 300 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

771 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