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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T14:14:35+00:00 2026-05-24T14:14:35+00:00

I have an Objective C static library that I am trying to import into

  • 0

I have an Objective C static library that I am trying to import into MonoTouch using btouch. The problem that I am encountering, though, is that the library depends on libz.dylib and libxml2.dylib and I do not know how to include these frameworks in my MonoTouch application.

I have tested the static library in an XCode project and this test application compiles and runs correctly. I am now trying to build exactly the same sample application in MonoTouch, and am having problems getting the gcc_flags arguments right so that all the dependencies are included.

In the XCode application, the following frameworks needed to be included:

 UIKit.framework
 CFNetwork.framework
 CoreGraphics.framework
 Foundation.framework
 MobileCoreServices.framework
 SystemConfiguration.framework
 libz.dylib
 libxml2.dylib

Also, in XCode, I had to include the following search path for it to find all the required header files: “$(SDK_DIR)”/usr/include/libxml2

Now, in MonoTouch I have the following set in my gcc_flags under the build options:

 -v -v -v -gcc_flags "-framework CFNetwork -framework CoreGraphics -framework Foundation -framework MobileCoreServices -framework SystemConfiguration -I${ProjectDir}/lib/include -I$(SDK_DIR)/usr/include/libxml2 -L${ProjectDir}/lib/ -lOfflineRequest -force_load ${ProjectDir}/lib/libOfflineRequest.a"

When I try compile I get a long list of linking errors, which as far as I can tell are caused by libz.dylib and libxml2.dylib not being included during the linking. Does anyone have any idea how I can ensure that these get included in MonoTouch?

  • 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-24T14:14:36+00:00Added an answer on May 24, 2026 at 2:14 pm

    Try adding “-lz -lxml2” to the –gcc_flags you already have. That will instruct the gcc to add libz and libxml2 when linking the application.

    If this does not work then please post the full build log (edit your message or fill a bug report in bugzilla.xamarin.com and attach the build log).

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

Sidebar

Related Questions

I have an Objective-C/Cocoa project that incorporates a static library. That static library has
I have an xcode Objective-C iPhone static library project. When I build it in
I have been using Objective-C for a little while but being from a static
We have a collection of commercial MFC/C++ applications which we sell using Stingray Objective
Is it possible to have a C static library API, which uses C++ internally
in my iphone app, I am linking with a static library containing objective c
I'm implementing callback routines for external static C++ library to be used in Objective-C
I have a couple of static Phone/iPad libraries I an working on. The problem
I have just jumped into Objective-C and I got stuck pretty early on. I
I'm trying to confirm whether static variable initialization in Objective-C works the same as

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.