c++ - 无法打开包含文件错误

标签 c++ c sunos

我正在尝试使用编译器 Sun C++ 5.9 SunOS_sparc Patch 124863-01 在 SUN 服务器上编译 C++ 应用程序。但是,我收到编译错误,指出编译器无法包含头文件。但是头文件存在于同一文件夹和指定路径上/

CC  -Dbcc9 -Dsun10 -I/export/home/bcc/bb1/bccprod/bb/compilation/bh/bh_xx_1_70_1  -DENV_OPT -DENV_OPT  -D_XOPEN_SOURCE -D_XOPEN_VERSION=4 -D__SUN -Dsun -Dsparc -DSunOS53 -DCONFIG_64BIT -DNEW_ANSI -D__EXTENSIONS__ -D_POSIX_PTHREAD_SEMANTICS -I/export/home/bcc/bb1/bccprod/bb/compilation/opt_nc/hpux11.x/generic/include -DSHARED_EXT=\"so\"  -DF257054 -I/export/home/bcc/bb1/bccprod/bb/LHS_TOOLS/product/JTG/prod/bcc/batch/src/dxlib/include -I/export/home/bcc/bb1/bccprod/bb/LHS_TOOLS/product/JTG/prod/bcc/batch/src/udrlib/include -I/export/home/bcc/bb1/bccprod/bb/LHS_TOOLS/product/JTG/prod/bcc/batch/src/bat++/include -Dbcc_CONFIG -I/export/home/bcc/bb1/bccprod/bb/LHS_TOOLS/product/JTG/prod/bcc/batch/src/bat/include -DF227344_CR102 -DF267107 -DF267107_d -DF268560 -DG_SUN -DG_EH -I/export/home/bcc/bb1/bccprod/bb/compilation/opt_nc/hpux11.x/generic/include -DDEBUG -DORACLE_DB_BRAND -I/u01/app/oracle/product/10.2.0/db_1/precomp/public -I/u01/app/oracle/product/10.2.0/db_1/rdbms/public -I/u01/app/oracle/product/10.2.0/db_1/rdbms/demo -I/u01/app/oracle/product/10.2.0/db_1/plsql/public -I/u01/app/oracle/product/10.2.0/db_1/network/public -DF_TAP_311 -DF_LCS_310 -DF_RAP_103  -g -DCONTRACT_DETAILS -DCREDIT_DISPLAY -DSORT_BILLS -DSPLIT_BILL -DD_ROAMING -DSWAP_DATES -DFIXLASADDR -DFIXUSERID -DFIXBIGAMT -DNOPRINTZEROINV -DFIXIPBXDISP -DARABTRANS -DFIX_MKRTTEXT -DOCCDESC -DFIXBARCODE -DNEWTAX8 -DCARRY_OVER -I./include -I/export/home/bcc/bb1/bccprod/bb/LHS_TOOLS/product/JTG/prod/bcc/batch/src/bh/include -I/export/home/bcc/bb1/bccprod/bb/LHS_TOOLS/product/JTG/prod/bcc/batch/src/bat/include -I/export/home/bcc/bb1/bccprod/bb/LHS_TOOLS/product/JTG/prod/bcc/batch/src/bat++/include -I/export/home/bcc/bb1/bccprod/bb/compilation/opt_nc/hpux11.x/generic/include -I/export/home/bcc/bb1/bccprod/bb/compilation/opt_nc/hpux11.x/xalan/include -I/export/home/bcc/bb1/bccprod/bb/compilation/opt_nc/hpux11.x/xerces/include -I/usr/include  -DSOLARIS    -D_XOPEN_SOURCE -D_XOPEN_VERSION=4 -D__SUN -Dsun -Dsparc -DSunOS53 -DCONFIG_64BIT -DNEW_ANSI -D__EXTENSIONS__  -DF_TAP_311 -DF_LCS_310 -DF_RAP_103  -m64 -DNEW_ANSI -DG_ANSICPP -DG_LONGSIZE=64  -DGEN_INCIMP -w  -KPIC    -g -xs   -c bhComponentController.cpp -o bhComponentController.o
"**./include/bhComponentController.hpp", line 20: Error: Could not open include file "ComponentController.hpp"**
"./include/bhComponentController.hpp", line 183: Error: ComponentController is not defined.
"./include/bhTerminationHandler.hpp", line 107: Error: Could not open include file "TerminationHandler.hpp".
"./include/bhTerminationHandler.hpp", line 113: Error: TerminationHandler is not defined.
"bhComponentController.cpp", line 47: Error: The function "setTerminationHandler" must have a prototype.
"bhComponentController.cpp", line 70: Error: The function "strcat" must have a prototype.
"bhComponentController.cpp", line 73: Error: The function "strcat" must have a prototype.
"bhComponentController.cpp", line 76: Error: The function "strcat" must have a prototype.
"bhComponentController.cpp", line 79: Error: The function "strcat" must have a prototype.
9 Error(s) detected.
gmake: *** [bhComponentController.o] Error 9

错误提示

"Error:l Could not open include file "ComponentController.hpp"

但是文件 ./include/bhComponentController.hpp 存在并且在指定位置可读。

请问有什么想法吗?

最佳答案

也添加这个 -I/export/home/bcc/bb1/bccprod/bb/compilation/bh/bh_xx_1_70_1/include 假设你的源在那里。 或者 I/pathtoyoursources/#this 是 bhComponentController.hpp 所在的位置。 这样您就可以直接包含“bhComponentController.hpp”。

关于c++ - 无法打开包含文件错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17070503/

相关文章:

c++ - std::set 的替代品(能够将元素从一个集合移动到另一个集合)

c++ - 在库接口(interface)中提供对 weak_ptr 的访问是否明智?

c++ - Mac OSX、Qt Creator 和 Google Test

c - 将命令行参数作为一个大字符串获取

Java 内存分配性能(SunOS 与 Windows)

c++ - 为什么复制构造函数被调用两次?

c - 翻译8051微 Controller C代码

c - 这个 C 函数应该总是返回 false,但它并没有

clock_gettime() undefined symbol SunOS

linux - 所有机器上的 Grep "-C"命令