Most people should either install Wine through Ubuntu's official repositories, or using the Wine project's official Wine PPA.
However, if you want to build and install Wine from source, you should be able to do so.
This may make sense if you want to install a later version of Wine than is provided for your Ubuntu release. However, as BuZZ-dEE has pointed out, although there is no
wine1.4 package for Ubuntu 10.04 in the official PPA, the
wine1.3 package actually provides version 1.4. (This is indicated by the complete version number--
1.4-0ubuntu1~ppa1~lucid1--and can be verified by looking in the file called
VERSION in the
wine1.3_1.4.orig.tar.gz file linked here.)
Therefore, Buzz-dEE's answer is god advice; I recommend you just use that package, unless you have specific needs that require your to compile from source. (Or you want to use the unstable 1.5 version, which is not provided for Lucid.)
However, if for any reason you wish to build from source, please read on.
You will need the development packages that provide header files for the libraries it uses. That's the cause of the error message you're getting.
To resolve this particular error, you'll need the package called
-dev packages provide header files.
libx11-dev is not the only such package you'll need, to compile Wine from source. I recommend taking a look at the build dependencies for the development version of Wine in Ubuntu. (Scroll down to where it says "Build dependencies.") That should give you a good idea of which
-dev packages you'll need to install, for Wine to be able to compile.
If you use 64bit version of Ubuntu, this error message may appear if you're trying to compile 32bit wine, so you'll need some 32bit libraries to do it: