Find the answer to your Linux question:
Results 1 to 8 of 8
Like Tree1Likes
  • 1 Post By JonnyFrond
Hi Guys and Gals, Iīve finally got myself a linux thing going on via VirtualBox on my mac and chosen Ubuntu, it seems the logical place to start. Now to ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2011
    Location
    London UK
    Posts
    29

    Developer tools


    Hi Guys and Gals,

    Iīve finally got myself a linux thing going on via VirtualBox on my mac and chosen Ubuntu, it seems the logical place to start.

    Now to start playing with it.

    Let me give you a little background so you can better assess my question.

    I am studying Mechatronics Engineering at Uni, Thatīs Robotics and automation for those that dont know the word. I use things like AutoCAD and Matlab quite a bit, and I am learning to program mainly in C/C++ and also learning python to help me along the way. On the mac, I use Xcode because itīs there and I am trying to learn Terminal. I want to be a proper geek basically, not a part time one.

    Browsing through Ubuntu and the software center, I have found Netbeans and Eclipse and got them both to see which I would end up prefering. Eclipse is now stumping me as there is no C/C++ bit for it.

    So my questions are really, firstly how do I deal with the C/C++ bit, where do I find that, and can I start a little bit of discussion on the different environments and peoples preferences.

    Kind Regards

    Jonny.

  2. #2
    Penguin of trust elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    3,677
    Have a look at code::blocks which is quite a nice light IDE. Try installing the build-essential package (run
    Code:
    sudo apt-get install build-essential
    in a terminal) which will give you all the libraries and compilers.
    "I used to be with it, then they changed what it was.
    Now what was it isn't it, and what is it is weird and scary to me.
    It'll happen to you too."

    Grandpa Simpson



    The Fifth Continent

  3. #3
    Just Joined!
    Join Date
    Aug 2011
    Location
    London UK
    Posts
    29
    I'm obviously too new to this, as I don't understand what it is I have just installed, and I don't know where to find it to use it.

    Is it part of net beans or eclipse, or is it something on it's own.

    Also when I went to the website to find it I find they don't do an ubuntu one.

    I need hand holding on this one I am afraid.

    Kind regards

    Jonny

  4. $spacer_open
    $spacer_close
  5. #4
    Penguin of trust elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    3,677
    Build essential is a "meta package". It installs various compilers including c and c++ along with the headers and libraries that interact with the system such as stdio.h.

    To use gcc (the c compiler) you might create a simple program such as

    Code:
    #include <stdio.h>
    
    void main()
    {
    	printf("Hello World\n");
    }
    using any text editor and then assuming you saved it as helloworld.c in your home directory, you would open a teminal and run
    Code:
    gcc helloworld.c -o helloworld
    which would either compile the program to an executable called helloworld or spit out a whole raft of errors.

    So, these are stand alone items that you can use. I'm afraid I don't know about eclipse or netbeans but code::blocks found and configured itself to use the compilers when I first ran it.

    Code blocks may be in the repo so again in a terminal, run the following
    Code:
    apt-cache search codeblocks
    and if it's found, run
    Code:
    sudo apt-get install codeblocks
    to install the IDE. If you are more comfortable installing through a GUI, you can search for things and install through synaptic.
    "I used to be with it, then they changed what it was.
    Now what was it isn't it, and what is it is weird and scary to me.
    It'll happen to you too."

    Grandpa Simpson



    The Fifth Continent

  6. #5
    Just Joined!
    Join Date
    Aug 2011
    Location
    London UK
    Posts
    29
    Thanks elija,

    Do you see what I mean about being walked through it, I have just done a helloworld program and it has compiled I think, but I can't run it.

    How do I run the executable I have just built?

    typing in the file name returns a command not found error?
    I feel really thick here, as this seems so simple there is no info on the web anywhere on this, been on google now for an hour with no luck????????????

  7. #6
    Penguin of trust elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    3,677
    Make sure you are in the directory where the program is and try running
    Code:
    ./helloworld
    asuming that's what you called it. You may need to tell Linux that people are allowed to run it as a program in which case run
    Code:
    chmod +x helloworld
    to do so.
    "I used to be with it, then they changed what it was.
    Now what was it isn't it, and what is it is weird and scary to me.
    It'll happen to you too."

    Grandpa Simpson



    The Fifth Continent

  8. #7
    Linux Newbie theKbStockpiler's Avatar
    Join Date
    Sep 2010
    Location
    Upstate NY
    Posts
    211
    Anjuta is going to make things a lot Clearer. Your Package-Manager can most likely install it for you. After installing it will be found in the Applications> Programming menu. Do a web search of " Install Anjuta (whatever your distro name is) "or whatever your Package-Manager name is .

  9. #8
    Just Joined!
    Join Date
    Aug 2011
    Location
    London UK
    Posts
    29
    Thanks Elija, that clears it all up for me.

    As for making things easier, that's not what I am after, I want to learn how to do it anyway and learn how to get around it if I come across problems. I have a mac for my everyday work, being stuck with this is part of the fun in my mind.

    Regards everyone

    Jonny
    jayd512 likes this.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •