0

I have compiled a static library via the command line using llvm-g++-4.2. When I attempt to link against that library and build an app within XCode, I get this:

Undefined symbols for architecture armv7: (null): "__ZN12NamespaceOne5NamespaceTwo10NamespaceThree11functionEPDv2_x", referenced from: ...

(Note that I'm obfuscating the actual namespace and function names)

When I look at the library using nm, I see this:

000007cc T __ZN12NamespaceOne5NamespaceTwo10NamespaceThree11functionEPU8__vectorx

The method is defined, but the mangled name differs slightly at the end. Is it the case that XCode (which is using clang++) doesn't like my llvm-g++-4.2 library?

automatom
  • 275
  • 2
  • 10
  • see http://stackoverflow.com/questions/6429494/undefined-symbols-for-architecture-armv7 for potential solutions – bengoesboom May 17 '13 at 15:51

2 Answers2

0

I'm going to guess that this library is C++ code, and you are trying to access it from an Objective-C (or C) file. You need to create some kind of buffer to it using a "C++" file (xxx.cc) or a Objective-C++ (xxx.mm) class.

David H
  • 40,852
  • 12
  • 92
  • 138
0

So after some additional tinkering, it looks like the issue was indeed that I used llvm-g++ to compile the static library and clang to build the application. Changing the app's compiler to llvm-g++ worked. Thanks all!

automatom
  • 275
  • 2
  • 10