2

I'm trying to make a bundle of a simple fsharp code on mac OS X v. 10.12.1, and I get an error, when I run the result. The references to similar _kCFLocaleCountryCode errors that I can find, does not seem to match my problem. Any help would be much appreciated.

Thanks, Jon


The code is an fsharp script test.fsx:

printfn "%d" 10

compiled with F# Compiler for F# 4.0 (Open Source Edition), form Mono 4.4.1 (mono-4.4.0-branch-c7sr0/4747417. What happens is enclosed below.

$ 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
$

1 Answers1

0

Try this

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

Then test

./test
Morten Frederiksen
  • 5,114
  • 1
  • 40
  • 72
  • Thanks, but something is different now - I must unknowingly have updated something relevant. I now get a different error both with the suggested compiler settings, and with the default: `Package mono-2 was not found in the pkg-config search path`. I've installed mono via Xamarin, and I've search all the places I can think of (`find`, macports, google), without finding it. Any ideas? – Jon Sporring Jan 16 '17 at 08:50
  • Sounds like the original issue has been solved. Then you should create a new question for the new issue you are having. – Morten Frederiksen Jan 16 '17 at 20:09