• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
Question by q3er · Mar 19, 2014 at 06:10 AM · iospluginxcode

ios plugin Undefined symbols for architecture i386

Hi. i'm writing plugin for ios that geting device's location, download JSON from internet, and returning data back to unity.

I'm trying to test it on simulator (i have no ios device at the moment), but i'm geting the error.

 Undefined symbols for architecture i386:
   "__sendLocation", referenced from:
       RegisterMonoModules() in RegisterMonoModules.o
   "__sendWeather", referenced from:
       RegisterMonoModules() in RegisterMonoModules.o
   "__setPrefs", referenced from:
       RegisterMonoModules() in RegisterMonoModules.o
   "__start", referenced from:
       RegisterMonoModules() in RegisterMonoModules.o
 ld: symbol(s) not found for architecture i386
 clang: error: linker command failed with exit code 1 (use -v to see invocation)

I'm using Unity 4.3.4, xcode 5, simulator 6.1 and 7.0

I've wrote plugin in xcode, then draged .h and .m files in plugins/iOS in unity, in player settings in unity i set "simulator sdk", builded project and then changed RegisterMonoModules.cpp

 extern "C"
 {
     typedef void* gpointer;
     typedef int gboolean;
 #if !(TARGET_IPHONE_SIMULATOR)
     const char*            UnityIPhoneRuntimeVersion = "4.3.4f1";
     void                mono_dl_register_symbol (const char* name, void *addr);
     extern int             mono_ficall_flag;
     void                mono_aot_register_module(gpointer *aot_info);
     extern gboolean        mono_aot_only;
     extern gpointer*    mono_aot_module_Assembly_CSharp_firstpass_info; // Assembly-CSharp-firstpass.dll
     extern gpointer*    mono_aot_module_Assembly_CSharp_info; // Assembly-CSharp.dll
     extern gpointer*    mono_aot_module_Assembly_UnityScript_firstpass_info; // Assembly-UnityScript-firstpass.dll
     extern gpointer*    mono_aot_module_Mono_Security_info; // Mono.Security.dll
     extern gpointer*    mono_aot_module_System_Core_info; // System.Core.dll
     extern gpointer*    mono_aot_module_System_Xml_info; // System.Xml.dll
     extern gpointer*    mono_aot_module_System_info; // System.dll
     extern gpointer*    mono_aot_module_UnityEngine_info; // UnityEngine.dll
     extern gpointer*    mono_aot_module_mscorlib_info; // mscorlib.dll
 #endif // !(TARGET_IPHONE_SIMULATOR)
     void                mono_dl_register_symbol (const char* name, void *addr);
     void    _setPrefs();
     void    _start();
     void    _sendWeather();
     void    _sendLocation();
     void    UnityNSObject_RetainObject();
     void    UnityNSObject_ReleaseObject();
     void    UnityNSError_Code();
     void    UnityNSError_Description();
     void    UnityNSError_Reason();
     void    UnityNSNotification_Name();
 }
 void RegisterMonoModules()
 {
     gEnableGyroscope = false;
 #if !(TARGET_IPHONE_SIMULATOR)
     mono_aot_only = true;
     mono_ficall_flag = false;
     mono_aot_register_module(mono_aot_module_Assembly_CSharp_firstpass_info);
     mono_aot_register_module(mono_aot_module_Assembly_CSharp_info);
     mono_aot_register_module(mono_aot_module_Assembly_UnityScript_firstpass_info);
     mono_aot_register_module(mono_aot_module_Mono_Security_info);
     mono_aot_register_module(mono_aot_module_System_Core_info);
     mono_aot_register_module(mono_aot_module_System_Xml_info);
     mono_aot_register_module(mono_aot_module_System_info);
     mono_aot_register_module(mono_aot_module_UnityEngine_info);
     mono_aot_register_module(mono_aot_module_mscorlib_info);
 
     mono_dl_register_symbol("_setPrefs", (void*)&_setPrefs);
     mono_dl_register_symbol("_start", (void*)&_start);
     mono_dl_register_symbol("_sendWeather", (void*)&_sendWeather);
     mono_dl_register_symbol("_sendLocation", (void*)&_sendLocation);
     mono_dl_register_symbol("UnityNSObject_RetainObject", (void*)&UnityNSObject_RetainObject);
     mono_dl_register_symbol("UnityNSObject_ReleaseObject", (void*)&UnityNSObject_ReleaseObject);
     mono_dl_register_symbol("UnityNSError_Code", (void*)&UnityNSError_Code);
     mono_dl_register_symbol("UnityNSError_Description", (void*)&UnityNSError_Description);
     mono_dl_register_symbol("UnityNSError_Reason", (void*)&UnityNSError_Reason);
     mono_dl_register_symbol("UnityNSNotification_Name", (void*)&UnityNSNotification_Name);
 #endif // !(TARGET_IPHONE_SIMULATOR)
     mono_dl_register_symbol("_setPrefs", (void*)&_setPrefs);
     mono_dl_register_symbol("_start", (void*)&_start);
     mono_dl_register_symbol("_sendWeather", (void*)&_sendWeather);
     mono_dl_register_symbol("_sendLocation", (void*)&_sendLocation);
 }
 


What i'm doing wrong? Any clues?

Comment

People who like this

0 Show 0
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

  • Sort: 

Unity Answers is in Read-Only mode

Unity Answers content will be migrated to a new Community platform and we are aiming to launch a public beta by June 9. Please note, Unity Answers is now in read-only so we can prepare for the final data migration.

For more information and updates, please read our full announcement thread in the Unity Forum.

Follow this Question

Answers Answers and Comments

20 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Have to "Replace" iOS project every build because of Linker Errors 0 Answers

Creating a native photo picker screen on iOS 2 Answers

iOS Plugin - Possible to Register 2 subclasses of UnityAppController with IMPL_APP_CONTROLLER_SUBCLASS 0 Answers

Heart rate Bluetooth PLUGIN IOS 0 Answers

How to add Google Admob SDK for iOS in Unity editor (instead to do it manually in XCode)? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges