⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 missinghdr.html

📁 this is a mirrored site c-faq. thought might need offline
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3O//DTD W3 HTML 2.0//EN"><!-- This collection of hypertext pages is Copyright 1995-2005 by Steve Summit. --><!-- Content from the book "C Programming FAQs: Frequently Asked Questions" --><!-- (Addison-Wesley, 1995, ISBN 0-201-84519-9) is made available here by --><!-- permission of the author and the publisher as a service to the community. --><!-- It is intended to complement the use of the published text --><!-- and is protected by international copyright laws. --><!-- The on-line content may be accessed freely for personal use --><!-- but may not be published or retransmitted without explicit permission. --><!-- --><!-- this page built Sat Dec 24 21:47:46 2005 by faqproc version 2.7 --><!-- from source file cpp.sgml dated Wed Dec 21 13:52:14 2005 --><!-- corresponding to FAQ list version 4.0 --><html><!-- Mirrored from c-faq.com/cpp/missinghdr.html by HTTrack Website Copier/3.x [XR&CO'2008], Sat, 14 Mar 2009 07:58:54 GMT --><head><meta name=GENERATOR content="faqproc"><title>Question 10.11</title><link href="extlibs.html" rev=precedes><link href="ifstrcmp.html" rel=precedes><link href="index.html" rev=subdocument></head><body bgcolor="#ffffff"><a href="extlibs.html" rev=precedes><img src="../images/buttonleft.gif" alt="prev"></a><a href="index.html" rev=subdocument><img src="../images/buttonup.gif" alt="up"></a><a href="ifstrcmp.html" rel=precedes><img src="../images/buttonright.gif" alt="next"></a>&nbsp;<a href="../index-2.html"><img src="../images/buttontop.gif" alt="top/contents"></a><a href="../search.html"><img src="../images/buttonsrch.gif" alt="search"></a><hr><p><!-- qbegin --><h1>comp.lang.c FAQ list<font color=blue>&middot;</font><!-- qtag -->Question 10.11</h1><p><font face=Helvetica size=8 color=blue><b>Q:</b></font>I'm compiling a program, andI seem to be missingoneof theheader files itrequires.Can someone send mea copy?</p><p><hr><p><font face=Helvetica size=8 color=blue><b>A:</b></font>There are several situations, depending on what sort of headerfile it is that's ``missing''.</p><p>If the missing header file istrulya standard one(that is,one defined by the ANSI C Standard,such as <TT>&lt;stdio.h&gt;</TT>),there's a problem with your compiler.Eitherthe compilerwasn't installed properly,or your project is somehow not configuredto find the standard header files.You'll need to contact your vendor,or someone knowledgeable about your particular compiler,for help.</p><p>Inthe case of nonstandard headers,the situation is considerably more complicated.Someheaders(such as <TT>&lt;dos.h&gt;</TT>)are completely system- or compiler-specific.Someare completely unnecessary,and should be replaced bytheir Standard equivalents.(For example,instead ofthe nonstandard<TT>&lt;malloc.h&gt;</TT>and<TT>&lt;memory.h&gt;</TT>,portablesource code should instead <TT>#include</TT><TT>&lt;stdlib.h&gt;</TT>and<TT>&lt;string.h&gt;</TT>,respectively.)Otherheaders,such as those associated with popular add-on libraries,may be reasonably portable.</p><p>If the missing header file is an OS-specific one,such as<TT>&lt;sgtty.h&gt;</TT>,<TT>&lt;sys/stat.h&gt;</TT>,<TT>&lt;netinet/in.h&gt;</TT>,or<TT>&lt;dos.h&gt;</TT>,it may be that the program you're compiling wastailored toan operating system other than the one you're using.(It's also possible thatsome conditional compilation settings need to be adjusted.)It likely won't be possible to get the program workingwithout rewriting its system-dependent portions.Simply getting copies of the missing header files wouldn't help--theytypically contain declarations of the interfacesto the various system calls and libraries.Obtaining copies of the header files wouldn't get you copies of the libraries,and the libraries wouldn't be of any use(that is, they wouldn't work)without the underlying system calls, anyway.See alsoquestions <a href="../osdep/cbreak.html">19.1</a>, <a href="../osdep/termcap.html">19.4</a>, <a href="../osdep/modtime.html">19.12b</a>, and <a href="../osdep/int86.html">19.40c</a>.</p><p>If the missing header file is forsome external, add-on, third-partylibrary,look for the header where you got the library.If you have some source codewhich #includes what appears to be an add-on header,butwhichyou don't have,you probably don't have the library, either,and you'll need both.See question <a href="../lib/extlibs.html">13.25</a>;see also question <a href="../resources/sources.html">18.16</a>.</p><p>If the header file is unique to(that is, part of)the program you're trying to compile,your search will obviously beginat the spotwhere you found the program.(Again, see question <a href="../resources/sources.html">18.16</a>.)</p><p>In general, however, asking if someone can``send you a copy''of a missing header file is not likely to be productive.Standard headers exist in part so that definitions appropriate to yourcompiler,operating system,andprocessorcan be supplied.You cannotjustpick up a copy of someone else's header fileand expect it to work,unless that person is using exactly the same environment.Nonstandard headers--such asthose specific toa particular operating systemor third-party library--aren'tgenerally any more portable;the OS-specific ones are likely to be <em>very</em> specificto a particular version and release of the OS,and the third-party ones are likely to be equally tiedto a particular version of the library.</p><p>The bottom line is thata random person on the netis unlikely to be able to send you a working copyof the header file you(seem to)need.You may actually have aportability problem(see section <a href="../osdep/index.html">19</a>),or a compiler problem(in which case you might be able toask your compiler vendor why the file was not provided,or to send a replacement copy).Otherwise(if the header is third-party or application-specific),see question <a href="../resources/sources.html">18.16</a>.</p><!-- aend --><p><hr><a href="extlibs.html" rev=precedes><img src="../images/buttonleft.gif" alt="prev"></a><a href="index.html" rev=subdocument><img src="../images/buttonup.gif" alt="up"></a><a href="ifstrcmp.html" rel=precedes><img src="../images/buttonright.gif" alt="next"></a>&nbsp;<a href="../questions.html"><img src="../images/buttontop.gif" alt="contents"></a><a href="../search.html"><img src="../images/buttonsrch.gif" alt="search"></a><br><!-- lastfooter --><a href="../about.html">about this FAQ list</a>&nbsp;<a href="../eskimo.html">about eskimo</a>&nbsp;<a href="../search.html">search</a>&nbsp;<a href="../feedback.html">feedback</a>&nbsp;<a href="copyright.html">copyright</a><p>Hosted by<a href="http://www.eskimo.com/"><img src="../../www.eskimo.com/img/link/eskitiny.gif" alt="Eskimo North"></a></body><!-- Mirrored from c-faq.com/cpp/missinghdr.html by HTTrack Website Copier/3.x [XR&CO'2008], Sat, 14 Mar 2009 07:58:54 GMT --></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -