Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: need help for c++ programming.

  1. #1
    Join Date
    Jul 2010
    Location
    solapur , india
    Beans
    82
    Distro
    Ubuntu 14.04 Trusty Tahr

    Question need help for c++ programming.

    I am trying to learn c++. I installed build-essential. I have read some documentations about it. i tried the same way as mentioned in documentation but when i save gedit file of source code i get following error....... (gedit:3838: GLib-GObject-CRITICAL **: g_object_ref: assertion `object->ref_count > 0' failed Is there anyone who know how to resolve this problem? Thanks in advance.
    Last edited by chinmay3; November 21st, 2010 at 06:50 AM.

  2. #2
    Join Date
    Oct 2008
    Location
    Maryland, USA
    Beans
    300
    Distro
    Kubuntu 9.10 Karmic Koala

    Re: need help for c++ programming.

    There is an excellent area, a sub forum, for help with these kind of problems called Programming Talk. Maybe a nice mod will move this post there.

    In the meantime, please provide more info about your development environment and your error message. Have you had success doing any coding? Did the typical first program, "Hello, World" work? Show us the code that's not working - post code in code tags - and copy exactly the commands you're using to compile and run the code and the error messages you're getting.

    Good luck, and keep coding!
    OpenSUSE: Dell Inspiron 8600 and Gateway GT5678
    MacOS X 10.5.8 PowerBook G4 12"
    Linux user #: 501795

  3. #3
    Join Date
    Jun 2007
    Location
    Paraparaumu, New Zealand
    Beans
    Hidden!

    Re: need help for c++ programming.

    Thread moved to Programming Talk.
    Forum DOs and DON'Ts
    Please use CODE tags
    Including your email address in a post is not recommended
    My Blog

  4. #4
    Join Date
    Aug 2010
    Location
    Lancs, United Kingdom
    Beans
    1,588
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: need help for c++ programming.

    Quote Originally Posted by chinmay3 View Post
    I am trying to learn c++. I installed build-essential. I have read some documentations about it. i tried the same way as mentioned in documentation but when i save gedit file of source code i get following error....... (gedit:3838: GLib-GObject-CRITICAL **: g_object_ref: assertion `object->ref_count > 0' failed Is there anyone who know how to resolve this problem? Thanks in advance.
    I don't really see why reports of bugs in gedit/glib need to be moved to Programming Talk, unless you are wanting help in fixing gedit/glib, and as you are just learning that would be somewhat ambitious!

    From reading the many similar posts in other forums, these messages are due to relatively unimportant bugs in gedit/glib. Here's one of many http://ubuntuforums.org/showthread.php?t=1264420

    Does your file save? If so, don't worry about it, or run gedit from the menu rather than the command line when you won't see the message.

    If these messages are a a real problem for you, then simply switch to one of the many many alternatives to gedit: vim, emacs, Geany etc.

  5. #5
    Join Date
    Feb 2010
    Location
    London
    Beans
    130
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: need help for c++ programming.

    Quote Originally Posted by chinmay3 View Post
    I am trying to learn c++. I installed build-essential. I have read some documentations about it. i tried the same way as mentioned in documentation but when i save gedit file of source code i get following error....... (gedit:3838: GLib-GObject-CRITICAL **: g_object_ref: assertion `object->ref_count > 0' failed Is there anyone who know how to resolve this problem? Thanks in advance.
    Can you please show us your source code ?

    Also, to begin you should use an IDE. I suggest you install CodeLite from Synaptic. It's much easier than writing text files, because:
    * when compiling and linking with g++, it outputs errors so you can click on them and it will point you to the corresponding line of code
    * you can then run your program in debug, doing a step by step execution (using F5, F9, F10, F11 keys, just like in MSVC)

    I strongly suggest you start coding in plain C. Only when you fully grasp the subtilties of C should you attempt to learn C++.
    Last edited by lucasart; November 21st, 2010 at 12:51 PM.

  6. #6
    Join Date
    Nov 2010
    Location
    Madras, India
    Beans
    201

    Re: need help for c++ programming.

    Quote Originally Posted by chinmay3 View Post
    I am trying to learn c++. I installed build-essential. I have read some documentations about it. i tried the same way as mentioned in documentation but when i save gedit file of source code i get following error....... (gedit:3838: GLib-GObject-CRITICAL **: g_object_ref: assertion `object->ref_count > 0' failed Is there anyone who know how to resolve this problem? Thanks in advance.
    Build essential shouldn't be necessary for taking your first steps with C++. Just g++ and gdb should be sufficient, and maybe boost as well. Which documentation did you read. I think if you're really serious about this, getting an hardcopy book should prove very useful. Two of the best are 'C++ Primer' and 'The C++ Programming Language.'

    As for your gedit assertion, it seems to be a bug in your version gedit/glib. One way is to try compiling and installing gedit from source. Also ensure that you've applied all the latest updates offered by the update manager. Does this happen when saving any file, or only under some circumstances?

    Anyway, in the interim, to get work done, use another editor like GVim or Kate.
    Last edited by santosh83; November 21st, 2010 at 12:53 PM.

  7. #7
    wojox is offline I Ubuntu, Therefore, I Am
    Join Date
    Apr 2009
    Beans
    8,628

    Re: need help for c++ programming.

    How are you calling it?

    Code:
    g++ test.cpp -o test

  8. #8
    Join Date
    Apr 2007
    Location
    (X,Y,Z) = (0,0,0)
    Beans
    3,715

    Re: need help for c++ programming.

    That error message is completely irrelevant... You're free to report that bug in Gedit, but chances are high that it already was


    Quote Originally Posted by lucasart View Post
    Also, to begin you should use an IDE. I suggest you install CodeLite from Synaptic. It's much easier than writing text files, because:
    * when compiling and linking with g++, it outputs errors so you can click on them and it will point you to the corresponding line of code
    * you can then run your program in debug, doing a step by step execution (using F5, F9, F10, F11 keys, just like in MSVC)
    No, please... The sole fact that you describe the use of keys as an advantage of IDEs reflects my opinion on them: they're not for beginners who still don't know the concepts behind the programming process, but for people that already know them and need an environment that displays all sort of needed tools in a single place (but knowing how to fix stuff manually when something fails).

    I strongly suggest you start coding in plain C. Only when you fully grasp the subtilties of C should you attempt to learn C++.
    Well, I'd suggest Python before C or C++, but that's another discussion. So, if the alternatives are C and C++, well, I'd go for C, then some unrelated OOP language (whatever: Python, Ruby, Common Lisp, even Smalltalk-80!) and then C++, so that you appreciate the STL (but so that you also don't adore it neither consider it the best thing in the programming universe...).

  9. #9
    Join Date
    Oct 2008
    Location
    Maryland, USA
    Beans
    300
    Distro
    Kubuntu 9.10 Karmic Koala

    Re: need help for c++ programming.

    chinmay3,

    See what you've started? Not your fault, obviously.

    Please post your code and the tutorial(s) or book(s) you're using to start your C++ journey, and let's get you on your way, out of the middle of this argument. If you need a learning resource, check out the stickies.
    OpenSUSE: Dell Inspiron 8600 and Gateway GT5678
    MacOS X 10.5.8 PowerBook G4 12"
    Linux user #: 501795

  10. #10
    Join Date
    Jul 2010
    Location
    solapur , india
    Beans
    82
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: need help for c++ programming.

    this is why i am in love with Ubuntu. The community, lots of helping hands to pull you out of trouble , whoever you are, wherever you are. Thanks everybody. lets come to the point. here is link of page what i have followed.: http://www.ubuntugeek.com/how-to-ins...c-program.html I done exactly same as there written. I have little experience with 'c' programming but its with turbo c compiler on windows xp. Yes the file get saved even after error. I regularly update my system.

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

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