[Gtk-sharp-list] Problems using mkbundle for bundling executables with dependencies

sebastianbk kraaijenzank at gmail.com
Sat Jul 2 17:11:03 EDT 2011

Hello everybody,

I'm a long-time C# developer but new to Mono and, especially, Gtk#. I have
developed a small app using C# and Gtk#. I need this app to work on Windows,
Linux and Mac so I decided to go for Mono and, so far, it seems to be a cool
framework. Thumbs up to the team and the contributors behind it!

What my simple app does is start up an XSP web server based on a local
directory and port chosen by the user. Ideally, I would like my app to work
without having to install the Mono framework at first, but this is not a
must to begin with. I am using the following libraries:

using System;
using Gtk;
using System.Net;
using Mono.WebServer;
using System.Diagnostics;

I am developing on a Mac (Snow Leopard, 10.6.7). My executable works
perfectly on my Mac. But I am having problems with Ubuntu and Windows. My
app works partly on Ubuntu (11.04) -- it starts up and seems to be working
but fails when I try to start the XSP web server, which seems expectable as
/Mono.Webserver/ is probably not installed on my Ubuntu machine. On Windows
(7, 64-bit), my app crashes immediately when I double-click on it. The crash
report tells me that a "System.IO.FileNotFoundException" occurred. Probably
due to the same missing XSP library?

Anyway, I looked around on the Internet and learned about *mkbundle*. I have
performed the following setting as suggested by various forum threads:

*export AS="as -arch i386"*

I have navigated to the /bin/Release directory of my project and, then, run
the following command:

*mkbundle MivandoLocalServer.exe -o MivandoLocalServer --deps*

But I am getting the following output, which eventually fails:

as -arch i386 -o temp.o temp.s 
cc -g -o MivandoLocalServer -Wall temp.c `pkg-config --cflags --libs mono-2` 
Package mono-2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `mono-2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'mono-2' found
temp.c:2:36: error: mono/metadata/assembly.h: No such file or directory
temp.c:5: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before
temp.c:7: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’
temp.c:18: error: ‘NULL’ undeclared here (not in a function)
temp.c: In function ‘mono_mkbundle_init’:
temp.c:22: warning: implicit declaration of function
temp.c:22: error: ‘bundled’ undeclared (first use in this function)
temp.c:22: error: (Each undeclared identifier is reported only once
temp.c:22: error: for each function it appears in.)
temp.c: In function ‘main’:
temp.c:114: warning: implicit declaration of function ‘mono_set_dirs’

I really do not know what to do from here. I have MacPorts installed and I
have read that this might cause some problems with regards to the
/pkg-config/ directory. Is this true? If yes, what will I have to do make it

I hope that somebody will be able to help me. Thanks!

Best regards,

View this message in context: http://mono.1490590.n4.nabble.com/Problems-using-mkbundle-for-bundling-executables-with-dependencies-tp3641145p3641145.html
Sent from the Mono - Gtk# mailing list archive at Nabble.com.

More information about the Gtk-sharp-list mailing list