Mach-O linker error in Xcode 6.1

I am getting the following linker error only in Xcode 6.1, Xcode 6.01 works fine:

Undefined symbols for architecture x86_64:
  "__TWvdvC7Bamberg18TourViewController2mmT_", referenced from:
      __TFC7Bamberg18TourViewControllerm2mmT_ in tours.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

      

Now I know about standard sentences. I've tried exhaustively:

  • cleaning project and assembly
  • deleting derived data in the organizer and developer folder
  • removing the previous version of the app from the simulator and device
  • dropping simulator
  • setting "Build active architecture only" to "Yes / No"
  • play with compiler and architecture settings
  • adding every single structure that is possible (including adding them)
  • make sure all implementation files are included in "Compilation Sources"
  • I even recreated the entire project in XCode 6.1 to make sure it doesn't contain some hidden bug issues.

Finally, I was able to point the source of the problem to an imported Objective C class that bridged correctly - the error went away when I didn't use that class :( https://github.com/mrcrow/MRoundedButton )

If I immediately open the demo project of this class in 6.1 it works great. Therefore, I believe that it must be either a conflict of this class with my specific code when it is bridged, or a bridge error of this class with fast code in general.

Any help is greatly appreciated.

+3


source to share


1 answer


You seem to have a problem with your Swift code, or an error in the Swift compiler. The symbols your linker refers to are Swift symbols (denoted by a prefix __T

). When an instrument is transferred swift-demangle

, symbols are translated to:

_TFC7Bamberg18TourViewControllerm2mmT_ ---> Bamberg.TourViewController.mm.materializeForSet : ()
_TWvdvC7Bamberg18TourViewController2mmT_ ---> direct field offset for Bamberg.TourViewController.mm : ()

      



So in yours TourViewController

it seems to you that it refers to a field mm

, but the linker cannot find it. Perhaps you can rewrite / refactor your code to avoid / fix this problem.

+1


source







All Articles