Installing missing package that provides Xm/Xm.h

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?


Solution 1:

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 http://packages.ubuntu.com/
  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?

Solution 2:

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:
# http://www.opengroup.org/openmotif/
# but it wants registaration before downloading.