2016-11-22 56 views
2

我想在mac OS X v。10.12.1上做一個簡單的fsharp代碼包,當我運行結果時出現錯誤。我可以找到類似的_kCFLocaleCountryCode錯誤的引用,似乎不符合我的問題。任何幫助將非常感激。mkbundle的結果拋出「找不到符號:_kCFLocaleCountryCode」

謝謝,喬恩


的代碼是一個fsharp腳本test.fsx:

printfn "%d" 10 

與F#編譯器編譯爲F#4.0(開源版),形成單4.4.1(單4.4.0分支 - c7sr0/4747417。會發生什麼情況如下封閉。

$ fsharpc test.fsx 
F# Compiler for F# 4.0 (Open Source Edition) 
Freely distributed under the Apache 2.0 Open Source License 
$ mkbundle --deps test.exe -o test 
OS is: Darwin 
Sources: 1 Auto-dependencies: True 
    embedding: /Users/sporring/repositories/PoP/fsharp/src/20161122_winforms/test.exe 
    embedding: /Library/Frameworks/Mono.framework/Versions/4.4.1/lib/mono/4.5/mscorlib.dll 
    embedding: /Library/Frameworks/Mono.framework/Versions/4.4.1/lib/mono/gac/FSharp.Core/4.4.0.0__b03f5f7f11d50a3a/FSharp.Core.dll 
    embedding: /Library/Frameworks/Mono.framework/Versions/4.4.1/lib/mono/gac/System.Core/4.0.0.0__b77a5c561934e089/System.Core.dll 
    embedding: /Library/Frameworks/Mono.framework/Versions/4.4.1/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll 
    embedding: /Library/Frameworks/Mono.framework/Versions/4.4.1/lib/mono/gac/Mono.Security/4.0.0.0__0738eb9f132ed756/Mono.Security.dll 
    embedding: /Library/Frameworks/Mono.framework/Versions/4.4.1/lib/mono/gac/System.Configuration/4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll 
    embedding: /Library/Frameworks/Mono.framework/Versions/4.4.1/lib/mono/gac/System.Xml/4.0.0.0__b77a5c561934e089/System.Xml.dll 
    embedding: /Library/Frameworks/Mono.framework/Versions/4.4.1/lib/mono/gac/System.Security/4.0.0.0__b03f5f7f11d50a3a/System.Security.dll 
    embedding: /Library/Frameworks/Mono.framework/Versions/4.4.1/lib/mono/gac/Mono.Posix/4.0.0.0__0738eb9f132ed756/Mono.Posix.dll 
    embedding: /Library/Frameworks/Mono.framework/Versions/4.4.1/lib/mono/gac/System.Numerics/4.0.0.0__b77a5c561934e089/System.Numerics.dll 
AS = as (default) 
[execute cmd]: as -o temp.o temp.s 
Compiling: 
CC = cc (default) 
[execute cmd]: cc -g -o 'test' -Wall temp.c `pkg-config --cflags --libs mono-2` temp.o 
Done 
$ ./test 
dyld: Symbol not found: _kCFLocaleCountryCode 
    Referenced from: /Library/Frameworks/Mono.framework/Versions/4.4.1/lib/libmonosgen-2.0.1.dylib 
    Expected in: flat namespace 
in /Library/Frameworks/Mono.framework/Versions/4.4.1/lib/libmonosgen-2.0.1.dylib 
Abort trap: 6 
$ 

回答

0

試試這個

export AS="as -arch i386" 
export CC="cc -arch i386 -framework CoreFoundation -lobjc -liconv" 
mkbundle --deps test.exe -o test 

然後測試

./test 
+0

謝謝,但現在的東西不一樣 - 我必須在不知不覺中已經更新了相關的事情。 我現在得到了一個與建議的編譯器設置不同的錯誤,並且使用默認值:'package mono-2未在pkg-config搜索路徑中找到。我已經通過Xamarin安裝了單聲道,並且我搜索了所有我能想到的地方('find',macports,google),但沒有找到它。有任何想法嗎? –

+0

聽起來像原來的問題已經解決。那麼你應該爲你遇到的新問題創建一個新的問題。 –