Search code examples
c++cmysql-connectormysql-connect

How to know library is debug library or release?


I am using mysql cpp library . I checkout the recent copy from there bzr trunk and used cmake to generate library .

First time I used release mode and second time I used debug mode to build. The both library have

a mysql_debug.cpp
U mysql_debug

Is there a way to check in program (C or C++ code) or using nm that library is Release library or Debug library


Solution

  • I have seen false negatives with nm so I do not trust it. When I want to check to see if an object file has debug info I run objdump -x on the object file or library and look to see if there are headers that say dbg, stabs, or dwarf. This is not the most elegant solution by any means, but it has never been wrong and it is real easy to see the difference in when you have a debug and release build to compare.