2

I'm an experienced Windows developer (Delphi, C/C++, C#, etc). I've just downloaded uBuntu 14.04 64-bit and then looked for some IDEs and saw geany got good reviews. After downloading it, I'm stumped as to how write and compile a simple "Hello world" application.

Note: I am very new to Linux! The file system looks rather odd to me after 20 years of living in Windows-world, so any help you can offer or a simple step-by-step guide would be much appreciated!

Thanks.

  • 1
    You probably need c++ compiler. Run sudo apt-get install g++ in terminal ( which is like cmd in windows) – Sergiy Kolodyazhnyy Jun 12 '15 at 22:22
  • Thanks Serg. Where do I find the command prompt? This is a brand new installation of uBuntu 14.04 LTS. I'm assuming that I'd be installing a C++ compiler called "g++", is that right? Would uBuntu pick that up itself or is it something I need to download? – AlainD Jun 12 '15 at 22:24
  • Did you use the Ubuntu Software Center to download Geany? you can install the g++ package in exactly the same way. If you want to use @Serg's method then you can open a terminal using the Ctrl+Alt+t key combination, or by typing terminal in the Ubuntu dash – steeldriver Jun 12 '15 at 22:36
  • 1
    Just compiled my first C++, Hello Linux program! Thanks. Named the file HelloWorld.cpp, compiled and ran! Where to from here? Are there any more fully-featured IDEs to create an application like a simple image editor? Is there anything on uBuntu that can be recommended with functionality something like Visual Studio? – AlainD Jun 12 '15 at 23:03
  • 1
    I would have a look at Qt. – s3lph Jun 13 '15 at 0:32
2

AlainD,

Geany actually has the options that you're looking for built in. At the top of the screen towards the middle there is a button that looks like a little gear, as well as a button that looks like a brick wall. These are your options for compile and run. Once you've written your code to your satisfaction, you simply click the compile button, and at the bottom of your screen you'll see the output, and if there are any compile time errors. Once complete (assuming no errors) clicking run will cause Geany to open your system's default terminal and execute the program. The terminal will show exit status code when complete and will remain open until you close it.

As for compilers, most major distributions of linux have a pre-packaged collection of compilers and linkers. For ubuntu I believe you would go to the terminal and type the following:

sudo apt-get update
sudo apt-get install build-essential

These two commands will update the list of packages on your system, and then install the essential libraries, headers, and compilers needed for C, C++, and other common programming languages.

Best of luck in your endeavors.

  • Because running into a brick wall is the obvious metaphor? ☺ – JdeBP Jun 13 '15 at 13:13
0

To make sure the plugins are installed:

sudo apt-get install geany-plugins

And to run it with root acess (won't work properly without it):

sudo geany

Then punch in your password. Hope this works for you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.