User forums > Using Code::Blocks
simple c++ project
anupgupta:
Hello
I am using Ubuntu 10.04, and installed code::blocks in it...what i am looking is how do i set it up for a simple hello world program in c++ using gcc compiler..
any suggestions most welcome...
Jenna:
"File -> New -> Project ..."
http://www.codeblocks.org/user-manual
DonSlowik:
Wondering if there is a step-by-step guide for editing, compiling, debugging a simple HelloWorld.cc program out there. Assuming we have Code::Blocks is set up all ready, just the steps to get us up and going..
Thanks,
Don
oBFusCATed:
1. "File -> New -> Project ..."
2. Choose console application
3. Press GO
4. Follow the steps
5. Press the gear button to build the project
6. Press the green play like button to run the project (gear + play == build & run)
7. Press the red play like button to debug the project
gentoo:
--- Quote from: anupgupta on May 16, 2010, 05:12:57 pm ---Hello
I am using Ubuntu 10.04, and installed code::blocks in it...what i am looking is how do i set it up for a simple hello world program in c++ using gcc compiler..
any suggestions most welcome...
--- End quote ---
I am using same OS and got it working all i did when i got codeblocks program up under tab "start here" in the project area i scrolled down to start a new project clicked on that and a window opened i used console application to make a simple program once i double-clicked that another window opens select next then c++ then next and this is tricky part i had to go into terminal outside of codeblocks to mkdir test went back to codeblocks program to name project test then clicked next then last window came up click finish i ended up back at codeblocks program in management on the left hand side under workspace you see a kinda of like tree with your project name under workspace drop down to sources and under sources a main.cpp shows up double click that and program should show mine was already made by the way after experimenting a couple of days i find it seems when you program need to use "using namespace std;" as a global before the int main() or to declare it in the program like so "std::cout << "Hello World!\n"; i still can't see why i needed to use <iostream> like so when i tried it like this #include <iostream.h> it couldn't find the header and therefore gave me compilation errors in my functions but i can add something like #include <stdlib.h> just not with <iostream> im not sure this will help because everyone thinks and does things differently that's the part of programming that makes it unique i need a manual bad i don't know the headers or functions() under those headers if anyone can suggest a book or something please let me know:)
Navigation
[0] Message Index
[#] Next page
Go to full version