Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Don't blame the tools ... and ... don't focus on them. Instead, learn how to go about telling a digital computer how to do things. All programming tools (and for that matter, also "spreadsheets and what-not") are designed for that purpose. Especially in your early learning efforts, simply focus upon that.
I concur that you ought to learn how to write, compile, and debug programs via the command line first.
Reason being is that you'll learn the language properly.
Learn how to use gcc, and gdb (the debugger).
I highly recommend trying emacs as an editor, you can compile from within it and also invoke GDB from within it.
Thanks friend !
I think I am gonna learn the real way.I thought emacs is just an editor.So can it do all these tricks ? I have heard people saying it is much more than just an editor .So What tricks one can really do with emacs. Isn't it same as vi.
Reply soon and thanks!
vi and emacs are two different worlds, or two different religions. Both are really powerful and helpful, but both requires some learning. If I can suggest something try a simple editor first like gedit or geany and keep focus on command line tools and learn vi and/or emacs later (yes, someone will say they are also IDEs)
Don't blame the tools ... and ... don't focus on them. Instead, learn how to go about telling a digital computer how to do things. All programming tools (and for that matter, also "spreadsheets and what-not") are designed for that purpose. Especially in your early learning efforts, simply focus upon that.
Thanks for reply !
Well friend you too have a point.I think I would learn the terminal way for better understanding.In fact I will go for both and choose which suites me best.So which IDE would you recommend ?
For now I'd suggest just editing in emacs to become familiar with it. There's a command entry point where you enter commands like "compile" or "gdb". But then you need to also change the compile command to be "gcc ..." and so forth from whatever default emacs starts with. For the editing session it will remember your change, or you can configure your emacs profile to set it up a certain way. Best to just enter a session, if you choose to compile from within emacs, re-write the compile command when it prompts the first time. Odds are that you'd change that many times as you progress through editing different projects. The only real benefit here is that if you encounter syntax errors, you can type the sequence CTRL-` to "get next error" and the editor will automatically bring you to the bad line of code. I actually don't much compile out of emacs, and instead compile on the command line and then use the "goto-line" command to bring me to the bad line of code. The other thing is running GDB, you should learn that command line first, but when you invoke GDB from within emacs, same thing is that the default command will usually give you the correct form to debug your code. Remember to add the -ggdb switch when you compile. And the benefit here is once in GDB through emacs, you can view your source and see the points where breakpoints are, use the mouse to step in, or step over. Similar to things like Turbo debugger. All the same features are there as in command line GDB, just you don't have to know the syntax for them. Once again, I don't always do this, I usually enter the debugger quickly to examine a core file or to debug one nasty thing where I should've known better. Many times it's just easier to printf() out logs.
As far as core files go, in the command, or terminal, prompt where you run the program, issue "ulimit -c unlimited" to enable core file dumps. And if you have a critical fault in your program which will cause a core file, then you'll get one. You can then analyze that core file using GDB. The defaults are that core files will not be created, hence why it's necessary to issue the ulimit command.
vi and emacs are two different worlds, or two different religions. Both are really powerful and helpful, but both requires some learning. If I can suggest something try a simple editor first like gedit or geany and keep focus on command line tools and learn vi and/or emacs later (yes, someone will say they are also IDEs)
Thanks !
gedit's cool .And I also Wish to learn vi or emacs like a pro.
For now I'd suggest just editing in emacs to become familiar with it. There's a command entry point where you enter commands like "compile" or "gdb". But then you need to also change the compile command to be "gcc ..." and so forth from whatever default emacs starts with. For the editing session it will remember your change, or you can configure your emacs profile to set it up a certain way. Best to just enter a session, if you choose to compile from within emacs, re-write the compile command when it prompts the first time. Odds are that you'd change that many times as you progress through editing different projects. The only real benefit here is that if you encounter syntax errors, you can type the sequence CTRL-` to "get next error" and the editor will automatically bring you to the bad line of code. I actually don't much compile out of emacs, and instead compile on the command line and then use the "goto-line" command to bring me to the bad line of code. The other thing is running GDB, you should learn that command line first, but when you invoke GDB from within emacs, same thing is that the default command will usually give you the correct form to debug your code. Remember to add the -ggdb switch when you compile. And the benefit here is once in GDB through emacs, you can view your source and see the points where breakpoints are, use the mouse to step in, or step over. Similar to things like Turbo debugger. All the same features are there as in command line GDB, just you don't have to know the syntax for them. Once again, I don't always do this, I usually enter the debugger quickly to examine a core file or to debug one nasty thing where I should've known better. Many times it's just easier to printf() out logs.
As far as core files go, in the command, or terminal, prompt where you run the program, issue "ulimit -c unlimited" to enable core file dumps. And if you have a critical fault in your program which will cause a core file, then you'll get one. You can then analyze that core file using GDB. The defaults are that core files will not be created, hence why it's necessary to issue the ulimit command.
Thanks !
The link's cool. Truly I will need some time to get all that stuff you just said cause I have just started learning C.But many thanks for your kind help.
will install everything you need to compile C/C++.
Thanks !
How much space and time would the download take and any documentation on using the command line tools would be great.
Again thanks for your help....
Depends on your internet connection. Space should be on the order of a couple hundred megs, I believe apt-get will tell you? Not sure, I'm not too familiar with apt-get.
If you want documentation on the command line build tools, you can use Google or the man pages, eg:
Code:
man gcc
will tell you nearly everything you need to know about using gcc.
Depends on your internet connection. Space should be on the order of a couple hundred megs, I believe apt-get will tell you? Not sure, I'm not too familiar with apt-get.
If you want documentation on the command line build tools, you can use Google or the man pages, eg:
Code:
man gcc
will tell you nearly everything you need to know about using gcc.
Thank you very much !
I am gonna try your tricks now.
fallow your uncles advice
over the summer tinker with C
and learn some of the differences and similarities between C and C++
BASICALLY " !!! HAVE FUN and tinker !!!! "
now as to an IDE
for simple things IT WILL JUST GET IN THE WAY!!!!
for everyday hacking ( even if it is a HUGE project) a IDE will cause more problems
Gedit and Kate and Emacs are all GREAT editors and do code highlighting
that really is all you need
( or less i learned using MS's "notepad.exe" a long time ago )
now if you want to create a rather complex big project then a IDE like "Eclipse" or "QT Creator" will be helpful
fallow your uncles advice
over the summer tinker with C
and learn some of the differences and similarities between C and C++
BASICALLY " !!! HAVE FUN and tinker !!!! "
now as to an IDE
for simple things IT WILL JUST GET IN THE WAY!!!!
for everyday hacking ( even if it is a HUGE project) a IDE will cause more problems
Gedit and Kate and Emacs are all GREAT editors and do code highlighting
that really is all you need
( or less i learned using MS's "notepad.exe" a long time ago )
now if you want to create a rather complex big project then a IDE like "Eclipse" or "QT Creator" will be helpful
I will say that IDEs have their place for UI or similar programming. To a degree.
For instance using the Android Development Kit, or being withing Microsoft Visual Studio, or XRecode for iOS development when you're doing an app or a user interface are helpful.
Meanwhile, as all are saying, it's best to understand the languages first. I started with C and have no problem with C++, C#, Objective-C, Swift, or Java, to name the few which I've ended up using on UI development. It's great to have the IDE for the storyboard part to make the pictures and screen layouts, but it's critical to know the language, or be able to comprehend the language so that you can make your application do something. All of those I've listed are mainly similar, just syntax and available library function calls really separates them from each other, in my opinion. The IDE is helpful to make the connections and establish the framework, then the remainder is writing code to accomplish your tasks.
In the end, I think it will really depend what types of programming you end up doing with C++.
Hello and thanks to all of you !
I think I got the solution.I have decided to use both build essentials and Eclipse IDE.So that I can get maximum exposure to the language and have a better understanding.If I encounter any problem in this regard I will surely gonna ask you people.
Again thanks for being so much kind and supportive.
To add to your choice to use Eclipse. I have used it, and similar to Visual Studio, one thing it does pretty well is completion of functions as well as syntax and scope checking so that you can't "get away" with incorrect practices so readily.
What I'd recommend is that in using it, use it as a typist and stay away from the mouse. That's really my main objection to IDEs is that they have forms or templates where they try to organize things and make it wizard based where it should not always be, my one exception is UI storyboard work. But if you just type your code, it of course tolerates it and also does the syntax and scope checking to assist you.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.