如何让IKVM在Visual Studio 2008中构建?

时间:2023-01-14 22:48:27

I've downloaded the IKVM sources (http://www.ikvm.net/) from http://sourceforge.net/cvs/?group_id=69637

我从http://sourceforge.net/cvs/?group_id=69637下载了IKVM源(http://www.ikvm.net/)

Now I'm trying to get it to build in Visual Studio 2008 and am stuck. Does anyone know of documentation of how to build the thing, or could even give me pointers?

现在我试图让它在Visual Studio 2008中构建并且卡住了。有没有人知道如何构建这个东西的文档,或者甚至可以给我指点?

I've tried opening the ikvm8.sln, which opens all the projects, but trying to build the solution leads to a bunch of "type or namespace could not be found" errors.

我试过打开ikvm8.sln,打开所有项目,但是试图构建解决方案会导致一堆“类型或命名空间无法找到”错误。

As you can probably guess I'm no Visual Studio expert, but rather am used to working with Java in Eclipse.

你可能猜测我不是Visual Studio专家,而是习惯在Eclipse中使用Java。

So again, I'm looking for either: step-by-step instructions or a link to documentation on how to build IKVM in Visual Studio.

同样,我正在寻找:逐步说明或指向如何在Visual Studio中构建IKVM的文档的链接。

Let me know if you need any more info. Thanks for any help!

如果您需要更多信息,请与我们联系。谢谢你的帮助!

Edit: I've also tried a manual "MsBuild.exe IKVM8.sln", but also get a bunch of:

编辑:我也尝试过手册“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?)

Edit #2: I noticed a "ikvm.build" file so I downloaded and ran nant on the folder, which got me a step further. A few things start to build successfully, unfortunately I now get the following error:

编辑#2:我注意到了一个“ikvm.build”文件,所以我下载并运行了该文件夹,这让我更进了一步。一些事情开始成功构建,不幸的是我现在得到以下错误:

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.

Edit #3: OK solved that by putting cl.exe in the path, still getting other errors though. Note this is all for building it on the console e.g. with Nant. Is there no way to get it to build in Visual Studio? That would be sad...

编辑#3:确定通过将cl.exe放在路径中,但仍然遇到其他错误。请注意,这只是用于在控制台上构建它,例如与南特。有没有办法让它在Visual Studio中构建?那会很难过......

Edit #4: Next step was installing GNU classpath 0.95, and now it looks like I need a specific OpenJDK installation... Linux AMD64?!

编辑#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

Edit #5: Got an answer from the author. See below or at http://weblog.ikvm.net/CommentView.aspx?guid=7e91b51d-6f84-4485-b61f-ea9e068a5fcf Let's see if it works...

编辑#5:得到了作者的回答。见下文或http://weblog.ikvm.net/CommentView.aspx?guid=7e91b51d-6f84-4485-b61f-ea9e068a5fcf让我们看看它是否有效......

Edit #6 As I feared, next problem: "cannot open windows.h", see separate question here.

编辑#6正如我所担心的,下一个问题:“无法打开windows.h”,请在此处查看单独的问题。

Final Edit: Found Solution! After getting the Platform SDK folders in the Lib and Path environment variables, the solution I described below worked for me.

最终编辑:找到解决方案!在Lib和Path环境变量中获取Platform SDK文件夹之后,我在下面描述的解决方案对我有用。

3 个解决方案

#1


1  

I don't know that this would do it for you but can you try building from the command line?

我不知道这会为你做,但你能尝试从命令行构建吗?

msbuild ________

I think that's how I built the application due to the same issues.

我认为这是我如何构建应用程序由于相同的问题。

#2


0  

OK just got the following reply from the author: http://weblog.ikvm.net/CommentView.aspx?guid=7e91b51d-6f84-4485-b61f-ea9e068a5fcf

好的,刚收到作者的以下回复:http://weblog.ikvm.net/CommentView.aspx?guid = 7e91b51d-684 -4485-b61f-ea9e068a5fcf

If you want to build from cvs, you're on your own. However, you can more easily build from source if you use an official release.

如果你想用cvs构建,你可以自己动手。但是,如果您使用官方发行版,则可以更轻松地从源代码构建。

If you download ikvm-0.36.0.11.zip, classpath-0.95-stripped.zip and openjdk-b13-stripped.zip from SourceForge (the last two are under the ikvm 0.36.0.5 release) you have all the sources that are needed.

如果您从SourceForge下载ikvm-0.36.0.11.zip,classpath-0.95-stripped.zip和openjdk-b13-stripped.zip(最后两个在ikvm 0.36.0.5版本下),您将获得所需的所有资源。

