0

I'm trying to compile an application of mine on Debian Wheezy, but I'm running into some odd behavior when I try debug it with gdb. I never experienced this problem when compiling on Squeeze.

I'm able to run the app just fine after I've built it, but if I try attaching gdb, I get one of two errors:

  • Dwarf Error: wrong version in compilation unit header (is 0, should be 2, 3, or 4)

  • Dwarf Error: Could not find abbrev number 1

I've never encountered this error before. It sounds like the symbols are messed up somehow.

My application has a dependency on various third-party libraries (enet, crypto++, jsoncpp, expat, boost-1.54, swiften) that I build manually on the same box. I link them all statically to my application.

I'm using g++ (Debian 4.7.2-5) 4.7.2.

How do I go about figuring out what's causing the symbols to get all messed up?

dreijer
  • 654
  • 8
  • 22
  • http://stackoverflow.com/questions/11671009/dwarf-error-wrong-version-in-compilation-unit-header-is-4-should-be-2 – Anthony Kong May 17 '14 at 06:01
  • None of the suggestions in the post you linked to seem to apply to me. I'm compiling with -g all the way through and the version of gdb on the system matches the version of gcc. FWIW, I created a Debian Squeeze from scratch, compiled my project again (exactly the same code with the same dependencies), and voila, it worked. – dreijer May 17 '14 at 16:10
  • Did you ever find a solution? I'm running into a similar problem when linking in libjingle (which also includes several of the same libraries as you are). – Patrick McKinnon Aug 05 '14 at 16:19
  • I didn't, sadly. I ended going back to Squeeze and compiling there and everything worked fine when using the older version of gcc. I'm leaning toward a compiler/linker bug, but I don't use Linux enough to confirm that. – dreijer Aug 06 '14 at 00:07
  • 1
    I too have found myself in this situation. – Jake Mar 28 '18 at 17:57

0 Answers0