Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

I'm compiling a software package that requires a header file. The header file is missing from my Ubuntu 11.10 (64-bit) installation. During the compilation using make, gcc and gfortran, I receive the following error message.

XMstr.c:7:19: fatal error: Xm/Xm.h: No such file or directory

Googling for an answer leads me to believe that a MESA library needs to be installed on my system, but I can't find an exact match for the package name.

What might be the name of the package that I need to install? Does the package have the same name on more recent Ubuntu distros?

share|improve this question
up vote 3 down vote accepted

You need either openmotif or lesstif header files which you can get this way:

# lesstif:
sudo apt-get install lesstif2-dev

# openmotif is not available in ubuntu repos
# but you can get it from it's official site:
# but it wants registaration before downloading.
share|improve this answer
Thank you; installing lesstif2-dev does indeed get rid of the error and the compile proceeds. – Nicholas Kinar Nov 19 '12 at 19:15
You're welcome :) – user91091 Nov 19 '12 at 19:16

The package to resolve your specific issue can be found in the other answer. In case you run into other similar issues later, try this more general approach:

  1. Go to
  2. Scroll down to "Search the contents of packages"
  3. Enter the filename you're looking for in the text box.
  4. Select "packages that contain files whose names end with the keyword"
  5. Select the right distribution version and architecture
  6. Hit [search].

For Xm/Xm.h it looks like this:

File                                                    Packages
/usr/include/Xm/Xm.h                                    lesstif2-dev, libmotif-dev
/usr/lib/TenDRA/lib/include/motif/1_2.api/Xm/Xm.h       tendra [not amd64]

An alternative command-line approach of finding the package for a file is using apt-file as can be seen in the question How to get a list of files for a package I haven't installed yet?

share|improve this answer
Thank you; I didn't know that has this functionality. +1 for adding this, and for enlightening this topic further. I am bound to be using this when I run into further issues. – Nicholas Kinar Nov 20 '12 at 2:12
You can also do the above locally with apt-file search Xm.h. See this question:… – Gerhard Burger Jan 2 '13 at 16:43
@GerhardBurger I know, I've provided an answer with that myself some time earlier in a more targeted question. See my updated answer. Anyway, thanks for the suggestion! :) – gertvdijk Jan 2 '13 at 16:48

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.