Author Topic: New to programming on Linux. What do I need?  (Read 11103 times)

0 Members and 1 Guest are viewing this topic.

Offline LiquidumDev

  • Neuling
  • *
  • Posts: 19
    • Wordpress
  • Branch: Stable (0.8.6)
  • Desktop: XFCE
  • GPU Card: AMD 7770
  • GPU driver: non-free
  • Kernel: 3.9.4-1 x64
  • Skill: Novice
New to programming on Linux. What do I need?
« on: 02. June 2013, 02:21:56 »
I'm a student for Game Development (C++) and I have decided to use Linux (Manjaro, obviously) as my OS of choice. I already have Sublime Text 2 installed (I used it under Windows w/ Dev-C++) so my question is this: What do I need to do to be able to compile C++ (.cpp) files within Manjaro?

Offline joshua

  • Core Team
  • *****
  • Posts: 986
  • Standing on the shoulders of giants...
  • Branch: unstable
  • Desktop: KDE / OpenBox
  • GPU Card: AMD A6-3420M
  • GPU driver: non-free
  • Kernel: linux310-x86
  • Skill: Guru
Re: New to programming on Linux. What do I need?
« Reply #1 on: 02. June 2013, 03:26:59 »
Welcome to linux  ;D
to be minimal you shouldn't need anything. you can use g++ to compile it out to a binary.
Code: [Select]
g++ inputfile.cpp -o outputbinarybut if you want something with more tools and a gui then I believe eclipse has what your looking for. I've never used it before but There's also netbeans. Keep inmind though these are IDE's and require a little bit of knowledge to run them whereas g++ just compiles  :D

To download eclipse
Code: [Select]
sudo pacman -S eclipseto download netbeans
Code: [Select]
sudo pacman -S netbeans
It's good to see more coders here.
« Last Edit: 02. June 2013, 03:31:10 by dcell »

Offline eskaini

  • Security Team
  • *****
  • Posts: 10842
  • I eat deleted accounts
  • Skill: Novice
Re: New to programming on Linux. What do I need?
« Reply #2 on: 02. June 2013, 03:33:39 »
Hi
I use codeblocks. Eclipse and netbeans have a much steeper learning curve, and even hello world is complicated. Like dcell said make sure you have a gcc/g++ compiler (sudo pacman -S gcc ) and grap codeblocks as well ( sudo pacman -S codeblocks ) all should be well:) good luck!
« Last Edit: 02. June 2013, 03:36:11 by rfk1ll »

Offline Zileene

  • Held Mitglied
  • *****
  • Posts: 536
  • Branch: Stable
  • Desktop: awesomeWM,Gnome
  • GPU Card: various
  • GPU driver: the one that works
  • Kernel: 4.1
  • Skill: Intermediate
Re: New to programming on Linux. What do I need?
« Reply #3 on: 02. June 2013, 04:58:55 »
The 'base-devel' meta package should set you up with the basics (yaourt uses the tools in there to build/install AUR packages).
Code: [Select]
sudo pacman -S base-devel
If you want to see what gets installed with it, then type this in a terminal:
Code: [Select]
pacman -Ss base-devel, or search for base-devel in pamac.

Have Fun!
While I may not always have the correct solution, my input could lead you in the right direction...
If you don't know what a command does, then type 'man <command>' or '<command> --help' to find out.

Offline joshua

  • Core Team
  • *****
  • Posts: 986
  • Standing on the shoulders of giants...
  • Branch: unstable
  • Desktop: KDE / OpenBox
  • GPU Card: AMD A6-3420M
  • GPU driver: non-free
  • Kernel: linux310-x86
  • Skill: Guru
Re: New to programming on Linux. What do I need?
« Reply #4 on: 02. June 2013, 09:26:24 »
The 'base-devel' meta package should set you up with the basics (yaourt uses the tools in there to build/install AUR packages).
Code: [Select]
sudo pacman -S base-devel
If you want to see what gets installed with it, then type this in a terminal:
Code: [Select]
pacman -Ss base-devel, or search for base-devel in pamac.

