2011-10-06 59 views
3

我試圖在Ubuntu上構建一個庫(Medsphere.Widgets),並且它向我拋出一個錯誤。我有一個很好的搜索,但沒有人似乎有任何答案。配置腳本工作正常,並且沒有警告或錯誤。當我去運行make,它這樣做:單聲道/ Ubuntu - 衝突的定義

[email protected]:~/Projects/Medsphere/$ make 
Making all in src 
make[1]: Entering directory `/home/polynomial/Projects/Medsphere/src' 
/usr/bin/mcs /target:library /out:Medsphere.Widgets.dll -r:/usr/lib/pkgconfig/../../lib/cli/pango-sharp-2.0/pango-sharp.dll -r:/usr/lib/pkgconfig/../../lib/cli/atk-sharp-2.0/atk-sharp.dll -r:/usr/lib/pkgconfig/../../lib/cli/gdk-sharp-2.0/gdk-sharp.dll -r:/usr/lib/pkgconfig/../../lib/cli/gtk-sharp-2.0/gtk-sharp.dll -r:/usr/lib/pkgconfig/../../lib/cli/glib-sharp-2.0/glib-sharp.dll -r:/usr/lib/mono/2.0/Mono.Cairo.dll ./CPaned.cs ./FBox.cs ./GridView.cs ./CairoHelper.cs ./IconLayout.cs ./ICairoCellRenderer.cs ./BoxCellRenderer.cs ./PixbufCellRenderer.cs ./TextCellRenderer.cs ./graph/AxisLocation.cs ./graph/AxisSizeGroup.cs ./graph/BaseTreeModelPlot.cs ./graph/DateTimeAxis.cs ./graph/EventPlot.cs ./graph/Graph2D.cs ./graph/Graph.cs ./graph/GtkStyleProvider.cs ./graph/HistogramPlot.cs ./graph/IAxis.cs ./graph/IPlot.cs ./graph/IStyleProvider.cs ./graph/ITreeModelPlot.cs ./graph/LabelAxis.cs ./graph/Legend.cs ./graph/LinearAxis.cs ./graph/LinePlot.cs ./graph/LinkedLinePlot.cs ./graph/PlotColor.cs ./graph/PointShape.cs ./graph/ReferenceRangePlot.cs 
./IconLayout.cs(414,25): error CS0029: Cannot implicitly convert type `Cairo.Context' to `Cairo.Context' 
./IconLayout.cs(414,25): The type `Cairo.Context' has two conflicting definitions, one comes from `Mono.Cairo, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' and the other from `Mono.Cairo, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' (in the previous error) 
Internal(1,1): The type `Cairo.Context' has two conflicting definitions, one comes from `Mono.Cairo, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' and the other from `Mono.Cairo, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' (in the previous error) 
./IconLayout.cs(920,41): error CS1502: The best overloaded method match for `Gdk.CairoHelper.SetSourceColor(Cairo.Context, Gdk.Color)' has some invalid arguments 
/usr/lib/cli/gdk-sharp-2.0/gdk-sharp.dll (Location of the symbol related to previous error) 
./IconLayout.cs(920,41): error CS1503: Argument `#1' cannot convert `Cairo.Context' expression to type `Cairo.Context' 
./IconLayout.cs(920,41): (equally named types possibly from different assemblies in previous error) 
/usr/lib/mono/gac/Mono.Cairo/2.0.0.0__0738eb9f132ed756/Mono.Cairo.dll (Location of the symbol related to previous error) 
/usr/lib/mono/gac/Mono.Cairo/1.0.5000.0__0738eb9f132ed756/Mono.Cairo.dll (Location of the symbol related to previous error) 
Compilation failed: 3 error(s), 0 warnings 

我只能想象,開羅的兩個版本是矛盾的,但我無法弄清楚如何解決它。有任何想法嗎?

+0

嗯,看起來很奇怪。全局程序集緩存應該認識到它們對於不同版本的CLR是相同的庫並選擇一個。 –

+0

對不起,我的意思是'mcs'。不知道爲什麼我用'gcc'標記它。適當地重新標記。 – Polynomial

+0

我嘗試用'/ usr/lib/mono/gac/Mono.Cairo/2.0.0.0__0738eb9f132ed756/Mono.Cairo.dll'替換'/ usr/lib/mono/Mono.Cairo.dll'的所有實例,但那並沒有解決它。 – Polynomial

回答

0

只是爲了澄清這一個:

我修改config.status使用gmcs而不僅僅是mcs和修補所有Mono.Cairo引用,使它們指向的特定版本的DLL,而不是一般的人在GAC。在lib中修改了幾個cast bug後,它非常棒!