简体   繁体   English

在使用GTK#lib的mono中编译项目时出错

[英]Error while compiling project in mono that uses a GTK# lib

When i try to build my simple Mono GTK# project using command line 当我尝试使用命令行构建简单的Mono GTK#项目时

mcs  /pkg:gtk-sharp-2.0  Test.cs

compiler gives this error both on Linux and Windows: 编译器在Linux和Windows上均出现此错误:

Package gtk-sharp was not found in the pkg-config search path. 在pkg-config搜索路径中找不到gtk-sharp软件包。 Perhaps you should add the directory containing `gtk-sharp.pc' to the PKG_CONFIG_PATH environment variable No package 'gtk-sharp' found error CS8027: Error running pkg-config. 也许您应该将包含“ gtk-sharp.pc”的目录添加到PKG_CONFIG_PATH环境变量中没有找到包“ gtk-sharp”的错误CS8027:运行pkg-config时出错。 Check the above output. 检查以上输出。

On Windows I tried to set full path to file gtk-sharp-2.0.pc, but that way pkg-config.exe crashes. 在Windows上,我尝试设置文件gtk-sharp-2.0.pc的完整路径,但那样会使pkg-config.exe崩溃。

What should I do ? 我该怎么办 ?

Check the windows environment variables, there should be a PKG_CONFIG_PATH variable. 检查Windows环境变量,应该有一个PKG_CONFIG_PATH变量。 If there is no such variable, add it. 如果没有这样的变量,请添加它。 If there is, check if the path is correct and has the gtk-sharp.pc file. 如果存在,请检查路径是否正确并具有gtk-sharp.pc文件。

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

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