Netbeans C ++应用程序不会构建

时间:2014-12-16 20:33:26

标签: c++ netbeans

我最近安装了MiniGW编译器,以便我可以开始学习C ++。但是当我去创建一个新项目并让它包含main时,我从一开始就获得了两条错误消息(在项目创建之后)Cannot Find Include File <cstdlib>Unable to resolve identifier std以及当我尝试和#39时;清洁和建设&#39;项目,干净是成功的,而构建不是。我已经完成了谷歌搜索并浏览了这篇文章Netbeans 7.2 shows "Unable to resolve identifier" , although build is successful,但我不确定我的问题是否完全相同,因为我的项目没有建立(或者可能是,我不是&#39} ;知道),我也不确定我理解接受的答案。这可能是多个问题还是只有一个?我希望修复此问题以便我学习!

/* 
 * File:   main.cpp
 * Author: Zf
 *
 * Created on December 16, 2014, 1:50 PM
 */

#include <cstdlib>

using namespace std;

/*
 * 
 */
int main(int argc, char** argv) {

    return 0;
}

编辑:第7行和第8行是错误消息的位置。

2 个答案:

答案 0 :(得分:2)

Tool Collection设置得当吗?

例如,

<cstdlib>

中找到C:\minGW\lib\gcc\mingw32\4.8.1\include\c++

enter image description here

答案 1 :(得分:0)

  1. 听起来你需要告诉编译器在哪里找到cstdlib。请参阅:How to add a library include path for NetBeans and gcc on Windows?
  2. Cstdlib包含C函数,它们不包含在命名空间中。删除using namespace std;
相关问题