- !!!用户新注册邮件系统遭恶意攻击,暂不能发送邮件,请隔天尝试。寻求解决方案中
- 【征集】西西河的经济学,及清流措施,需要主动参与者
- 『稷下学宫』新认证方式
- 24年网站打算和努力目标
主题:用g++编译的c++程序怎样引用外部类的static 变量? -- 金口玉言
C++ How to Program, 5th edition, page 98, Section 3.8.
" How Header Files Are Located
Notice that the name of the GradeBook.h header file in line 7 of Fig. 3.10 is enclosed in quotes (" ") rather than angle brackets (< >). Normally, a program's source-code files and user-defined header files are placed in the same directory. When the preprocessor encounters a header file name in quotes (e.g., "GradeBook.h"), the preprocessor attempts to locate the header file in the same directory as the file in which the #include directive appears. If the preprocessor cannot find the header file in that directory, it searches for it in the same location(s) as the C++ Standard Library header files. When the preprocessor encounters a header file name in angle brackets (e.g., <iostream>), it assumes that the header is part of the C++ Standard Library and does not look in the directory of the program that is being preprocessed. "
"Error-Prevention Tip 3.3
To ensure that the preprocessor can locate header files correctly, #include preprocessor directives should place the names of user-defined header files in quotes (e.g., "GradeBook.h") and place the names of C++ Standard Library header files in angle brackets (e.g., <iostream>)."
- 相关回复 上下关系8
🙂呵呵,那就以后还请多指教了:) 金口玉言 字0 2007-07-22 14:41:10
🙂提个议... 10年1剑 字154 2007-07-20 01:14:39
🙂不可能讨论技术问题 littles 字42 2007-07-20 10:53:41
🙂How Header Files Are Located
🙂路径问题? cartman 字51 2007-07-19 20:56:13
🙂an introduction to gcc 厚积薄发 字97 2007-07-19 20:00:56
😉你include有问题。 2 来自北方的狼 字478 2007-07-18 19:55:38
🙂西河还是高人多啊 金口玉言 字291 2007-07-19 12:52:08