Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing mkbundle to port Mono GTK# app to other platforms
    primarykey
    data
    text
    <p>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.</p> <p>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 <em>must</em> to begin with. I am using the following libraries: </p> <pre><code>using System; using Gtk; using System.Net; using Mono.WebServer; using System.Diagnostics; </code></pre> <p>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 <em>Mono.Webserver</em> 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 <em>System.IO.FileNotFoundException</em> error occurred. Probably due to the same missing XSP library? </p> <p>Anyway, I looked around on the Internet and learned about <code>mkbundle</code>. I have performed the following setting as suggested by various forum threads: </p> <pre><code>export AS="as -arch i386" </code></pre> <p>I have navigated to the <em>/bin/Release</em> directory of my project and, then, run the following command: </p> <pre><code>mkbundle MivandoLocalServer.exe -o MivandoLocalServer --deps </code></pre> <p>But I am getting the following output, which eventually fails: </p> <pre><code>Compiling: as -arch i386 -o temp.o temp.s cc -g -o MivandoLocalServer -Wall temp.c `pkg-config --cflags --libs mono-2` temp.o 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 ‘assembly_bundle_MivandoLocalServer_exe’ temp.c:7: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token 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 ‘mono_register_bundled_assemblies’ 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’ [Fail] </code></pre> <p>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 <em>pkg-config</em> directory. Is this true? If yes, what will I have to do make it work? </p> <p>I hope that somebody will be able to help me. Thanks! </p> <p>Best regards, Sebastian</p> <p>PS. I have also posted this question in the forums at Mono's homepage but without any responses so far.</p> <p><strong>Update:</strong> I suspect MacPorts for interfering with my <em>pkg-config</em> directory setting. When I entered the following commands into my terminal, mkbundle allowed me to compile. But I am still encountering some problems.</p> <pre><code>export PKG_CONFIG_PATH="/Library/Frameworks/Mono.framework/Versions/Current/lib/pkgconfig/" export AS="as -arch i386" export CC="cc -arch i386" </code></pre> <p>Executing the following <code>mkbundle</code> command results in a Unix-archive of 4.9 MB that includes all the necessary dependencies. When I double-click on this new file on my Mac, a terminal window pops up and starts my app. Sweet! But this does not work in Windows nor in Ubuntu.</p> <pre><code>mkbundle MivandoLocalServer.exe -o MivandoLocalServerBundle --deps -z </code></pre> <p>What I would like to receive is a bundled executable that can be run in Windows and Ubuntu. So far I have not come across a solution that lets me do this. I tried to install MonoDevelop on my Windows 7 machine, copy my solution and build it there. But since my app is dependent on the <code>Mono.WebServer2</code> library, I am not able to build it on Windows. I have not been able to find the <code>Mono.WebServer2.dll</code> to download for Windows anywhere on the Internet.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload