C++ not compiling in Netbeans

会有一股神秘感。 提交于 2019-12-08 10:48:55

问题


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)

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

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


回答1:


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.



来源:https://stackoverflow.com/questions/43470379/c-not-compiling-in-netbeans

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!