Encoding experience: Why will I have two addresses in my single piece?

xiaoxiao2021-03-06  55

Recently, I have encountered a problem, wasting me in the past day before I find the answer. My program is divided into three modules of A, B, C, each module compiled into a DLL. The C module is used in Singleton mode, A, and B modules are used separately, however, the module C is not working properly. The module C has been tested by a unit test and has been run well on other programs, and there is no bug. Everything doesn't seem to have a problem, just like this, I have been very distressed by a morning, there is no hair. Later, I printed the address of the C object in the A and B modules, and the surprised address of them was different! In other words, my single piece has two objects! This is simply impossible! I suddenly understand that there is a different version of the DLL, go to the project file, and sure, the module A is the Release version of the module, but the module B is the use of the Debug version, and the DLL called the two modules of AB is different. It is no wonder why there will be two addresses. Modify, problem solving.

It is this or the code is not wrong, just because the BUG caused by negligence, let me have no output, very frustrated. Published, I hope that you can do not repeat the same mistakes.

(Noiile)

转载请注明原文地址:https://www.9cbs.com/read-113497.html

New Post(0)