Thread: Eclipse CDT & curses

  1. #1
    Registered User sbaginov's Avatar
    Join Date
    May 2010
    Location
    Italy
    Posts
    19

    Eclipse CDT & curses

    Newbie question.
    Adding curses support to a C app generates the following:
    Code:
    Error opening terminal: unknown.
    as soon as it is compiled in the Eclipse IDE.

    Is there a way/option/flag/extension/plugin to run, test and debug curses applications inside CDT or do I have to move onto another development platform?
    I hope not to be the latter.

    Thx in advance

  2. #2
    Registered User jeffcobb's Avatar
    Join Date
    Dec 2009
    Location
    Henderson, NV
    Posts
    875
    I have never found Eclipse to be exceedingly C or C++ friendly...more like hostile at the worst possible time...
    C/C++ Environment: GNU CC/Emacs
    Make system: CMake
    Debuggers: Valgrind/GDB

  3. #3
    {Jaxom,Imriel,Liam}'s Dad Kennedy's Avatar
    Join Date
    Aug 2006
    Location
    Alabama
    Posts
    1,065
    Are you attempting to run this app through Eclipse? If so, attempt it from a "real" terminal window. It could be that eclipse does not set up the environment correctly such that curses doesn't know how to interact with the shell.

  4. #4
    Registered User sbaginov's Avatar
    Join Date
    May 2010
    Location
    Italy
    Posts
    19
    Quote Originally Posted by Kennedy View Post
    Are you attempting to run this app through Eclipse? If so, attempt it from a "real" terminal window. It could be that eclipse does not set up the environment correctly such that curses doesn't know how to interact with the shell.
    Yes this it.
    Eclipse compiles everything and I can run the binary from a terminal window.
    In fact, I would like to run my program inside the IDE that flawlessly integrates gdb, too.

    @jeffcobb
    Well, if you run it with the help of the poweredbypulse.com small applet (these guys regularly contribute open source code to Eclipse) it works like a charm and it is easy adding, changing, updating and removing software, be it the core or a plugin.
    Which IDE do you work with? I thought Eclipse is just simply the IDE, by definition, for almost every language we may imagine: it is cross platform and, (it doesn't hurt), IBM is one of its biggest supporters spending money on regular improvements. Probably I am too new to Linux development... Any suggestion for a friendly C IDE would be greatly appreciated!
    I see you use cmake, but, really, just command line editing and bash scripts for every day development? No IDE autocompletion, checks, suggestions, projects? It's hard always having to type commands to commit changes to an SVN/CVS server, changing directories, copying and moving long file names with spaces in front of a terminal...
    And I thought of me as a sort of vi/mc/edlin/nc guy (sort of almost extinct humanoid)...
    Last edited by sbaginov; 05-19-2010 at 10:53 AM.

  5. #5
    {Jaxom,Imriel,Liam}'s Dad Kennedy's Avatar
    Join Date
    Aug 2006
    Location
    Alabama
    Posts
    1,065
    > No IDE autocompletion, checks, suggestions, projects?

    I use vim and Makefile 's myself. I have never had a problem. I even have to push up my stuff to a StarTeam server. . . easy money.

    > It's hard always having to type commands to commit changes to an SVN/CVS server, changing
    > directories, copying and moving long file names with spaces in front of a terminal...

    The IDE is usually the easy thing. . . thinking through the problem, drafting a solution are the hard parts. The coding should be second nature.

    > And I thought of me as a sort of vi/mc/edlin/nc guy (sort of almost extinct humanoid)...

    Scripting is comes almost 1st nature to me. . . like eating (which I do very well too!). So, you are not alone.

  6. #6
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Yeah, if you can use vim and mc well I don't see any hassles. Maybe that takes time. You can add whatever you want to the mc user menu to automate whatever tasks to act on files or directories by calling some program (you can program, remember?), and vim probably has more autocompletion (and similar) plugins than most (if not all) other editors or IDE's. Also it's programmable, which is where all those plugins come from, altho I have never bothered to learn the language*. Still not sure that I see much real value in integrating the debugger, I guess it's a question of useful you find that. Apparently there are some plans to do that with vim.

    I always find it easier to work out my own way of staying organized, etc, and adapting familiar, ubiquitous, highly adaptable modular tools to that rather than learning how it's done with some monolithic app.

    *another plan apparently in the works is to make it programmable with python. I think to some extent that is already possible, and with perl and ruby, but I've never explored the option.
    Last edited by MK27; 05-19-2010 at 11:49 AM.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  7. #7
    Registered User jeffcobb's Avatar
    Join Date
    Dec 2009
    Location
    Henderson, NV
    Posts
    875
    While it is supposed to work with all languages (and it does to an extent) it is seriously slanted towards Java and Java-style projects and make systems.

    CMake runs and works flawlessly on all of the platforms I need and many I don't. As for autocompletion and such I guess I know my target platform and language well enough that autocompletion gets in the way. I have to use SlickEdit at work and the auto complete drives me nuts because it always guesses the wrong thing it thinks I am typing. I do use a GUI for SVN on the odd times when I use SVN but I use straight cmd line CVS at work.

    Because my default compiler is and has been gcc for years, Emacs works great because it hooks into not only gcc but gdb as well and works the same on every platform I need it on.

    Aside from that with the specialized platforms I need (and have needed to support) the command line is the only way to support them...

    All that aside I would still give Eclipse another shot if C/C++ were ever to become less of a second-class citizen..
    C/C++ Environment: GNU CC/Emacs
    Make system: CMake
    Debuggers: Valgrind/GDB

  8. #8
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by jeffcobb View Post
    As for autocompletion and such I guess I know my target platform and language well enough that autocompletion gets in the way.
    Yeah, I prefer the less obtrusive variants. Also I don't use ctags, since that just clutters up the possibilities. Without ctags, you just get choices from within file scope, ie, mostly names of variables, and only when you use a hotkey, which is nice and simple. Saves having to type "totalNodes" over and over, etc.

    I have used omnicppcomplete a little tho, the C++ "intellisense" style plug-in for vim. That one is intrusive (pops up and evaluates as you type, like google) and is configurable if you like that.

    In addition to autocompletion, abbreviations are great, you define these in a file somewhere, or on the fly:
    Code:
    :iab $A $ARGS{
    :iab <a <a href=" ">
    :iab GRP Glib::RefPtr<
    :iab #i #include <
    :iab KV while (my ($k, $v) = each (%)) {
    :iab PF print "$_\n" foreach (@
    :iab PR fprintf(stderr,"
    :iab $S $self->{''}
    :iab UC unsigned char
    :iab VI vector< >::iterator it = xxx.begin(), end =  xxx.end();
    :iab WI while(it != end) {
    Type a couple of characters then a space.

    "Surround" is a good plugin for wrapping words or lines within tags or braces or quotes.

    And snippets is pretty great, it has a lot of programmable potential, qv:
    snipMate.vim Introductory Screencast on Vimeo
    has some very clever aspects.

    There's tons of stuff like this, they're easy to install, try out, and remove if you don't like it.
    Last edited by MK27; 05-19-2010 at 02:18 PM.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  9. #9
    Registered User sbaginov's Avatar
    Join Date
    May 2010
    Location
    Italy
    Posts
    19
    @all:
    Thank you guys for the feedbacks.
    I think I do really have to rethink the way I was looking at the problem when timidly abandoning the pure C89 to just enter the real world.

  10. #10
    Registered User jeffcobb's Avatar
    Join Date
    Dec 2009
    Location
    Henderson, NV
    Posts
    875
    Quote Originally Posted by sbaginov View Post
    @all:
    Thank you guys for the feedbacks.
    I think I do really have to rethink the way I was looking at the problem when timidly abandoning the pure C89 to just enter the real world.
    FYI on the Linux front, a few of the IDEs that I have tried in the past, some in the very recent past are:
    1. Anjuta (good for straight C/C++, hooks into help system for the language of choice and the debugger.
    2. KDevelop. Same IDE can do Python, Perl, C++, C, and Ruby at least. Also contains or can contain GUI builders.
    3. CodeLite: mimics a lot of VisualC++, with appropriate plugins can do alot.
    4. Geany: Some folks like this, I have always had issues with the project mgmt.
    5. CodeBlocks: works on multiple platforms, has pretty good GCC integration.
    6 & 7: Emacs and Vim: is an editor first, both are mature cross-platform projects, can do the basics of coding (GDB integration, Makefile integration, etc).

    This should get you going.
    C/C++ Environment: GNU CC/Emacs
    Make system: CMake
    Debuggers: Valgrind/GDB

  11. #11
    Registered User jeffcobb's Avatar
    Join Date
    Dec 2009
    Location
    Henderson, NV
    Posts
    875
    Another useful thing for emacs during long, interminable meetings:
    Click Tools->Games->Adventure:
    Code:
    Dead end
    You are at a dead end of a dirt road.  The road goes to the east.
    In the distance you can see that it will eventually fork off.  The
    trees here are very tall royal palms, and they are spaced equidistant
    from each other.
    There is a shovel here.
    >
    C/C++ Environment: GNU CC/Emacs
    Make system: CMake
    Debuggers: Valgrind/GDB

  12. #12
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by jeffcobb View Post
    Another useful thing for emacs
    Also programmable isn't it? (in ((lisp)) )
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  13. #13
    Registered User jeffcobb's Avatar
    Join Date
    Dec 2009
    Location
    Henderson, NV
    Posts
    875
    Why yes now that you mention it..
    C/C++ Environment: GNU CC/Emacs
    Make system: CMake
    Debuggers: Valgrind/GDB

  14. #14
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    Quote Originally Posted by jeffcobb View Post
    3. CodeLite: mimics a lot of VisualC++, with appropriate plugins can do alot.
    I just tried CodeLite on one of my linux machines, and I'm absolutely in love. Until now, I've been a NetBeans user. NO MORE!!! NetBeans is slow, buggy, and doesn't work well on a remote desktop or NX session. In the few hours that I've been using CodeLite, I've already found dozens of things about it that I like better than NetBeans.

  15. #15
    Registered User jeffcobb's Avatar
    Join Date
    Dec 2009
    Location
    Henderson, NV
    Posts
    875
    Cool! As of this afternoon I am bailing out of a CodeBlocks experiment in pain and going back to what I know, the stuff in my sign.
    C/C++ Environment: GNU CC/Emacs
    Make system: CMake
    Debuggers: Valgrind/GDB

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. eclipse CDT and boost
    By csonx_p in forum C++ Programming
    Replies: 0
    Last Post: 12-17-2009, 01:41 PM
  2. Replies: 6
    Last Post: 07-20-2007, 09:23 AM
  3. Replies: 1
    Last Post: 04-26-2007, 08:04 PM
  4. Replies: 14
    Last Post: 11-22-2006, 07:18 PM
  5. Auto-backup : Makefiles (Eclipse and CDT specifically)
    By Ashes999 in forum C++ Programming
    Replies: 0
    Last Post: 07-07-2003, 04:05 AM