C ++无法在Netbeans中编译 [英] C++ not compiling in Netbeans

查看:126
本文介绍了C ++无法在Netbeans中编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Windows 10(64位)上使用C ++进行编码.我遵循了本教程并安装了Cygwin和Netbeans.我有一个简单的hello世界,但无法编译.这是错误

I am trying to code in C++ on Windows 10 (64 bit). I followed this tutorial and installed Cygwin and Netbeans. I have a simple hello world, but it can't compile. Here is the error

CLEAN SUCCESSFUL (total time: 312ms)
cd 'C:\Users\Sam\Documents\NetBeansProjects\CppApplication_1'
C:\Users\Sam\Desktop\Cygwin\bin\make.exe -f nbproject/Makefile-Debug.mk build/Debug/Cygwin-Windows/main.o
mkdir -p build/Debug/Cygwin-Windows
rm -f "build/Debug/Cygwin-Windows/main.o.d"
g++    -c -g -MMD -MP -MF "build/Debug/Cygwin-Windows/main.o.d" -o build/Debug/Cygwin-Windows/main.o main.cpp
In file included from /usr/lib/gcc/x86_64-pc-cygwin/5.4.0/include/c++/cstdlib:72:0,
                 from main.cpp:14:
/usr/include/stdlib.h:16:20: fatal error: stddef.h: No such file or directory
compilation terminated.
make: *** [nbproject/Makefile-Debug.mk:68: build/Debug/Cygwin-Windows/main.o] Error 1

COMPILE FILE FAILED (exit value 2, total time: 3s)

我将Cygwin下载到桌面上的文件夹中,并且在IDE中,工具->选项-> c/c ++->构建工具中的设置似乎正确

I downloaded Cygwin to a folder on the desktop and the settings appear to be correct in the IDE in tools->options->c/c++->build tools

我只希望能够在Windows上编写简单的程序,如果有更简单的选择,我会开放. Netbeans版本是8.2

I just want to be able to write simple programs on Windows and if there's an easier alternative I am open. The Netbeans version is 8.2

推荐答案

我会亲自放弃cygwin进行Windows C ++开发,然后访问 http://www. codeblocks.org ,但我会将编译器安装作为优先级进行排序.

I would personally ditch cygwin for C++ development on windows and go visit http://www.mingw.org/ for a full port of GCC. It's very easy to install and use.

Netbeans is a pretty good IDE with lots of support and plugins but you also might want to take a look at http://www.codeblocks.org but I'd get the compiler install sorted as a priority.

这篇关于C ++无法在Netbeans中编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