Home > Software engineering >  The same dynamic link libraries, the debug version of the line, but I can't release version
The same dynamic link libraries, the debug version of the line, but I can't release version

Time:10-10

Request master, master inspiration.

In vc + + 6.0 environment, I make a computing program into a dynamic link library, named (WSXDLL), generated in the debug state (WSXDLL. DLL and WSXDLL. Lib) debugging through, its external function can also be another application (usewsx) normal call to complete the operation, but the same (WSXDLL), generated in the release condition (WSXDLL. DLL and WSXDLL. Lib) is also can be application (usewsx) call, the computing error, here are some details description

A. compiled under the release condition (the WSXDLL) is through, but there are warning
Linking...
Creating library Release/WSXDLL lib and object Release/WSXDLL exp
LINK: warning LNK4089: all references to "GDI32. DLL" discarded by/OPT: REF
WSXDLL. DLL - 0 error (s),

B. (WSXDLL), the pile structure of data variables,
I found that, with the debug version of the (WSXDLL. DLL and WSXDLL. Lib), to heap allocation of physical memory, default values of the variables are piled to normal, such as the default value is the integer variables (842150451), but with the Release version of (WSXDLL. DLL and WSXDLL. Lib), to heap allocation of physical memory, variables are the default values are not normal, such as the default value is the integer variables (3736336) or (0), or even (- 1 # QNAN),
Note: to heap allocation of physical memory and release allocation in the physical memory is used correctly in the (WSXDLL), otherwise the debug version won't pass it,
[/size]

CodePudding user response:

The same library debug and release could not use normally, the debug in the library if the debug version, release, too

CodePudding user response:

The debug version and the version release allocated memory, convenient to debug the debug version will be on the basis of the original application memory allocation more teens space;
Estimate your program is memory management problems,

CodePudding user response:

- 842150451=CDCDCDCD is the debug to the variable initialization, you forgot to initialize,
Release don't initialize variables, so it's uncertain value, please check whether all variables initialized!

CodePudding user response:

Release will do some optimization, at the same time, there will be some initialization,
You'd better have the default initialization of variable values

Then there are the caller, DLL is the same best debug or release version
  • Related