Now you'll have to open a Visual Studio 2008 Command Prompt (i.e. one that has cl.exe and peverify in the path).

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

Then in the ikvm root directory, do a "nant clean" followed by "nant". That should build the whole project. After you done that, you should be able to build in Visual Studio (debug target only), but you may need to repair the assembly references in the projects (unless you have ikvm installed in c:\ikvm).

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

Regards, Jeroen

Edit: After making sure the Platform SDK folders were in the Path and Lib environment variables, this worked for me. Thanks, Jeroen!

编辑:确保Platform SDK文件夹在Path和Lib环境变量中后,这对我有用。谢谢,Jeroen!

#3


0  

This is how I built IKVM 8.1.5717.0 from source. Visual Studio is not required.

这就是我从源代码构建IKVM 8.1.5717.0的方法。 Visual Studio不是必需的。

  • Create a folder: c:\ikvm\

    创建一个文件夹:c:\ ikvm \

  • Add the above folder to PATH (e.g. set PATH=%PATH%;c:\ikvm and leave command prompt open for later).

    将上述文件夹添加到PATH(例如,设置PATH =%PATH%; c:\ ikvm并保持命令提示符打开以供稍后使用)。

  • Download: ikvmsrc-8.1.5717.0.zip (http://www.frijters.net/ikvmsrc-8.1.5717.0.zip)

    下载:ikvmsrc-8.1.5717.0.zip(http://www.frijters.net/ikvmsrc-8.1.5717.0.zip)

  • Unzip and place "ikvm-8.1.5717.0" folder in c:\ikvm\

    解压缩并将“ikvm-8.1.5717.0”文件夹放在c:\ ikvm \中

  • Download: openjdk-8u45-b14-stripped.zip (http://www.frijters.net/openjdk-8u45-b14-stripped.zip)

    下载:openjdk-8u45-b14-stripped.zip(http://www.frijters.net/openjdk-8u45-b14-stripped.zip)

  • Unzip and place "openjdk-8u45-b14" folder in c:\ikvm\

    解压缩并在c:\ ikvm \中放置“openjdk-8u45-b14”文件夹

  • Download: Java 8 SDK (http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)

    下载:Java 8 SDK(http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)

  • Install and make sure location is added to path

    安装并确保将位置添加到路径中

  • Download: NAnt 0.92 (https://sourceforge.net/projects/nant/files/nant/0.92/nant-0.92-bin.zip/download)

    下载:NAnt 0.92(https://sourceforge.net/projects/nant/files/nant/0.92/nant-0.92-bin.zip/download)

  • Unzip and place "nant-0.92" folder in c:\ikvm\

    解压缩并在c:\ ikvm \中放置“nant-0.92”文件夹

  • ICSharpCode.SharpZipLib.dll (http://www.icsharpcode.net/opensource/sharpziplib/Download.aspx)

  • Place "ICSharpCode.SharpZipLib.dll" in C:\ikvm\ikvm-8.1.5717.0\bin\

    将“ICSharpCode.SharpZipLib.dll”放在C:\ ikvm \ ikvm-8.1.5717.0 \ bin \中

  • Open the following file in a text editor and change the version number: C:\ikvm\ikvm-8.1.5717.0\CommonAssemblyInfo.cs.in

    在文本编辑器中打开以下文件并更改版本号:C:\ ikvm \ ikvm-8.1.5717.0 \ CommonAssemblyInfo.cs.in

  • Using command prompt from earlier, cd to: C:\ikvm\ikvm-8.1.5717.0\ikvm\

    使用之前的命令提示符,cd到:C:\ ikvm \ ikvm-8.1.5717.0 \ ikvm \

  • Run: ..\nant-0.92\bin\NAnt.exe

  • If successful all the binaries will be in: C:\ikvm\ikvm-8.1.5717.0\bin

    如果成功,所有二进制文件都将在:C:\ ikvm \ ikvm-8.1.5717.0 \ bin

#1


1  

I don't know that this would do it for you but can you try building from the command line?

我不知道这会为你做,但你能尝试从命令行构建吗?

msbuild ________

I think that's how I built the application due to the same issues.

我认为这是我如何构建应用程序由于相同的问题。

#2


0  

OK just got the following reply from the author: http://weblog.ikvm.net/CommentView.aspx?guid=7e91b51d-6f84-4485-b61f-ea9e068a5fcf

好的,刚收到作者的以下回复:http://weblog.ikvm.net/CommentView.aspx?guid = 7e91b51d-684 -4485-b61f-ea9e068a5fcf

If you want to build from cvs, you're on your own. However, you can more easily build from source if you use an official release.

如果你想用cvs构建,你可以自己动手。但是,如果您使用官方发行版,则可以更轻松地从源代码构建。

If you download ikvm-0.36.0.11.zip, classpath-0.95-stripped.zip and openjdk-b13-stripped.zip from SourceForge (the last two are under the ikvm 0.36.0.5 release) you have all the sources that are needed.

如果您从SourceForge下载ikvm-0.36.0.11.zip,classpath-0.95-stripped.zip和openjdk-b13-stripped.zip(最后两个在ikvm 0.36.0.5版本下),您将获得所需的所有资源。

Now you'll have to open a Visual Studio 2008 Command Prompt (i.e. one that has cl.exe and peverify in the path).

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

Then in the ikvm root directory, do a "nant clean" followed by "nant". That should build the whole project. After you done that, you should be able to build in Visual Studio (debug target only), but you may need to repair the assembly references in the projects (unless you have ikvm installed in c:\ikvm).

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

Regards, Jeroen

Edit: After making sure the Platform SDK folders were in the Path and Lib environment variables, this worked for me. Thanks, Jeroen!

编辑:确保Platform SDK文件夹在Path和Lib环境变量中后,这对我有用。谢谢,Jeroen!

#3


0  

This is how I built IKVM 8.1.5717.0 from source. Visual Studio is not required.

这就是我从源代码构建IKVM 8.1.5717.0的方法。 Visual Studio不是必需的。

  • Create a folder: c:\ikvm\

    创建一个文件夹:c:\ ikvm \

  • Add the above folder to PATH (e.g. set PATH=%PATH%;c:\ikvm and leave command prompt open for later).

    将上述文件夹添加到PATH(例如,设置PATH =%PATH%; c:\ ikvm并保持命令提示符打开以供稍后使用)。

  • Download: ikvmsrc-8.1.5717.0.zip (http://www.frijters.net/ikvmsrc-8.1.5717.0.zip)

    下载:ikvmsrc-8.1.5717.0.zip(http://www.frijters.net/ikvmsrc-8.1.5717.0.zip)

  • Unzip and place "ikvm-8.1.5717.0" folder in c:\ikvm\

    解压缩并将“ikvm-8.1.5717.0”文件夹放在c:\ ikvm \中

  • Download: openjdk-8u45-b14-stripped.zip (http://www.frijters.net/openjdk-8u45-b14-stripped.zip)

    下载:openjdk-8u45-b14-stripped.zip(http://www.frijters.net/openjdk-8u45-b14-stripped.zip)

  • Unzip and place "openjdk-8u45-b14" folder in c:\ikvm\

    解压缩并在c:\ ikvm \中放置“openjdk-8u45-b14”文件夹

  • Download: Java 8 SDK (http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)

    下载:Java 8 SDK(http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)

  • Install and make sure location is added to path

    安装并确保将位置添加到路径中

  • Download: NAnt 0.92 (https://sourceforge.net/projects/nant/files/nant/0.92/nant-0.92-bin.zip/download)

    下载:NAnt 0.92(https://sourceforge.net/projects/nant/files/nant/0.92/nant-0.92-bin.zip/download)

  • Unzip and place "nant-0.92" folder in c:\ikvm\

    解压缩并在c:\ ikvm \中放置“nant-0.92”文件夹

  • ICSharpCode.SharpZipLib.dll (http://www.icsharpcode.net/opensource/sharpziplib/Download.aspx)

  • Place "ICSharpCode.SharpZipLib.dll" in C:\ikvm\ikvm-8.1.5717.0\bin\

    将“ICSharpCode.SharpZipLib.dll”放在C:\ ikvm \ ikvm-8.1.5717.0 \ bin \中

  • Open the following file in a text editor and change the version number: C:\ikvm\ikvm-8.1.5717.0\CommonAssemblyInfo.cs.in

    在文本编辑器中打开以下文件并更改版本号:C:\ ikvm \ ikvm-8.1.5717.0 \ CommonAssemblyInfo.cs.in

  • Using command prompt from earlier, cd to: C:\ikvm\ikvm-8.1.5717.0\ikvm\

    使用之前的命令提示符,cd到:C:\ ikvm \ ikvm-8.1.5717.0 \ ikvm \

  • Run: ..\nant-0.92\bin\NAnt.exe

  • If successful all the binaries will be in: C:\ikvm\ikvm-8.1.5717.0\bin

    如果成功,所有二进制文件都将在:C:\ ikvm \ ikvm-8.1.5717.0 \ bin