• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Complete noob!

Try going to Tools > Plugins. Click the "Install" tab. If you don't see an entry called "C/C++", try searching for it in the "Available Plugins" tab.

Just checked. I have C/C++ installed already. It won't let me run the code. Its a very simple code straight out of the book. Is there a certain way you're supposed to set the project up? And what file type do I select to type the code in? Sorry for the dumb questions, I just really want to get a head start before school starts.
 
Upvote 0
Is it just the files with the code or is it a Netbeans project?

Its a netbeans project. I added a new file to the source folder in the project and typed the simple "Never fear, C++ I here!" Code and it won't run the file. For the project I selected C/C++ application and for the file I selected C++ source file.
 
Upvote 0
Cygwin I know from personal experience can be messy...a real kludge IMO. Basically it's supposed to be a *NIX compatibility layer on top of Windows. I bad experiences of it when trying to build versions of Rockbox in Windows, which is an open source music player software replacement for iPods. It was much easier to do in Linux.

Maybe you could try the Linux version of Netbeans, if the Win version is using Cygwin. Put Linux on a virtual machine or something, or install it alongside Windows dual-boot, or even better ditch Micro$oft Windoze completely. :thumbup:
 
  • Like
Reactions: Davdi and palmtree5
Upvote 0
Cygwin I know from personal experience can be messy...a real kludge IMO. Basically it's supposed to be a *NIX compatibility layer on top of Windows. I bad experiences of it when trying to build versions of Rockbox in Windows, which is an open source music player software replacement for iPods. It was much easier to do in Linux.

Maybe you could try the Linux version of Netbeans, if the Win version is using Cygwin. Put Linux on a virtual machine or something, or install it alongside Windows dual-boot, or even better ditch Micro$oft Windoze completely. :thumbup:

I love my windows :) but I just installed Code::Blocks and the file compiles correctly but still doesn't run. It just pops up with a command prompt type thing that says 'Hello World' press any key to exit. :banghead:
 
Upvote 0
Yup that should print out what it says. I'll try it later, I got Netbeans on my Linux PC, configured for C++ . :)



I just tried it in Xcode on my Macbook I got here at the moment, and it does work and do what it's supposed to. Will try Netbeans later.



Normally I don't do programming, "Hello World!" is about as far as I got myself....with C and C++ LOL ...all those brackets and curly braces makes my brain hurt. I like Fortran 77 myself.. :thumbup:
 
  • Like
Reactions: Android Addict
Upvote 0
I selected C++ application and code is in .cpp

Yeah I definitely forgot something but I'm not sure what. That's the same thing I did on netbeans and keep getting build unsuccessful. I'm gonna try to adjust my compiler settings in netbeans in the morning, I'll post an update then. Thanks for all the help guys, y'all are awesome! :)
 
Upvote 0
Yeah I definitely forgot something but I'm not sure what. That's the same thing I did on netbeans and keep getting build unsuccessful. I'm gonna try to adjust my compiler settings in netbeans in the morning, I'll post an update then. Thanks for all the help guys, y'all are awesome! :)

Is it giving a specific error when attempting to compile?
 
Upvote 0
Is it giving a specific error when attempting to compile?

When I try to compile it shows: Cannot run program "C:\Users\Public\Desktop\Cygwin" (in directory "C:\Users\Paul\Documents\NetBeansProjects\CppApplication_1"): CreateProcess error=2, The system cannot find the file specified



COMPILE FILE FAILED (exit value -2, total time: 390ms)
 
  • Like
Reactions: mikedt
Upvote 0
OK... I've just tried same cpp program in Netbeans 7.4 on Linux and I'm getting this...

P { margin-bottom: 0cm; } "/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/home/mike/NetBeansProjects/CppApplication_2'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux-x86/cppapplication_2
make[2]: Entering directory `/home/mike/NetBeansProjects/CppApplication_2'
mkdir -p build/Debug/GNU-Linux-x86
rm -f build/Debug/GNU-Linux-x86/main.o.d
cpp -c -g -MMD -MP -MF build/Debug/GNU-Linux-x86/main.o.d -o build/Debug/GNU-Linux-x86/main.o main.cpp
cpp: fatal error: is not a valid option to the preprocessor
compilation terminated.
make[2]: *** [build/Debug/GNU-Linux-x86/main.o] Error 4
make[2]: Leaving directory `/home/mike/NetBeansProjects/CppApplication_2'
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory `/home/mike/NetBeansProjects/CppApplication_2'
make: *** [.build-impl] Error 2




BUILD FAILED (exit value 2, total time: 174ms)

@Android Addict, is that the same error you're getting? This is with Netbeans 7.4. Presumably the Windows version of Netbeans is using Cygwin for building with GCC.

However in Kdevelop, which is an IDE for KDE, it builds and works just fine.
 
Upvote 0
OK... I've just tried same cpp program in Netbeans 7.4 on Linux and I'm getting this...

P { margin-bottom: 0cm; } "/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/home/mike/NetBeansProjects/CppApplication_2'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux-x86/cppapplication_2
make[2]: Entering directory `/home/mike/NetBeansProjects/CppApplication_2'
mkdir -p build/Debug/GNU-Linux-x86
rm -f build/Debug/GNU-Linux-x86/main.o.d
cpp -c -g -MMD -MP -MF build/Debug/GNU-Linux-x86/main.o.d -o build/Debug/GNU-Linux-x86/main.o main.cpp
cpp: fatal error: is not a valid option to the preprocessor
compilation terminated.
make[2]: *** [build/Debug/GNU-Linux-x86/main.o] Error 4
make[2]: Leaving directory `/home/mike/NetBeansProjects/CppApplication_2'
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory `/home/mike/NetBeansProjects/CppApplication_2'
make: *** [.build-impl] Error 2




BUILD FAILED (exit value 2, total time: 174ms)

@Android Addict, is that the same error you're getting? This is with Netbeans 7.4. Presumably the Windows version of Netbeans is using Cygwin for building with GCC.

However in Kdevelop, which is an IDE for KDE, it builds and works just fine.
No, I haven't had that error yet. Could I get Kdevelop on windows 7 64 bit?
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones