7

I bet my problem is very basic, so please excuse me as I'm not that experienced with Xcode, since I work in Unity and use ready plugins for our iOS projects, so not really needed to go deep in Xcode until now.

I want to write a very basic custom plugin, but cannot get Xcode to accept it. I followed the tutorial found on the Unity page, and added my .h and .m files to Assets / Plugins / iOS, where (as the tutorial states) they will be merged automatically into Xcode.

After building, Xcode throws two errors: *"Undefined symbols for architecture armv7: "__XY", referenced from: __Z19RegisterMonoModulesv in RegisterMonoModules.o"* And the same for armv6.

As I read in similar issues here, this is because the files are not added to the Xcode project, despite the fact, that they should be added automatically. In Xcode, I can see both my files in the Project Navigator. I also see my .mm file in the Build Phases list.

What's the problem?

onof
  • 17,167
  • 7
  • 49
  • 85
user1634098
  • 71
  • 1
  • 3
  • do you see the files in the project navigator (the section on the left in your XCode)? – Nitin Alabur Aug 29 '12 at 19:23
  • Try to restrict your build settings to build armv7 only. Do you have the device connected when the build process starts? – Kay Aug 30 '12 at 11:33
  • Other than the .m files listed under the Compile Sources (under Build Phases), if there is any library that has to be used with this plugin, is that listed under the Build Phases --> Link Binary With Libraries? my guess is that RegisterMonoModules.o is in one of the binaries/libraries thats needed for your .h .m files – Nitin Alabur Aug 30 '12 at 14:56

2 Answers2

1

Looks like you're having a linker error. If your files show up in XCode and in your Build Phase list, then make your #include statements are all in order.

cjcurrie
  • 624
  • 1
  • 4
  • 15
  • Ouch, I knew it was obvious... :) Is it System.Runtime.InteropServices I have to include? – user1634098 Jan 17 '13 at 10:00
  • Now as I look at my files, I see that I have included System.Runtime.InteropServices in my binder class. What else should I import? – user1634098 Jan 17 '13 at 10:20
  • Hard to say ... where is `RegisterMonoModules` in relation to your other headers? – cjcurrie Jan 17 '13 at 19:32
  • I was able to solve this yesterday, and the problem was that I was missing the .mm file to bind things together (I was following a scheme of a plugin I purchased), so my bad. – user1634098 Jan 18 '13 at 06:56
0

I had the same problem, adding source files to a xcode project. As there was no software that could do this job without clicking around in some heavily coloured interface I started a little project to add the files by hand (CLI): XCodeControl. It is a simply macos program that should just work, documents included.

ikrabbe
  • 1,909
  • 12
  • 25