Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Please forgive me if i'm asking in the wrong SA.

Note: This is NOT about compiling wine itself!

I am trying to figure out how to compile windows application with wine's windows.h. I have installed wine-dev package and i can see that windows.h was placed in /usr/include/wine/windows/windows.h, but when i try to compile it cannot find it. I have attempted to run

pkg-config --libs wine

But that returns the error:

Package wine was not found in the pkg-config search path.
Perhaps you should add the directory containing `wine.pc'
to the PKG_CONFIG_PATH environment variable
No package 'wine' found

Replacing wine with wine1.6, wine-dev, or wine1.6-dev does not resolve the issue.

share|improve this question

I have finally found the answer. But i am sure that there is a better solution out there.

Problem as it stands: Wine does not provide a .pc file, which means that pkg-config is unable to determine where to the headers are.

The solution is to use winecpp compiler, which is actually a wrapper around gcc, but automatically links all the header directories of wine. This compiler is designed to be as compatible as possible with MinGW, which means that it should be quite easy to setup the design team across Windows/POSIX boundary (but that is no excuse to leave out .pc file).

share|improve this answer
To find a header file (.h), the way to make it known is with the -I flag to gcc (used with a path: -I/usr/include/wine/windows). Of course that's the kind of thing that config files are for, so maybe the relevant setting goes in one of them. – alexis Dec 8 '13 at 18:06
My guess is that it's exactly what winecpp and wineg++ do at their core. But thanks for this pointer, i'll keep that in mind for the future. – v010dya Dec 9 '13 at 10:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.