简体   繁体   English

Mono Pkg-Config.exe不断崩溃?

[英]Mono Pkg-Config.exe Keeps Crashing?

I'm new to Mono - thought I'd give cross platform a try - my main IDE is Visual Studio and so the process of building applications through the command prompt is a bit foreign to me. 我是Mono的新手-我想尝试一下跨平台-我的主要IDE是Visual Studio,因此通过命令提示符构建应用程序的过程对我来说有点陌生。

I was following the Mono Basics tutorial, and have gotten to the point where it says Winforms Hello World . 我遵循了Mono Basics教程,并说到Winforms Hello World I copied the code provided and saved it to a .cs file (on the Desktop). 我复制了提供的代码并将其保存到.cs文件(在桌面上)。

I then opened up a command prompt and pointed it towards the Desktop directory. 然后,我打开一个命令提示符,并将其指向桌面目录。 I ran the command: 我运行了命令:

mcs hello.cs -pkg:dotnet

And the result was: 结果是: Pkg-Config.exe无法正常工作

The console told me that it was a CS8027 error but nothing else. 控制台告诉我,这是CS8027错误,但仅此而已。

I have 3 environment variables that I added, with no fix: 我添加了3个环境变量,但没有修复:

  • PATH -> path to mono\\bin 路径-> mono \\ bin的路径
  • PATH -> path to mono\\lib\\pkgconfig PATH-> mono \\ lib \\ pkgconfig的路径
  • PKG_CONFIG_PATH -> path to mono\\lib\\pkgconfig PKG_CONFIG_PATH-> mono \\ lib \\ pkgconfig的路径

This happens whenever I try to use pkg-config.exe (tried to use pkg-config.exe --list-all but the same problem arose). 每当我尝试使用pkg-config.exe时都会发生这种情况(尝试使用pkg-config.exe --list-all,但出现了相同的问题)。

I've checked other answers/questions about the CS8027 error but the solutions did not help - it still crashes every time! 我检查了有关CS8027错误的其他答案/问题,但解决方案没有帮助-每次仍然崩溃!

Had the same problem. 有同样的问题。 I had all the proper VC++ runtimes installed, but still crashed. 我安装了所有正确的VC ++运行时,但仍然崩溃。

pkg-config.exe references librares (.dll) that are compiled in different versions of .Net. pkg-config.exe引用在不同版本的.Net中编译的librares(.dll)。 Your PATH (or pkg-config itself) might be referencing a different version than the one the .dll uses, or not have it at all. 您的PATH(或pkg-config本身)可能引用的版本与.dll使用的版本不同,或者根本没有。

pkg-config is a short-hand anyway. 无论如何,pkg-config是一个简写。 I fixed it by explicitly including the .dll I'm referencing using the proper version of .Net for me: 我通过使用正确版本的.Net明确包含要引用的.dll来修复它:

mcs hello.cs -r:"C:\Program Files\Mono\lib\mono\4.5-api\System.Windows.Forms.dll"

pkg-config is built with a different version of MSVC to Mono itself. pkg-config是使用不同于Mono本身的MSVC版本构建的。 You need the 32-bit VC++12 runtime installed for it to work. 您需要安装32位VC ++ 12运行时才能运行。 That ought to be included with mono.msi, as per https://github.com/mono/release/commit/8394dcc254510977c3e654abf916a48c6c6894fb 根据https://github.com/mono/release/commit/8394dcc254510977c3e654abf916a48c6c6894fb 应该将其包含在mono.msi中

If you check the Windows event log, under Applications, you might get more information on what didn't work. 如果检查Windows事件日志,请在“应用程序”下,获取有关哪些无效信息的更多信息。

I had this problem, could help some. 我有这个问题,可以帮助一些。

D:\Code\Mono>mcs hello.cs -pkg:dotnet
error CS8027: Error running pkg-config. Check the above output.

I needed to download the following DLL:s from https://www.dll-files.com/ 我需要从https://www.dll-files.com/下载以下DLL:

  • libiconv-2.dll libiconv-2.dll
  • libgcc_s_sjlj-1.dll libgcc_s_sjlj-1.dll
  • libintl-8.dll libintl-8.dll
  • libglib-2.0-0.dll libglib-2.0-0.dll

Put them in C:\\Program Files\\Mono\\bin 将它们放在C:\\ Program Files \\ Mono \\ bin中

All DLLs should be 32 bits even if Mono was 64 bits. 即使Mono为64位,所有DLL也应为32位。

In my system the problem was the empty space inside the path of install and how that is managed inside of the pc files. 在我的系统中,问题是安装路径中的空白以及如何在pc文件中进行管理。

A workaround is to edit the pc files to change the prefix entry to the short path. 一种解决方法是编辑pc文件,以将前缀条目更改为短路径。 In my system: 在我的系统中:

prefix=C:/PROGRA~1/Mono

instead of 代替

prefix=${pcfiledir}/../..

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM