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

  • Home
  • SEARCH
  • 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 6184261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:30:22+00:00 2026-05-24T01:30:22+00:00

I created a static cocos project in xcode, the entire project consisted of a

  • 0

I created a static cocos project in xcode, the entire project consisted of a single .c file called File.c and this function:

   int Get10()
   {
       return 10;
   }

I created a target for it called ‘Numbers’ and built the project, which created a libNumbers.a. I moved libNumbers.a to my MonoTouch projects root directory and in the additional mtouch arguments area I added:

-gcc_flags “-L${ProjectDir} -lNumbers -force_load
${ProjectDir}/libNumbers.a”

The code compiled fine.

So in a C# file in my MonoTouch project I added the following:

    [DllImport ("libNumbers.a")]
    private static extern int Get10 ();

(I’ve also tried doing [DllImport (“Numbers.a”)])

Then during exception a function called Get10(). This throws the following exception:

System.DllNotFoundException: libNumbers.a at (wrapper
managed-to-native) Jabber.BaseGame:Get10 () at Jabber.BaseGame.Draw
(Microsoft.Xna.Framework.GameTime dt) [0x00043] in
/Users/ahmedhakeem/Documents/Projects/goodjabberengine/MyCode/Engine/BaseGame.cs:103

From what I can see it looks like it’s unable to find the dll in question.

One possible cause is that I call the function Get10 (and import it) to a source file in a seperate library project (i.e. not the project I added the additional mtouch arguments). There is no way of adding mtouch arguments to a library project in monotouch which you’re linking in so I don’t think that’s an option.

So any ideas on how to fix this?

  • 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-05-24T01:30:25+00:00Added an answer on May 24, 2026 at 1:30 am

    If the library is linked with the app when the symbols becomes internal (inside the main app). In this case the correct declaration will be:

    [DllImport ("__Internal")]
    extern static void YourLinkedNativeCode ();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created a static library project which generates an a file. I included this
I've created a iPhone static library project with two targets like this Project -->
I have created a static library following this link . But I am facing
For example I now created a this tiny class: public static class FileSystemInfoComparers<T> where
I have created my own Attached Property like this: public static class LabelExtension {
I created a static Qt library by using VS2005. It created an extra file
I created some static html files (along with an index.html file) and put them
I have created some static functions that return integer. In my view I want
in Xcode 4, I created a sub project in my iOS project and made
I have an XCode 4.2 workspace containing a Cocos Touch Static Library (mixed Objective

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.