Have Fun!
Unless he did a net install, which I doubt if he's still somewhat new to linux, this package would be wrong for him. The only packages out of base-devel he could use would be g++ and gcc which may have already came installed on his system, while many of the other ones probably came installed such as make and sed. Other's are sure to have came with his system like pacman. His best bet is probably to install and IDE that comes with almost everything he needs as a dependency.

Offline dante

  • Vollwertiges Mitglied
  • ***
  • Posts: 218
  • Branch: testing
  • Desktop: KDE
  • GPU Card: GeForce GTX 275
  • GPU driver: non-free
  • Kernel: Kernel39 SMP x64
  • Skill: Intermediate
Re: New to programming on Linux. What do I need?
« Reply #5 on: 02. June 2013, 10:02:00 »
@LiquidumDev


As @dcell mentioned you should use first g++ and gcc for programming to understand the internal requirements of the language. With DE I recommended to use eclipse and netbeans are very good choice and easy for beginners (later also for advanced users).


As you know there are many Online games and the future move using more to play Online without to need installing any of them. So I think you should have a look in the LUA programming language, I think your education in the future not stops only in C++.


Second you need a good Texteditor with lot of useful features like syntax highlighting in different languages. I prefer for that geeny that I think is a very awesome Editor.


http://en.wikipedia.org/wiki/Lua_(programming_language)
http://www.lua.org/gems/
http://lua.gts-stolberg.de/en/index.php?uml=1


Have Fun!
--dante

Offline december

  • Core Team
  • *****
  • Posts: 94
  • Branch: stable
  • Desktop: Gnome
  • GPU Card: nVidia NVS 3100M
  • GPU driver: non-free
  • Kernel: linux44-x64
  • Skill: Intermediate
Re: New to programming on Linux. What do I need?
« Reply #6 on: 02. June 2013, 12:41:55 »
For C++ I strongly recommend QtCreator. It is really easy to use, provides syntax highlighting and when you install the whole thing you already have access to Qt so you can easily start to code a gui for your programs.

To compile your program from CLI you type in
Code: [Select]
g++ myProgram.cpp -o myProgram

Offline handy

  • Global Moderator
  • *****
  • Posts: 5738
  • Desktop: Openbox 3.6.1-3 & Worker :)
  • GPU Card: intel...
  • GPU driver: open-source
  • Kernel: OpenBSD
  • Skill: Intermediate
Re: New to programming on Linux. What do I need?
« Reply #7 on: 02. June 2013, 13:17:19 »
LiveCode very recently released as open-source, so it now is available to use with dual licenses. It is a very cool development/prototyping system making code that is portable across iOS, Android, Linux, OS/X, Windows, Server.

http://livecode.com/

I installed it from here today onto my 64bit system & it works fine:

http://livecode.com/download/
The ultimate tyranny in a society is not control
by martial law. It is control by the psychological
manipulation of consciousness, through which reality
is defined so that those who exist within do not even
realize that they are in prison.
  —  Barbara Marciniak

Offline LiquidumDev

  • Neuling
  • *
  • Posts: 19
    • Wordpress
  • Branch: Stable (0.8.6)
  • Desktop: XFCE
  • GPU Card: AMD 7770
  • GPU driver: non-free
  • Kernel: 3.9.4-1 x64
  • Skill: Novice
Re: New to programming on Linux. What do I need?
« Reply #8 on: 02. June 2013, 16:34:09 »
This was posted on the Manjaro Twitter. That makes me happy.


Alright, so I have installed GCC 4.8.0-4 via terminal using
Code: [Select]
sudo pacman -S gcc
I would like to install Sublime Text 2 as well, as it's my editor of choice. What is the code I would need for that? (I understand 'sudo' gives elevated privileges and 'pacman' is package manager, but what of '-S'? GCC is obviously the file/package I want to download.)

I went ahead and used gedit to create a 'hello world' program.

I used the following code to compile it and link it to 'main'
Code: [Select]
g++ /home/liquidum/Documents/main.cpp -o main
And then ran it using
Code: [Select]
/home/liquidum/main
User input seems to work fine as well, so that's awesome.

Thank you all for your help. If someone could answer how to install Sublime Text 2, I should be set.

Offline eskaini

  • Security Team
  • *****
  • Posts: 10842
  • I eat deleted accounts
  • Skill: Novice
Re: New to programming on Linux. What do I need?
« Reply #9 on: 02. June 2013, 16:53:50 »
We post every new topic to twitter automatically. ;)

You can install sublime with yaourt.

Code: [Select]
yaourt -S sublime-text

Offline LiquidumDev

  • Neuling
  • *
  • Posts: 19
    • Wordpress
  • Branch: Stable (0.8.6)
  • Desktop: XFCE
  • GPU Card: AMD 7770
  • GPU driver: non-free
  • Kernel: 3.9.4-1 x64
  • Skill: Novice
Re: New to programming on Linux. What do I need?
« Reply #10 on: 02. June 2013, 17:04:01 »
Aww, I felt kinda special for a moment.

Using that command, I get the following:
Code: [Select]
sublime-text 2.0.1-2 (Wed Sep 28 13:40:03 EDT 2011)
( Unsupported pachage: Potentially dangeruous ! )
==> Edit PKGBUILD ? [Y/n] ("A" to abort)

Am I to enter Y or N?

Offline eskaini

  • Security Team
  • *****
  • Posts: 10842
  • I eat deleted accounts
  • Skill: Novice
Re: New to programming on Linux. What do I need?
« Reply #11 on: 02. June 2013, 17:05:28 »
No, you don't need to edit the PKGBUILD, so say N. ;)


EDIT:

and please don't use Eclipse or Netbeans to develop with C++. They are primary for Java. But if you have to choose one then i prefer Netbeans.

But for the first time i would use a text editor and the terminal to compile, and then i would use QtCreator or Code::Blocks.
« Last Edit: 02. June 2013, 17:08:16 by Parmaster »

Offline LiquidumDev

  • Neuling
  • *
  • Posts: 19
    • Wordpress
  • Branch: Stable (0.8.6)
  • Desktop: XFCE
  • GPU Card: AMD 7770
  • GPU driver: non-free
  • Kernel: 3.9.4-1 x64
  • Skill: Novice
Re: New to programming on Linux. What do I need?
« Reply #12 on: 02. June 2013, 17:17:27 »
Alright. Thanks for that, mate.

And I prefer using an editor and compiler. I had used VS2012 on Windows for a while, but I just prefer editors and compilers separately.

Now that I've got GCC and Sublime Text installed, I'm ready to get back into my C++ book.

Thanks everyone for your suggestions.

One more question, though. Where do you recommend I go after finishing the book I'm doing? It's Beginning C++ Through Game Programming [Amazon].

Offline eskaini

  • Security Team
  • *****
  • Posts: 10842
  • I eat deleted accounts
  • Skill: Novice
Re: New to programming on Linux. What do I need?
« Reply #13 on: 02. June 2013, 17:21:26 »
Well, after this i would begin to develop my own games. ;)

Offline dante

  • Vollwertiges Mitglied
  • ***
  • Posts: 218
  • Branch: testing
  • Desktop: KDE
  • GPU Card: GeForce GTX 275
  • GPU driver: non-free
  • Kernel: Kernel39 SMP x64
  • Skill: Intermediate
Re: New to programming on Linux. What do I need?
« Reply #14 on: 02. June 2013, 20:52:53 »
There are many Tools for Development but the most IDE's on Windows are loaded with functions that you never use. The OpenSource Tools have the ability supported a lot of programming languages that you can using in Windows too. And of course a long time maintenance. 


So have a look in the following links that can help you to use your right Development Environment for you that makes easier your life.


http://sourceforge.net/projects/upp/
http://www.codelite.org/
http://www.codeblocks.org/


http://www.yolinux.com/TUTORIALS/LinuxTutorialC++.html


@handy thanks for your links I have an eye of this tools. :)


--dante