获取/编译用于嵌入的Mono-2.0.dll [英] Getting/compiling Mono-2.0.dll for embedding
问题描述
我正在使用单声道在C应用程序中实现一些脚本(cf此页面 http:// www .mono-project.com / Embedding_Mono )。但是我需要使用单声道2.0.dll,以使其工作。
首先我以为它被包含在单声道的二进制分发中。但是我无法在单声道安装文件夹中找到它。
我也尝试构建单声道自己,但构建总是完成一个错误(未解决的符号,读写保护的文件,和许多其他)。我尝试了cygwin和VS构建。
快速搜索后,我发现有其他类似问题的人。但是不幸的是没有解决方案可以适用于我。
有没有解决方案来轻松编译mono-2.0.dll或获取二进制文件?
谢谢
编辑
IMHO您正在寻找的库可以在mono安装文件夹的bin目录中找到。实际上,在安装 mono 3.2.3 在$ code> MONO_INSTALLATION_PATH\bin\ 目录中有两个库: libmonoboehm-2.0。 dll
和 libmonosgen-2.0.dll
(您必须选择 Boehm 或 SGen GC实施)
您可以创建一个象这样的符号链接 libmono-2.0.dll - > /opt/mymono/bin/libmonoboehm-2.0.dll
如果你想使用Boehm实现。这是所有(我想)
但是,即使没有创建任何symolic链接,您也可以工作,您可以参考图书馆monoboehm-2.0.dll或monosgen-2.0.dll而不是单声道2.0.dll。问题是(我想)你正在寻找错误的图书馆的名字。
无论如何,以下是为了从cygwin编译单声道必须遵循的步骤。
END EDIT
我设法使用cygwin从Windows 8编译Mono我想,它也应该适用于Windows 7)
这些是我必须遵循的步骤,以完成单声道虚拟机和您所请求的库: / p>
-
下载并安装一个新的cygwin安装32位(不要使用cygwin的64位版本,即使你使用Windows 64位)在我的情况下,cygwin版本是
2.844(32位)
,我的操作系统是Windows 8 64位。即使您已经有了cygwin环境,应该更好(IMHO)去除它并安装新的cygwin环境。 -
cygwin的安装路径应该是(至少在我的情况下):C:\cygwin
-
使用cygwin,您必须安装一些运行setup-86.exe的依赖关系。没有他们,你将无法从cygwin编译单声道:
autoconf,automake,bison,gcc-core,gcc- g ++,mingw-gcc,libtool,make,python,automake,bison,gcc,gdb,gettext,intltool,libiconv,libtool,pkg-config,vim
-
打开cygwin控制台并运行以下命令:
Me @ mewin8〜
$ mkdir - p / opt / mono323
我@ mewin8〜
$ mkdir -p / opt / mymono
Me @ mewin8〜
$ cd / opt
Me @ mewin8 / opt
/ p>
$ git clone https://github.com/mono/mono.git
Me @ mewin8 / opt
$ cd mono
Me @ mewin8 / opt / mono
$ git submodule init
Me @ mewin8 / opt / mono
$ git checkout --track origin / mono-3.4.0-branch -
外部cygwin控制台下载单声道Windows(您将需要它w母鸡从cygwin编译mono): http://download.mono-project.com/archive/3.2.3/windows-installer/mono-3.2.3-gtksharp-2.12.11-win32-0.exe
-
在C:\cygwin\opt\mono323中为Windows安装单声道
-
再次转到cygwin控制台并运行以下命令:
Me @ mewin8〜
$ cd / opt / mono
Me @ mewin8 / opt / mono
$ export PATH = $ PATH:/ opt / mono323 / bin
Me @ mewin8 / opt / mono
$ ./autogen.sh --host = i686-pc-mingw32 --prefix = / opt / mymono /
Me @ mewin8 / opt / mono
$ make -
编译以错误结尾。看到这个主题: git的单声道将不会建立在cygwin 32 解决方案:
Me @ mewin8 / opt / mono
$ vim /usr/i686-pc-mingw32/sys-root/mingw/include/ddk/ntapi.h
注释掉这行
typedef PVOID PEXECUTION_STATE;
如果您遵循与我相同的步骤,则要注释的行应为数字49.您必须完成// typedef PVOID PEXECUTION_STATE;
-
重新开始编译:
Me @ mewin8 / opt / mono
$ make clean
Me @ mewin8 / opt / mono
$ make
Me @ mewin8 / opt / mono
$ make install -
您可能会在此路径中找到所请求的库(实际上您完成了两个):
-
实施使用Boehm GC :
/opt/mymono/bin/libmonoboehm-2.0.dll
-
实施使用SGen GC :
/ opt / mymono / bin / libmonosgen-2.0.dll
您可以创建一个象征性的链接这个:
/opt/mymono/lib/libmono-2.0.dll - > /opt/mymono/bin/libmonoboehm-2.0.dll
;或者像这样:/opt/mymono/lib/mono-2.0.dll - > /opt/mymono/bin/libmonoboehm-2.0.dll
(无论对您有用)
根据您将如何使用图书馆,符号链接可能对您而言很有趣。
-
-
此外,如果gcc / ld在尝试构建自己的程序时找不到您的库我的意思是你要嵌入单声道的程序),你正在尝试从cygwin控制台编译,你可以这样做:
export LD_LIBRARY_PATH = / opt / mymono / lib
请参阅: man ld
这就是我所知道的。希望它会帮助你...至少我尽力了!
I am trying to implement some scripting in a C application using mono (cf this page http://www.mono-project.com/Embedding_Mono). However I need mono-2.0.dll for this to work. First I thought it was included with binary distribution of mono. But i could not find it in mono installation folder.
I also tryied to build mono myself but the build always finishes with an error (unresolved symbols, read write protected files, and many others). I tryed both cygwin and VS builds.
After a quick search I found other people with similar problems. But unfortunatly no solutions that would work for me.
Is there a solution to easily compile mono-2.0.dll or to get binaries?
Thanks
EDIT
IMHO the library that you are looking for may be found in the bin directory of the mono installation folder. Actually, after installing mono 3.2.3 there are two libraries in the MONO_INSTALLATION_PATH\bin\
directory: libmonoboehm-2.0.dll
and libmonosgen-2.0.dll
(you must choose either Boehm or SGen GC implementation)
You could create a symbolic link like this libmono-2.0.dll -> /opt/mymono/bin/libmonoboehm-2.0.dll
if for example you want to use the Boehm implementation. And that is all (I think)
But you could work even without creating any symolic link, you could reference the library monoboehm-2.0.dll or monosgen-2.0.dll instead of mono-2.0.dll. The problem was (I think) you were looking for the wrong library's name.
Anyhow, what follows are the steps that must be followed in order to compile mono from cygwin.
END EDIT
I managed to compile Mono from Windows 8 using cygwin (I guess, it also should work with Windows 7)
These are the steps that I had to follow in order to finish having the mono virtual machine and your requested library:
Download and install a fresh cygwin installation for 32-bit (do not use the cygwin's 64-bit version even if you are using Windows 64-bit) In my case the cygwin version is
2.844 (32 bit)
and my operative system is Windows 8 64-bit. Even if you already have a cygwin environment it should be better (IMHO) to remove it and install and new fresh cygwin environment.The cygwin's installation path should be (at least in my case) in: C:\cygwin
Using cygwin you must install some required dependencies running setup-86.exe. Without them, you are not going to be able to compile mono from cygwin:
autoconf, automake, bison, gcc-core, gcc-g++, mingw-gcc, libtool, make, python, automake, bison, gcc, gdb, gettext, intltool, libiconv, libtool, pkg-config, vim
Open a cygwin console and run these commands:
Me@mewin8 ~ $ mkdir -p /opt/mono323
Me@mewin8 ~ $ mkdir -p /opt/mymono
Me@mewin8 ~ $ cd /opt
Me@mewin8 /opt $ git clone https://github.com/mono/mono.git
Me@mewin8 /opt $ cd mono
Me@mewin8 /opt/mono $ git submodule init
Me@mewin8 /opt/mono $ git checkout --track origin/mono-3.4.0-branch
Outside cygwin console download mono for Windows (you are going to need it when compiling mono from cygwin): http://download.mono-project.com/archive/3.2.3/windows-installer/mono-3.2.3-gtksharp-2.12.11-win32-0.exe
Install mono for Windows in C:\cygwin\opt\mono323
Go again to the cygwin console and run these commands:
Me@mewin8 ~ $ cd /opt/mono
Me@mewin8 /opt/mono $ export PATH=$PATH:/opt/mono323/bin
Me@mewin8 /opt/mono $ ./autogen.sh --host=i686-pc-mingw32 --prefix=/opt/mymono/
Me@mewin8 /opt/mono $ make
The compilation ends with error. See this thread: mono from git will not build on cygwin 32 Solution:
Me@mewin8 /opt/mono $ vim /usr/i686-pc-mingw32/sys-root/mingw/include/ddk/ntapi.h
Comment out this line
typedef PVOID PEXECUTION_STATE;
If you have followed the same steps as me, the line to be commented out should be the number 49. You must finish having//typedef PVOID PEXECUTION_STATE;
Restart compilation:
Me@mewin8 /opt/mono $ make clean
Me@mewin8 /opt/mono $ make
Me@mewin8 /opt/mono $ make install
You may find your requested library in this path (actually you finish having two):
Implementation using Boehm GC:
/opt/mymono/bin/libmonoboehm-2.0.dll
Implementation using SGen GC:
/opt/mymono/bin/libmonosgen-2.0.dll
You could create a symbolic link like this:
/opt/mymono/lib/libmono-2.0.dll -> /opt/mymono/bin/libmonoboehm-2.0.dll
; or like this one:/opt/mymono/lib/mono-2.0.dll -> /opt/mymono/bin/libmonoboehm-2.0.dll
(whatever works for you)Depending on how you are going to work with the library, the symbolic link could be interesting for you or not.
Besides, if gcc/ld may not find your library while trying to build your own program (I mean the program where you are going to embed mono) and you are trying to compile from a cygwin console you could do this:
export LD_LIBRARY_PATH=/opt/mymono/lib
See: man ld
This is all I know. Hopefully it will help you... At least I tried my best!
这篇关于获取/编译用于嵌入的Mono-2.0.dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!