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 4602980
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:04:27+00:00 2026-05-22T00:04:27+00:00

I have an monotouch application that includes an objective-c static library. The application runs

  • 0

I have an monotouch application that includes an objective-c static library. The application runs correctly on the simulator, but when I try run the app on my iPhone 3GS, it crashes on startup. These are the steps that I have taken to try get it working:

  • Compiled the static library in Xcode with Device specified and active architecture set at armv6 and at armv7 (I am not sure which is correct, but I tried both and neither worked).
  • Under the project info I set code signing identity to my developer key.
  • In MonoDevelop I have included the static library in the application project options by setting the additional monotouch arguments under iPhone build to have the following value (this is identical to what is set for iPhoneSimulator):

    -v -v -v -gcc_flags “-lstdc++ -I${ProjectDir}/Ultralite/Include -L${ProjectDir}/Ultralite -lUltralite -force_load ${ProjectDir}/Ultralite/libUltralite.a”

When I try run the application, it crashes on startup (so the application screen does not even appear). In MonoDevelop all that I see is the following exception message:

Exception of type 'Mono.Debugger.Soft.VMDisconnectedException' was thrown.

All that I see in the device log in Xcode is the following:

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_PROTECTION_FAILURE at 0x2fd00f24

If I remove the -gcc_flags option from the project options, then the application starts up, but crashes at the first attempt at accessing the static library. So it is definitely something to do with the static library that is causing the application to crash on startup.

I have no idea where to even begin with solving this, and so really need some help on this one. Anyone got any ideas as to what is wrong with the static library that I am including, or know where I can get more information about what is going wrong? The KERN_PROTECTION_FAILURE message in the crash report is really not giving me much to work with.

Update:
I have created a simple Hello World application which has one button, which when clicked calls a method sayHello in a static library. Even with this basic example I encountered the same problem; namely that it runs on the simulator but not on the actual device. I have uploaded my helloworld example to github. I would really appreciate it if someone could help me in getting this working. Here is the Hello World sample:

https://github.com/BruceHill/HelloWorld

This includes a folder for the basic application, a folder with the objective-c static library and then finally a folder for the btouch definition. I call btouch with the parameter -outdir=. to build Messaging.g.cs and UltraliteManager.g.cs which I then include in the MonoTouch application.

  • 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-22T00:04:28+00:00Added an answer on May 22, 2026 at 12:04 am

    I had to make two changes to get this working correctly on the iphone:

    1. linker behavior in the build options had to have the option Link all assemblies set.
    2. I had to add -framework Security to the gcc_flags.

    So additional monotouch arguments under the build options had to have the following value:

    -v -v -v -gcc_flags “-framework Security -lstdc++ -I${ProjectDir}/Ultralite/Include -L${ProjectDir}/Ultralite -lUltralite -force_load ${ProjectDir}/Ultralite/libUltralite.a”

    The reason I had to add the Security framework is that it seems MonoTouch includes this framework when Don’t link is specified in the build options, but does not include it when the other two options are set. I determined this by comparing the build logs for the different options.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made the decision to use monotouch to develop an application that browses
I am working on a .NET app that will also run on iphone via
I have a C# application which needs to be ported to several Smartphones. Monotouch
I have a new web app that is packaged as a WAR as part
I have not been working with Monotouch (or the iphone for that matter) for
I'm using Mono Touch to develop a landscape-only iPad application but the simulator doesn't
Is it possible to link a C# library compiled using monotouch with an objective-C
I have a project where I need to build a C# application that is
I'm writing an iPhone application using Monotouch and recently the app has started crashing
Have you used VS.NET Architect Edition's Application and System diagrams to start designing a

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.