Originally posted by: SystemAdmin
[EdKlotz said:]
I've notice that most of the setup advice for Visual Studio includes not having _DEBUG as a preprocessor flag. However, without this flag, I cannot use the function _CrtDumpMemoryLeaks to, well, dump my memory leaks. This is because the preprocessor removes all calls to _CrtDumpMemoryLeaks when _DEBUG is not set.
What documentation are you referring to? The c_cpp.html file that comes with the distribution?
I do see the following there:
Select General:
* In the Additional Include Directories field, add the directories:
o <CPLEXDIR>\include.
o <CONCERTDIR>\include.
[color=red]* [u]For Debug Information Format, choose Disabled (/Zd).[/u][/color]
* Choose No for Detect 64-bit Portability Issues.
However, I don't think this implies that including _DEBUG as a preprocessor flag will create problems.
Rather, this configuration is intended for production applications once the development is done.
On the other hand, I don't think all of the Concert classes in the C++ API will be accessible via
the debugger. If you use the IloArray template to define arrays, I don't think you will be able to
set watch points to access them directly. But, if your reason to use _DEBUG is to use
_CrtDumpMemoryLeaks, that may not be an issue. Just keep in mind that the compiler may not
be able to instrument all of the items declared using Concert classes and templates.
Finally, if you do want to watch items that come from an IloArray template, you can always
assign them into an item declared using a simple typedef:
IloNumArray ExpedCost(env);
...
IloNum b = ExpedCost[i];
Although you can't watch the IloNumArray, you can put a watch on the IloNum.
#CPLEXOptimizers#DecisionOptimization