如何在Visual Studio 2008中构建IKVM?

7
我已经从http://www.ikvm.net/下载了IKVM源代码,并从http://sourceforge.net/cvs/?group_id=69637下载了。现在我正在尝试在Visual Studio 2008中构建它,但卡住了。有人知道有关如何构建该项目的文档,或者甚至可以给我指点吗?
我已尝试打开ikvm8.sln,它会打开所有项目,但尝试构建解决方案会导致许多“找不到类型或名称空间”的错误。
如您所料,我并不是Visual Studio专家,而是习惯于在Eclipse中使用Java。
因此,我要么需要分步说明,要么需要一个链接,以了解在Visual Studio中如何构建IKVM的过程。
如果您需要更多信息,请告诉我。感谢任何帮助!
编辑:我还尝试了手动执行“MsBuild.exe IKVM8.sln”,但也出现了大量错误。
JniInterface.cs(30,12): error CS0234: The type or namespace name 'Internal' does not exist in the namespace 'IKVM' (a
re you missing an assembly reference?)
JniInterface.cs(175,38): error CS0246: The type or namespace name 'ClassLoaderWrapper' could not be found (are you mi
ssing a using directive or an assembly reference?)
JniInterface.cs(175,13): error CS0246: The type or namespace name 'ClassLoaderWrapper' could not be found (are you mi
ssing a using directive or an assembly reference?)

编辑 #2: 我注意到有一个 "ikvm.build" 文件,所以我在文件夹上下载并运行了nant,这使我进一步了解了一步。一些东西开始成功构建,不幸的是,现在我遇到了以下错误:

ikvm-native-win32:

            [mkdir] Creating directory 'C:\Documents and Settings\...\My Documents\ikvm\ikvm\native\Release'.
               [cl] Compiling 2 files to 'C:\Documents and Settings\...\My Documents\ikvm\ikvm\native\Release'.
        BUILD FAILED
        C:\Documents and Settings\...\My Documents\ikvm\ikvm\native\native.build(17,10):
        'cl' failed to start.
           The system cannot find the file specified
        Total time: 0.2 seconds.
编辑 #3: 通过将cl.exe放入路径中解决了问题,但仍然存在其他错误。 请注意,这全部是为了在控制台上构建它,例如使用Nant。没有办法在Visual Studio中构建吗?那太遗憾了... 编辑 #4: 下一步是安装GNU classpath 0.95,现在看起来我需要一个特定的OpenJDK安装... Linux AMD64?!
             [exec] javac: file not found: ..\..\openjdk6-b12\control\build\linux-amd64\gensrc\com\sun\accessibility\internal\resources\accessibility.java
             [exec] Usage: javac <options> <source files>
             [exec] use -help for a list of possible options

编辑 #5: 从作者那里得到了答案。请查看下面或http://weblog.ikvm.net/CommentView.aspx?guid=7e91b51d-6f84-4485-b61f-ea9e068a5fcf。让我们看看它是否有效...

编辑 #6 正如我所担心的,下一个问题是:"无法打开windows.h",请参见单独的问题here

最终编辑:找到解决方案!将Platform SDK文件夹添加到Lib和Path环境变量后,我描述的解决方案对我有用。

3个回答

1

我不确定这个方法是否适用于你,但你可以尝试从命令行构建。

msbuild ________

我认为由于相同的问题,这就是我构建此应用程序的方式。


0

这是我如何从源代码构建IKVM 8.1.5717.0的方法。不需要使用Visual Studio。


0

好的,我刚刚从作者那里收到了以下回复:http://weblog.ikvm.net/CommentView.aspx?guid=7e91b51d-6f84-4485-b61f-ea9e068a5fcf

如果您想从cvs构建,那么您需要自己解决问题。但是,如果您使用官方版本,就可以更轻松地从源代码构建。

如果您从SourceForge下载ikvm-0.36.0.11.zip、classpath-0.95-stripped.zip和openjdk-b13-stripped.zip(后两者在ikvm 0.36.0.5版本下),则拥有了所有所需的源代码。

现在,您需要打开Visual Studio 2008命令提示符(即具有cl.exe和peverify路径的命令提示符)。

然后,在ikvm根目录中,执行“nant clean”,然后执行“nant”。这应该会构建整个项目。完成后,您应该能够在Visual Studio中进行构建(仅限调试目标),但您可能需要修复项目中的程序集引用(除非您已将ikvm安装在c:\ikvm中)。

祝好! Jeroen

编辑:在确保Platform SDK文件夹位于Path和Lib环境变量中后,此方法对我有效。谢谢,Jeroen!


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接