3

I'm trying to create a standalone of my C# app using mono's mkbundle, I got Xcode installed and the Mono Developer Kit too (I'm sure it's MDK not the runtime). Yet I run mkbundle using mkbundle test.exe

and I get these errors

Compiling:
as -o temp.o temp.s 
cc -g -o a.out -Wall temp.c `pkg-config --cflags --libs mono-2`  temp.o
sh: pkg-config: command not found
temp.c:1:10: fatal error: 'mono/metadata/mono-config.h' file not found

1 error generated.
[Fail]

What's happening?

Paul B.
  • 2,394
  • 27
  • 47
Duxducis
  • 317
  • 4
  • 17

2 Answers2

3

pkg-config is stored at '/Library/Frameworks/Mono.framework/Commands'.

Solution (see here and here):

Prepend the "/Library/Frameworks/Mono.framework/Commands" folder to your PATH variable:

export PATH=/Library/Frameworks/Mono.framework/Commands:$PATH

This is needed in addition to the architecture solution proposed by aiapatag and the objective-c runtime and CoreFoundation framework solution:

export AS="as -arch i386"
export CC="cc -arch i386 -framework CoreFoundation -lobjc -liconv"
Community
  • 1
  • 1
Tal Aloni
  • 1,429
  • 14
  • 14
1

It looks like the pkg-config tool is not found. Maybe it's not in the default paths.

Do you have a 'pkgconfig' directory somewhere? It should be a subdirectory of your Mono installation. Try to see if you have a path looking like /Library/Frameworks/Mono.framework/Versions/XXXX/lib/pkgconfig

If yes, point the PKG_CONFIG_PATH environment variable to this path, you can specify it directly when running your mkbundle command (this is just an example):

$ PKG_CONFIG_PATH=/Library/Frameworks/Mono.framework/Versions/XXXX/lib/pkgconfig mkbundle ....
mbarthelemy
  • 12,465
  • 4
  • 41
  • 43