c# - Using mkbundle to port Mono GTK# app to other platforms -


i'm long-time c# developer new mono and, especially, gtk#. have developed small app using c# , gtk#. need app work on windows, linux , mac decided go mono and, far, seems cool framework.

what simple app start xsp web server based on local directory , port chosen user. ideally, app work without having install mono framework @ first, not must begin with. using following libraries:

using system;  using gtk;  using system.net;  using mono.webserver;  using system.diagnostics;  

i developing on mac (snow leopard, 10.6.7). executable works on mac. having problems ubuntu , windows. app works partly on ubuntu (11.04) -- starts , seems working fails when try start xsp web server, seems expectable mono.webserver not installed on ubuntu machine. on windows (7, 64-bit), app crashes when double-click on it. crash report tells me system.io.filenotfoundexception error occurred. due same missing xsp library?

anyway, looked around on internet , learned mkbundle. have performed following setting suggested various forum threads:

export as="as -arch i386" 

i have navigated /bin/release directory of project and, then, run following command:

mkbundle mivandolocalserver.exe -o mivandolocalserver --deps 

but getting following output, fails:

compiling:  -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 not found in pkg-config search path.  perhaps should add directory containing `mono-2.pc'  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 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 function)  temp.c:22: error: (each undeclared identifier reported once  temp.c:22: error: each function appears in.)  temp.c: in function ‘main’:  temp.c:114: warning: implicit declaration of function ‘mono_set_dirs’  [fail] 

i not know here. have macports installed , have read might cause problems regards pkg-config directory. true? if yes, have make work?

i hope able me. thanks!

best regards, sebastian

ps. have posted question in forums @ mono's homepage without responses far.

update: suspect macports interfering pkg-config directory setting. when entered following commands terminal, mkbundle allowed me compile. still encountering problems.

export pkg_config_path="/library/frameworks/mono.framework/versions/current/lib/pkgconfig/" export as="as -arch i386" export cc="cc -arch i386" 

executing following mkbundle command results in unix-archive of 4.9 mb includes necessary dependencies. when double-click on new file on mac, terminal window pops , starts app. sweet! not work in windows nor in ubuntu.

mkbundle mivandolocalserver.exe -o mivandolocalserverbundle --deps -z 

what receive bundled executable can run in windows , ubuntu. far have not come across solution lets me this. tried install monodevelop on windows 7 machine, copy solution , build there. since app dependent on mono.webserver2 library, not able build on windows. have not been able find mono.webserver2.dll download windows anywhere on internet.

first of situation covers 2 separate issues address separately:

  1. architecture - i386 only
  2. build , packaging

1. architecture

first of all, not windows , linux machines run on i386 architecture, make sure using 1 is. more i386, linux can run on many architectures , windows has ventured path (they supported in past, lost support) new tablet pc cpu types.

2. build , packaging

when targeting operating system there bound differences in packaging paths should build each target os target os. if want mkbundle work on windows whole toolchain needs installed there , windows requires special script right, since mkbundle made unix-like oss should work on linux without special considerations:

create c# executable mkbundle on windows

http://linux.die.net/man/1/mkbundle


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -