|
Post by matthew on Mar 5, 2009 3:08:19 GMT -5
Download Code::Blocks from here. Start a New Project...Click Empty projectClick NextGive your project a name, I've called mine HelloWorldNow click FinishNow add an Empty file to the project Click YesNow Save your file, I've called mine main.cppSelect Debug & Release then click OKEnter the following code Click BuildThe project should build without any errors or warnings, now click RunYou should see the following in a Command Prompt
|
|
|
Post by PeterMaria on Mar 5, 2009 7:05:00 GMT -5
Hi Matthew,
has Code:: Blocks no Namespace std ?
|
|
|
Post by matthew on Mar 5, 2009 9:09:40 GMT -5
Code::Blocks is just the code editor, gcc (or in this case g++) is the compiler & I could have used namespace std but it isn't recommended. Another way to write the program is as follows... #include<iostream>
int main() { using std::cout; using std::cin; using std::endl;
cout << "Hello, World!" << endl;
cin.get(); }
|
|
zack8686
Posts a bit
gl-Home in wikispace
Posts: 207
|
Post by zack8686 on Mar 5, 2009 22:17:39 GMT -5
i've followed what you tought . But when i press "Build " , in the Log& others section , appears "nothing to be done . Why , is it because these is no compiler for my CodeBlock ? If yes , can you please post a link so that I can download it ?
-Thanks-
|
|
|
Post by matthew on Mar 5, 2009 23:05:02 GMT -5
On the download page here, you should have downloaded the codeblocks-8.02mingw-setup.exe version.
|
|
|
Post by shadow008 on Mar 6, 2009 11:48:26 GMT -5
code blocks has problems with life......(too emo)
|
|
zack8686
Posts a bit
gl-Home in wikispace
Posts: 207
|
Post by zack8686 on Mar 7, 2009 8:42:51 GMT -5
I've downloaded codeblocks-8.02mingw-setup.exe version and followed every steps , but still nothing appears... WHY?
|
|
|
Post by matthew on Mar 7, 2009 12:43:02 GMT -5
Click Settings & then Compiler and debugger...Then click the Toolchain executables tab, then click Auto-detect.
|
|
zack8686
Posts a bit
gl-Home in wikispace
Posts: 207
|
Post by zack8686 on Mar 9, 2009 23:40:15 GMT -5
Ok , now I can compile . But , in Log & Others , there show :
-"iostream: No such file or directory" -"error: 'using' undeclared (first use in this function) " -"error: (Each undeclared identifier is reported only once" -"error: for each function it appears in" -"error: syntax error before "std" " -"error: 'cout' undeclared (first use in this function) " -"error: 'endl' undeclared (first use in this function) " -"error: 'cin' undeclared (first use in this function) "
Can you please solve my problem ??
|
|
|
Post by matthew on Mar 9, 2009 23:57:56 GMT -5
You did save your program as a .cpp file didn't you?
Those errors usually occur when someone saves a C++ file as a C file.
|
|
|
Post by smc44 on Mar 10, 2009 6:35:16 GMT -5
yae matthew is right. make sure the file is also part of an empty project
|
|
zack8686
Posts a bit
gl-Home in wikispace
Posts: 207
|
Post by zack8686 on Mar 10, 2009 7:58:01 GMT -5
It works !! Great !! Now , matthew , can you post more examples ? Like : -ways to make plugin for Basic4gl -useful programmes using CodeBlock codings (web browser) ?? -something that's related with desktop's stuff ,e.g : ".reg" -autorun maker -game installer -file compresser -video player -file downloader - .......
Can that be done using CodeBlock ? If yes, then please post some tutorials in solving any of my questions .
-Thanks in advance !-
|
|
|
Post by matthew on Mar 10, 2009 9:01:29 GMT -5
All the examples that you want can be written in C or C++ but I doubt if I'd have the time or the motivation to write them. I could upload a few GLUT - FreeGLUT examples later on if you want them. If you need help writing a dll for Basic4GL, I suggest downloading the Plugin SDK from the website as it contains some example programmes.
|
|
zack8686
Posts a bit
gl-Home in wikispace
Posts: 207
|
Post by zack8686 on Mar 13, 2009 2:58:18 GMT -5
err... What is GLUT ? Is it using the same codings as C++ in C::B ??
|
|
|
Post by matthew on Mar 13, 2009 3:08:00 GMT -5
When you write an OpenGL program in C or C++ you usually end up writing a lot of tedious code to create a Window & deal with the keyboard & mouse. If you use GLUT or FreeGLUT it makes OpenGL programming a lot easier by handling all of that hard work for you.
|
|