1

I have just updated to XCode 4.4 and now get this linker-error:

Undefined symbols for architecture armv7:
  "_objc_copyCppObjectAtomic", referenced from:
      -[CLASSNAME box2DBodiesList] in CLASSFILENAME.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Whereas: @property (readonly) std::vector box2DBodiesList;

This is an iOS-app.

Any clue?

1 Answers1

4

I had the same problem when I upgraded to XCode 4.4.

The problem is probably that the property is declared as readonly, but you assign a value to it inside your class implementation, probably in an initializer.

You can solve this by declaring the property as readwrite in your header file, or redeclaring it as readwrite inside a class category declaration in your implementation file (.mm), like this

@interface CLASSNAME()
@property(readwrite) std:vector box2DBodiesList;
@end

The missing function _objc_copyCppObjectAtomic is used when copying CPP objects (to readwrite properties with a C++ datatype), and is excluded when the property is marked as readonly (no copying needed).

Hope this helps!

/AndLen

AndLen
  • 56
  • 2
  • 4
    Thanks a lot! Well your solution did not work but pointed me in the right direction. I added "nonatomic" to the property-declaration and now my project compiles fine. Thanks agan! – user1563726 Jul 31 '12 at 18:00