在NetBeans 7.2中找不到io.h 我对C++编程很陌生,请在这里跟我说。我现在正在使用C++的项目,使用NETBeaS 7.2来做Mac Loig.对于这个项目,我的教授给了我们main.cpp的代码(据教授说,这是用C编写的)

在NetBeans 7.2中找不到io.h 我对C++编程很陌生,请在这里跟我说。我现在正在使用C++的项目,使用NETBeaS 7.2来做Mac Loig.对于这个项目,我的教授给了我们main.cpp的代码(据教授说,这是用C编写的),c++,C++,当我将他的代码复制/粘贴到我的项目中时,我在#include行上得到一个错误,声明“找不到include file io.h”,随后是其他依赖项错误。我已经在网上搜索过了,但似乎找不到问题所在。我使用的是GCC/G++编译器,这让人更加困惑。我的教授说“io.h”已经存在很久了,所以他不明白为什么找不到它。我尝试从终端使用“locate io.h”命令。然而,它产生了太多的结果,让我无法理解哪一个(如果有的话)是重要的 我甚至尝试将代码复制并粘贴到XCODE中,只是发现“io.h”仍然没有找到

当我将他的代码复制/粘贴到我的项目中时,我在
#include
行上得到一个错误,声明“找不到include file io.h”,随后是其他依赖项错误。我已经在网上搜索过了,但似乎找不到问题所在。我使用的是GCC/G++编译器,这让人更加困惑。我的教授说“io.h”已经存在很久了,所以他不明白为什么找不到它。我尝试从终端使用“locate io.h”命令。然而,它产生了太多的结果,让我无法理解哪一个(如果有的话)是重要的

我甚至尝试将代码复制并粘贴到XCODE中,只是发现“io.h”仍然没有找到

如果您能在这件事上提供任何帮助,我们将不胜感激

生成文件

#
#  There exist several targets which are by default empty and which can be 
#  used for execution of your targets. These targets are usually executed 
#  before and after some main targets. They are: 
#
#     .build-pre:              called before 'build' target
#     .build-post:             called after 'build' target
#     .clean-pre:              called before 'clean' target
#     .clean-post:             called after 'clean' target
#     .clobber-pre:            called before 'clobber' target
#     .clobber-post:           called after 'clobber' target
#     .all-pre:                called before 'all' target
#     .all-post:               called after 'all' target
#     .help-pre:               called before 'help' target
#     .help-post:              called after 'help' target
#
#  Targets beginning with '.' are not intended to be called on their own.
#
#  Main targets can be executed directly, and they are:
#  
#     build                    build a specific configuration
#     clean                    remove built files from a configuration
#     clobber                  remove all built files
#     all                      build all configurations
#     help                     print help mesage
#  
#  Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and
#  .help-impl are implemented in nbproject/makefile-impl.mk.
#
#  Available make variables:
#
#     CND_BASEDIR                base directory for relative paths
#     CND_DISTDIR                default top distribution directory (build artifacts)
#     CND_BUILDDIR               default top build directory (object files, ...)
#     CONF                       name of current configuration
#     CND_PLATFORM_${CONF}       platform name (current configuration)
#     CND_ARTIFACT_DIR_${CONF}   directory of build artifact (current configuration)
#     CND_ARTIFACT_NAME_${CONF}  name of build artifact (current configuration)
#     CND_ARTIFACT_PATH_${CONF}  path to build artifact (current configuration)
#     CND_PACKAGE_DIR_${CONF}    directory of package (current configuration)
#     CND_PACKAGE_NAME_${CONF}   name of package (current configuration)
#     CND_PACKAGE_PATH_${CONF}   path to package (current configuration)
#
# NOCDDL


# Environment 
MKDIR=mkdir
CP=cp
CCADMIN=CCadmin


# build
build: .build-post

.build-pre:
# Add your pre 'build' code here...

.build-post: .build-impl
# Add your post 'build' code here...


# clean
clean: .clean-post

.clean-pre:
# Add your pre 'clean' code here...

.clean-post: .clean-impl
# Add your post 'clean' code here...


# clobber
clobber: .clobber-post

.clobber-pre:
# Add your pre 'clobber' code here...

.clobber-post: .clobber-impl
# Add your post 'clobber' code here...


# all
all: .all-post

.all-pre:
# Add your pre 'all' code here...

.all-post: .all-impl
# Add your post 'all' code here...


# build tests
build-tests: .build-tests-post

.build-tests-pre:
# Add your pre 'build-tests' code here...

.build-tests-post: .build-tests-impl
# Add your post 'build-tests' code here...


# run tests
test: .test-post

.test-pre:
# Add your pre 'test' code here...

.test-post: .test-impl
# Add your post 'test' code here...


# help
help: .help-post

.help-pre:
# Add your pre 'help' code here...

.help-post: .help-impl
# Add your post 'help' code here...



# include project implementation makefile
include nbproject/Makefile-impl.mk

# include project make variables
include nbproject/Makefile-variables.mk

就像在另一个问题中所说的,“实际上,IO.H报头从来都不是ISOC和C++标准的一部分。”


在这个问题中,最上面的答案给出了一个带有一点io.h的小库。我相信它会解决你的问题。:-)

它是
#include
还是
#include“io.h”
?您可以共享您的makefile吗?很可能您没有使用正确的包含路径。(在我的linux系统上,
io.h
位于
/usr/include/sys/
)我已经尝试了这两种方法,并且“io.h”我已经将makefile添加到了原始文章中。请原谅所有的混乱,但我一直在努力将其发布(新手错误)您是否尝试过
#include
?我将查看该链接,谢谢。是的,我试过sys/io.h