Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

On Debian, running mono- error CS8027: Error running pkg-config

I am on debian. I did sudo apt-get install mono-complete

I am trying to compile this program

user@debian:~$ cat a2.cs
using Gtk;
using System;

class Hello {

        static void Main()
        {
                Application.Init ();

                Window window = new Window ("helloworld");
                window.Show();

                Application.Run ();

        }
}

Then when I try to compile it I get this error

user@debian:~$ mcs a2.cs -pkg:gtk-sharp-2.0
Package gtk-sharp-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk-sharp-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk-sharp-2.0' found
error CS8027: Error running pkg-config. Check the above output.
user@debian:~$ 

one answer to a similar problem said try dmcs

user@debian:~$ dmcs a2.cs -pkg:gtk-sharp-2.0
Package gtk-sharp-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk-sharp-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk-sharp-2.0' found
error CS8027: Error running pkg-config. Check the above output.
user@debian:~$ 

but dmcs gives the same error

I saw a suggestion to do yum install gtk-sharp2 but whatever incantation I use it says no package available so i'm not sure what that package is

user@debian:~$ sudo yum install gtk-sharp-2.0
Setting up Install Process
No package gtk-sharp-2.0 available.
Nothing to do
user@debian:~$ 

user@debian:~$ sudo yum install gtk-sharp2-devel
Setting up Install Process
No package gtk-sharp2-devel available.
Nothing to do
user@debian:~$ 

I looked up my error https://stackoverflow.com/search?q=cs8027 and they all say this variable PKG_CONFIG_PATH has to point to the correct path.

At the moment though the variable doesn't exist and I don't know what path to point it to. Apparently it's a path with some .pc files for gtk. I have no idea where that is.

user@debian:/usr$ echo $PKG_CONFIG_PATH

user@debian:/usr$
like image 433
barlop Avatar asked Jul 19 '14 19:07

barlop


1 Answers

You say you are using debian, yet you run yum? Doesn't seem like a good idea.

Try running:

sudo apt-get update
sudo apt-get install gtk-sharp2

Then, don't forget to do:

make clean

And start the compilation process from the very beginning.

added by barlop

I got errors the first time I tried it like problem: 0:System.Drawing.SizeF.Conversion, with xpath: /Type/Members/Member[@MemberName='op_Conversion']/Docs and I interrupted the installation but it continued trying to install then said it interrupted.

but doing that command again, apt-get didn't seem to install it again but immediately said it's the newest version, and my program compiled. So it must have installed or installed sufficiently despite the problems while installing.

it makes this file /usr/lib/pkgconfig/gtk-sharp-2.0.pc among others,

and

$ dmcs a2.cs -pkg:gtk-sharp-2.0 <-- then works

like image 63
Mikel Pascual Avatar answered Nov 03 '22 02:11

Mikel Pascual