SRL Archive - General

#3 attempt at learning c++


rj

2013-10-26 21:17:42

attempt #3 at learning c++

first time I was in the 7th grade (5 years ago) (for non Americans that's around age 12-13)
second time was like 4 months ago


never actually got serious but I'm downloading eclipse for c++ ( @Brandon umad? :D) because I'm the most familiar with it


Any tips on what stuff I should make? (It's a shame there no c++ based bot for RS otherwise this would be a lot more easy)

Kasi

2013-10-26 21:38:55

As much as I love eclipse I would recommend code::blocks. Also get yourself a good compiler (MinGW). i consider those two to be essential when coding c/c++.
http://www.codeblocks.org/
http://www.mingw.org/

On a side note, Brandon has always told me to get the latest MinGW of sourceforge.
http://sourceforge.net/projects/mingwbuilds/files/host-windows/releases/ -> Latest Version -> Word Length -> Posix -> sjlj -> latest revision
then just copy the contents of the folder so it looks like "C:/mingw/bin" in your c drive. or you could just get the installer, i personally find the sourceforge method alot easier.

Another thing you could look into is Msys. (Minimal System), i dont consider it essential but its nice to have since many of the projects at villavu that aren't coded in lape / ps such as smart and brandon's GLX (up until a couple hours ago) use Msys to compile.

Edit :

*cough* @Brandon;*cough*

From: Officer Barbrady
(It's a shame there no c++ based bot for RS otherwise this would be a lot more easy)

rj

2013-10-26 21:45:36

First off how do I run a hello world program?


I'm just doing

#include <iostream>
using namespace std;

int main ()
{
cout << "Hello World!";
return 69;
}

Kasi

2013-10-26 21:56:28

From: Officer Barbrady
First off how do I run a hello world program?


maybe try clicking the down arrow next to the play button and click the correct project? if everything is as it should be your compiler should find the entry point through your source just fine.

Edit: another thing; Please don't use java conventions such camel casing in c++.

rj

2013-10-26 21:57:37

From: Kasi
maybe try clicking the down arrow next to the play button and click the correct project? if everything is as it should be your compiler should find the entry point through your source just fine.



same error

Kasi

2013-10-26 22:00:06

From: Officer Barbrady

same error


did you build it? what does the little hammer do? i dont have Eclipse C++ on this system and look at my first post.

rj

2013-10-26 22:02:55

From: Kasi
did you build it? what does the little hammer do? i dont have Eclipse C++ on this system and look at my first post.


yea I used the hammer to build it

Brandon

2013-10-26 23:23:09

From: Officer Barbrady
yea I used the hammer to build it


Ha! Who's mad now? huh?! ;)

http://stackoverflow.com/questions/9407430/launch-failed-binary-not-found-eclipse-for-c-in-windows

Read that. That's how you fix it. See if you didn't use eclipse, you wouldn't have this problem of going through a whole setup..

Le Jingle

2013-10-27 03:47:17

I'll stop after this much (@OP):
A book will allow you to learn. Learning before leaping.
End of my input.

rj

2013-10-27 08:16:02

From: Brandon
Ha! Who's mad now? huh?! ;)

http://stackoverflow.com/questions/9407430/launch-failed-binary-not-found-eclipse-for-c-in-windows

Read that. That's how you fix it. See if you didn't use eclipse, you wouldn't have this problem of going through a whole setup..


Code blocks isn't printing hello world though

it can't find the compiler



no idea why…

Brandon

2013-10-27 10:44:53

From: Officer Barbrady
Code blocks isn't printing hello world though

it can't find the compiler

no idea why…



I have mine as:


This setup also works just fine as well; though I prefer the above:

You should get used to setting up a toolchain.

Basically works like this. It needs to find gcc.exe and g++.exe within your mingw64/bin folder.
What you can do is click the button that has the […] and select the right exe.

For C, you want to select the one ending in gcc.exe.
For C++, you want to select the one ending in g++.exe.
For linking dynamic libs, you want to select the one ending in g++.exe.


These usually begin with x86_64 <–64 bit compiler or i386 <– 32 bit compiler.

SubiN

2013-10-27 23:08:03

learning to program c in ubuntu is more fun imo

Daniel

2013-10-28 00:10:26

From: Le Jingle
I'll stop after this much (@OP):
A book will allow you to learn. Learning before leaping.
End of my input.


^ This.
@Officer Barbrady; you should purchase a book on the C++ language. It will do you wonders.

mauri

2013-10-29 05:42:31

Codeblocks is much better IMO. There is a binary with g++ built-in

sourceforge.net/projects/codeblocks/files/Binaries/12.11/Windows/codeblocks-12.11mingw-setup_user.exe

Print "Hello world" code:


#include <iostream>
using namespace std;

int main(){

cout << "Hello World";
return 0;
}

Try that

kingarabian

2013-11-08 14:42:09

Why not use Visual Studio? It's very user friendly, especially for first timers.

rj

2013-11-08 15:46:08

From: kingarabian
Why not use Visual Basic? It's very user friendly, especially for first timers.


Because I don't want to download a 4gb file with slow internet

Enslaved

2013-11-08 16:03:44

From: kingarabian
Why not use Visual Basic? It's very user friendly, especially for first timers.

Surely you mean Visual Studio not Visual Basic

kingarabian

2013-11-09 21:09:58

Yeah I did, excuse me.