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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:56:56+00:00 2026-05-27T19:56:56+00:00

I have simple static lib in xcode with the only class test.h: @interface TestClass

  • 0

I have simple static lib in xcode with the only class
test.h:

@interface TestClass : NSObject {
    NSString *SomeString;
}
@property(nonatomic, readwrite, copy) NSString *SomeString;
- (NSString *) getString;
- (int) getInt;
@end

test.m:

@implementation TestClass

@synthesize SomeString;

- (id)init
{
    if ((self = [super init]) == nil)
        return nil;

    SomeString = @"test string value";
    return self;
}

- (NSString *) getString {
    return @"Lorem ipsum dolor sit amet";
}
- (int) getInt {
    return 123;
}

@end

I’ve copied TstClass from the dll generated by btouch. if i’m using original dll’s implementation:

[Register ("TestClass", true)]
public class TstClass : NSObject

variables Handle, ClassHandle etc are nulls, but app runs and returns nulls as a getInt, getString and SomeString. if I change definition to

[Register ("TestClass")]
public class TstClass : NSObject

inner variables are valid (meaning not null), but app crashes with no output when I’m trying to call a TstClass’s function.

During my research I’ve found someone has fixed this by unchecking “thumb” option in XCode build setting, but I can not find anything that looks like thumb in xcode project. (just in case: XCode 4.2 build 4C199; and I’m using latest version of Monotouch)

How do I create static lib in xcode and use it with monotouch? what’s wrong with my code?

and the last question: I have a .a and its .h files. is there an easier way to generate bindings from library and header files?

  • 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-27T19:56:57+00:00Added an answer on May 27, 2026 at 7:56 pm

    it took some time to figure out how to make it work.

    • Make sure lib and app target architectures are the same. (I had armv7 for lib and armv6 for app)

    • Make sure build targets are the same (was iOS device for lib and iOS simulator for app. iOS simulator target sets architecture to i386, which makes lib and app build incompatible)

    • for some reason additional mtouch arguments requires “-cxx -gcc_flags” and not just “-gcc_flags”;

    • for some reason .a lib was not linked without “-force_load” argument;

    • add “-v -v -v” to additional mtouch arguments to see full build log. That helped a lot to find this solution.

    • Thumb instructions set must be disabled (fixed by adding User-defined project option GCC_THUMB_SUPPORT:NO)

    that’s it!

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

Sidebar

Related Questions

I have a binary file - Windows static library (*.lib). Is there a simple
I have a very simple code: package mygame; public class RunGame { public static
We have a very simple ASP.NET web application comprising mostly static content and a
I have a very simple CLR Function for doing Regex Matching public static SqlBoolean
Very simply put: I have a class that consists mostly of static public members,
I have a static library Xcode 4 project that includes a home-brewed rendering engine,
I have simple method in C# : public static string BetweenOf(string ActualStr, string StrFirst,
I have simple Groovy category class which adds method to String instances: final class
I have a simple log4j.property file and a simple program that use log4j. But
Every sample that I have seen uses static XML in the xmldataprovider source, which

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.