Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9015035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:39:06+00:00 2026-06-16T03:39:06+00:00

In my static lib project(target:sdk.a), I used an extern function like this: // in

  • 0

In my static lib project(target:sdk.a), I used an extern function like this:

// in the PlatformUnity.h file
extern "C"{
    extern UIView * UnityGetGLView();  
    extern UIViewController * UnityGetGLViewController();

}

// in the PlatformUnity.mm file (*.mm NOT the *.m)

UIView * funcA(){
    return UnityGetGLView();
}

UIViewController * funcB(){
    return UnityGetGLViewController();
}

In another project named Unity-iPhone.xcodeproj, I used the SDK.a .
And there’s a file named AppController.mm contains the code below:

static UIViewController* sGLViewController = nil;
UIViewController* UnityGetGLViewController()
{
   return sGLViewController;
}
static UIView* sGLView = nil;
UIView* UnityGetGLView()
{
    return sGLView;
}

When I build the Unity-iPhone.xcodeproj, It tells me that it can’t find the function UnityGetGLView(). link error below:

Undefined symbols for architecture armv7:
  "_UnityGetGLViewController", referenced from:_funcB in SDK.a(PlatformUnity.o)
  "_UnityGetGLView", referenced from:_funcA in SDK.a(PlatformUnity.o)

This two function are really defined in AppController.mm But why I can’t find it when link? The other linker flag of Unity-iPhone.xcodeproj is below:

-all_load -weak_framework CoreMotion -weak-lSystem
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T03:39:07+00:00Added an answer on June 16, 2026 at 3:39 am

    I was able to solve this problem. The reason was I hadn’t added extern “C” to “UnityGetGLViewController” method. Compiler was compiling it as C++ function but actually it has to be compiled as C function.

    i.e. Use following Code snippets

    extern "C"
    {
        extern UIViewController* UnityGetGLViewController();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a customized UIView class (a static lib) for some app
I have a static lib project with targets for iPhone and for os x.
I'm not sure why is this. I'm distributing a static *.lib across multiple projects,
In a Mixed 3.2.5 iOS/MacOS project, there is an existing iOS static library target,
I am working on project in Linux which involves 1) Static Lib in C++
I build opencv 233 as a static lib, but when i use it in
I have a collection of static libraries (.lib) files one of which may have
Why is it that some static libraries (lib*.a) can be linked in the same
It seems to not get past this step: [ 16%] Building CXX object src/CMakeFiles/hphp_runtime_static.dir/lib/system/gen/sys/dynamic_table_func.no.cpp.o
I'm trying to link with the static libc.a and a dynamic lib .so unsuccessfully.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.