- Home /
iOS linker error UnityGetGLViewController()
Hi,
I'm very new to ios/objective-c development and am trying to build an ios plugin that adds things to the screen when triggered by unity. I'm having a strange issue when trying to access the view controller. When I call UnityGetGLViewController() from method2, everything builds and is peachy. But when called from method1, which is linked to the cs file in Unity, I get this linker error:
Undefined symbols for architecture armv7: "_UnityGetGLViewController", referenced from: _method1 in TestClass.o ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)
Here is my code, stripped down for ease of reading:
//TestClass.m
#import "TestClass.h"
extern UIViewController *UnityGetGLViewController();
@implementation TestClass
void method1(NSString* path){
UIViewController *rootView = UnityGetGLViewController();
}
void method2(NSString* path){
UIViewController *rootView = UnityGetGLViewController();
}
@end
//iosPlugin.cs
using UnityEngine;
using System.Collections;
using System.Runtime.InteropServices;
public class iosPlugin : MonoBehaviour {
[DllImport ("__Internal")]
private static extern void method1 (string path);
void Start () {
method1("string here");
}
}
Any ideas as to why this is happening?
Answer by Seraphim-Whiteless · Jun 20, 2014 at 01:59 PM
was update prime31 srotekit plugin to lastest version. Works now.
Your answer
Follow this Question
Related Questions
Using NavigationController in an iOS plugin 1 Answer
How do I remove Google Plus from iOS Build only? 1 Answer
Plugins colliding with each other. 0 Answers
Call Unity class in XCode 1 Answer
iOS Launch Options 0 Answers