CorePlot MonoMac 绑定崩溃 [英] CorePlot MonoMac bindings crashing

查看:9
本文介绍了CorePlot MonoMac 绑定崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为 monomac 使用 CorePlot 0.9 绑定,但这似乎是一项艰巨的任务.monotouch 示例构建和运行没有任何问题,但我不需要那个.

I am trying to use the CorePlot 0.9 binding for monomac, but that seems to be a hard task. The monotouch sample builds and runs without any problems, but I don't need that one.

由于绑定中只有一个 CorePlotiOS.dll,我必须自己为 osx 构建一个,但首先,没有 bmake.exe,所以我必须先下载 monomac 源并自己构建它.然后我尝试构建 CorePlotOSX.dll 但这导致了一些编译问题.查看单声道触摸的构建脚本,我尝试使用这一行:

Since only a CorePlotiOS.dll was present in the binding, I had to build one for osx myself, but first of af all, no bmake.exe was present, so I had to download the monomac source and build it myself first. Then I tried to build the CorePlotOSX.dll but that caused some compilation problems. Looking at the build-script for mono touch I tried with this line instead:

MONO_PATH=$(MONOMAC)/src mono $(MONOMAC)/src/bmac.exe -e -unsafe coreplot.cs -s=enums.cs -x=extras.cs -x=AssemblyInfo.cs  --sourceonly=list --tmpdir=osx -r:System.Drawing -r:MonoMac -lib:$(MONOMAC)/src -baselib:$(MONOMAC)/src/MonoMac.dll .

有什么问题吗?

我已将问题简化为:

graph = new CPTPieChart(); 
graph.Title = "Test";

分配似乎仍然存在,但是每当我尝试访问该对象时,我都会崩溃:

The allocation seems to survive, but whenever I try to access the object, I crash:

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

VM Regions Near 0xbf887fac:
    Stack                  00000000b038d000-00000000b040e000 [  516K] rw-/rwx SM=COW  
--> Stack                  00000000bc088000-00000000bf888000 [ 56.0M] ---/rwx SM=NUL  
    Stack                  00000000bf888000-00000000c0088000 [ 8192K] rw-/rwx SM=COW  

Application Specific Information:
objc[17645]: garbage collection is OFF

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   com.apple.CoreFoundation        0x97c8aebc __CFStringEncodeByteStream + 12
1   com.apple.Foundation            0x9ac8ed49 -[NSString(NSStringOtherEncodings) getBytes:maxLength:usedLength:encoding:options:range:remainingRange:] + 263
2   com.apple.Foundation            0x9ac8e8ee bytesInEncoding + 213
3   com.apple.Foundation            0x9ac8e814 -[NSString(NSStringOtherEncodings) UTF8String] + 42
4   com.apple.CoreFoundation        0x97ce478c -[__NSCFString UTF8String] + 204
5   ???                             0x00f91208 0 + 16323080
6   ???                             0x030d708c 0 + 51212428
7   ???                             0x030d703c 0 + 51212348
8   ???                             0x016877d4 0 + 23623636

有什么想法吗?运行 Mac OSX 10.7.5 顺便说一句.

Any ideas? Running Mac OSX 10.7.5 btw.

推荐答案

好吧,这很难.经过几天与 xcode 和 monomac 的斗争,事实证明,没有加载原生 CorePlot 框架(动态库).我不知道,我应该自己加载它(我是一个 monomac 新手,对不起......但它是不是很丑陋,它以这种方式默默地失败了??)

Ok, that was hard. After several days of fighting xcode and monomac, it turned out, that the native CorePlot framework (dynamic lib) was not loaded. I was not aware, that I was supposed to load it myself (I am a monomac newbie, sorry...but isn't it rather ugly it fails silently in that way??)

有两种方法:要么

Dlfcn.dlopen ("CorePlot.framework/CorePlot", 2); // 2 = load now, 0 = lazy load

[assembly:MonoMac.RequiredFramework("CorePlot.framework/CorePlot")]

这篇关于CorePlot MonoMac 绑定崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