Using apt-file to track down build errors(fatal error: X11/Intrinsic.h: No such file or directory)

来源:互联网 发布:中科vipexam数据库 编辑:程序博客网 时间:2024/06/05 06:56

http://www.kubuntuforums.net/showthread.php?58964-failure-to-compile-on-kubuntu


A very handy tool to help you through situations like these is apt-file. It catalogs individual files in packages and thus helps you discover which packages will offer files that you might require. To install the tool:

Code:
sudo apt-get install --no-install-recommends apt-file
Next, update the catalog:
Code:
sudo apt-file update
Finally, search for the file(s) in question. I checked for the first file missing in your post:
Code:
steve@x1:~$ <strong>apt-file find Intrinsic.h</strong>libxt-dev: /usr/include/X11/Intrinsic.h

It appears, then, that you need to install the package libxt-dev.



----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Using apt-file to track down build errors

Someone was asking for help building XEphem on the XEphem mailing list.It was a simple case of a missing include file, where the only trickis to find out what package you need to install to get that file.(This is complicated on Ubuntu, which the poster was using,by the way they fragment the X developement headers into a maze ofa xillion tiny packages.)

The solution -- apt-file -- is so simple and easy to use, and yeta lot of people don't know about it. So here's how it works.

The poster reported getting these compiler errors:

ar rc libz.a adler32.o compress.o crc32.o uncompr.o deflate.o trees.o zutil.o inflate.o inftrees.o inffast.oranlib libz.amake[1]: Leaving directory `/home/gregs/xephem-3.7.4/libz'gcc -I../../libastro -I../../libip -I../../liblilxml -I../../libjpegd -I../../libpng -I../../libz -g -O2 -Wall -I../../libXm/linux86 -I/usr/X11R6/include   -c -o aavso.o aavso.cIn file included from aavso.c:12:../../libXm/linux86/Xm/Xm.h:56:27: error: X11/Intrinsic.h: No such file or directory../../libXm/linux86/Xm/Xm.h:57:23: error: X11/Shell.h: No such file or directory../../libXm/linux86/Xm/Xm.h:58:23: error: X11/Xatom.h: No such file or directory../../libXm/linux86/Xm/Xm.h:59:34: error: X11/extensions/Print.h: No such file or directoryIn file included from ../../libXm/linux86/Xm/Xm.h:60,                 from aavso.c:12:../../libXm/linux86/Xm/XmStrDefs.h:1373: error: expected `=', `,', `;', `asm' or `__attribute__' before `char'In file included from ../../libXm/linux86/Xm/Xm.h:60,                 from aavso.c:12:../../libXm/linux86/Xm/XmStrDefs.h:5439:28: error: X11/StringDefs.h: No such file or directoryIn file included from ../../libXm/linux86/Xm/Xm.h:61,                 from aavso.c:12:../../libXm/linux86/Xm/VirtKeys.h:108: error: expected `)' before `*' tokenIn file included from ../../libXm/linux86/Xm/Display.h:49,                 from ../../libXm/linux86/Xm/DragC.h:48,                 from ../../libXm/linux86/Xm/Transfer.h:44,                 from ../../libXm/linux86/Xm/Xm.h:62,                 from aavso.c:12:../../libXm/linux86/Xm/DropSMgr.h:88: error: expected specifier-qualifier-list before `XEvent'../../libXm/linux86/Xm/DropSMgr.h:100: error: expected specifier-qualifier-list before `XEvent'
How do you go about figuring this out?

When interpreting compiler errors, usually what matters is the*first* error. So try to find that. In the transcript above, the firstline saying "error:" is this one:

../../libXm/linux86/Xm/Xm.h:56:27: error: X11/Intrinsic.h: No such file or directory

So the first problem is that the compiler is trying to find a filecalled Intrinsic.h that isn't installed.

On Debian-based systems, there's a great program you can use to findfiles available for install: apt-file. It's not installed by default,so install it, then update it, like this (the update will take a long time):

$ sudo apt-get install apt-file$ sudo apt-file update
Once it's updated, you can now find out what package would install afile like this:
$  apt-file search Intrinsic.hlibxt-dev: /usr/include/X11/Intrinsic.htendra: /usr/lib/TenDRA/lib/include/x5/t.api/X11/Intrinsic.h

In this case two two packages could install a file by that name.You can usually figure out from looking which one is the"real" one (usually the one with the shorter name, or the onewhere the package name sounds related to what you're trying to do).If you're stil not sure, try something likeapt-cache show libxt-dev tendra to find out moreabout the packages involved.

In this case, it's pretty clear that tendra is a red herring,and the problem is likely that the libxt-dev package is missing.So apt-get install libxt-dev and try the build again.

Repeat the process until you have everything you need for the build.

Remember apt-file if you're not already using it.It's tremendously useful in tracking down build dependencies.


0 0
原创粉丝点击