How to add libz.dylib and libxml2.dylib frames to gcc_flags arguments in MonoTouch?

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

I tested the static library in an Xcode project and this test application compiles and works correctly. Now I'm trying to create the exact same sample application in MonoTouch, and I'm having problems with the correct gcc_flags arguments to include all the dependencies.

The following structures must be included in an Xcode application:

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 to find all the necessary header files: "$ (SDK_DIR)" / usr / include / libxml 2

Now in MonoTouch I have the following set in my gcc_flags in 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 to compile, I get a long list of binding errors, which, as far as I can tell, is caused by the fact that libz.dylib and libxml2.dylib are not included during binding. Does anyone know how I can ensure they are included in MonoTouch?

+4
source share
1 answer

Try adding "- lz -lxml2" to the -gcc_flags that you already have. This will instruct gcc to add libz and libxml2 when linking the application.

If this does not work, send the full build log (edit your message or fill out the bug report in bugzilla.xamarin.com and attach the build log).

+6
source

All Articles