Thread: jGrasp IDE and C++

  1. #1
    Registered User
    Join Date
    Jan 2011
    Posts
    41

    jGrasp IDE and C++

    Overview
    I have recently begun to transition from Java to C++, I am working my way through Accelerated C++ by Koenig and Moo. Having said that I am using jGrasp to compile and run my programs with the MinGW g++ compiler.

    Issue
    When I compile and run a program a new console window is created and the output of my program is displayed there. But I have to press a key for the program to run. I would much rather the output be displayed inside of jGrasp's built in console like it does for my Java projects. I have searched through the help manual and haven't really found anything useful.

    Has anyone encountered this issue? If so do they know how to fix it?

    Thanks
    Hunter

    P.S. I have attached a screen shot of my problem
    jGrasp IDE and C++-jgrasp_out-jpg

  2. #2
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    Look at this:
    http://www.jgrasp.org/jgrasp/settings.htm
    I
    did not have the patience to shift through it.

    But if you are willing to experiment a bit with different ide s,
    I can say that Eclipse(I'm using the Helios version) shows the output inside its console.
    Setting up Eclipse(C/C++ tools ...java is alright) in windows used to be a tricky process the last time I tried.

    Also Eclipse's apparent attachment to Java means that you'd find similar ground there.

  3. #3
    Registered User
    Join Date
    Jan 2011
    Posts
    41
    Thanks for the link but I have already been through that page thoroughly and the other documentation pages.

  4. #4
    Registered User
    Join Date
    Aug 2011
    Posts
    4
    You can do it, but you probably don't want to. The trouble with Windows is, there is no good way to connect one program to another using console-like I/O. If you don't use an actual console, your program will block buffer or at least line buffer I/O. This means that interactive command line prompts won't work, and you many not see any text output until a buffer fills up. We used to have the option of a connection that would run the program in debug mode and intercept console output, but that began to trigger a lot of virus checkers, so we removed it. If you use Cygwin to compile, jGRASP will use a Cygwin psuedoterminal to connect to the program, and I/O will be through the jGRASP console, so one solution is for you to use Cygwin.

    If your program does no console I/O, it may be OK to run without the external console. To do that, go to "Settings" / "Compiler Settings" / "Workspace", choose language "C++" if not already selected, select the "g++ - generic" environment and hit "Copy", remove "%CY" from the run command and give your environment a good name, "OK" the new environment dialog, select your new environment and hit "Use". Just remember that if you start using console I/O you will need to switch back to the old compiler environment or manually select "Run" / "Run in MSDOS Window".

  5. #5
    Registered User
    Join Date
    Aug 2011
    Posts
    4
    This thread inspired me to go looking for a solution to this problem once again, and this time I have found one that should work. For the next jGRASP release I/O will be in the jGRASP console and buffering should not be a problem.

  6. #6
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Why are you using that IDE when there are excellent free ones available that won't work against you?

  7. #7
    Registered User
    Join Date
    Aug 2011
    Posts
    4
    Seriously dude, you're going to say that like I'm not even here?

  8. #8
    Registered User
    Join Date
    May 2011
    Location
    Around 8.3 light-minutes from the Sun
    Posts
    1,949
    Quote Originally Posted by lbarowski View Post
    Seriously dude, you're going to say that like I'm not even here?
    How is that insulting at all? I am a little confused, there are better IDEs out there and Virtual Ace was just pointing that out. Nothing to get yourself worked up over.
    Quote Originally Posted by anduril462 View Post
    Now, please, for the love of all things good and holy, think about what you're doing! Don't just run around willy-nilly, coding like a drunk two-year-old....
    Quote Originally Posted by quzah View Post
    ..... Just don't be surprised when I say you aren't using standard C anymore, and as such,are off in your own little universe that I will completely disregard.
    Warning: Some or all of my posted code may be non-standard and as such should not be used and in no case looked at.

  9. #9
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Seriously dude, you're going to say that like I'm not even here?
    Yeah seriously dude I am. I'm stating facts. Why develop with one arm tied behind your back when you do not have to? Unless you have a specific reason for not using MSVS Express like you do not want to develop for Windows then I see no need to use an IDE that can shoe-horn in C++ development but still pretty much sucks for doing C++ development.

  10. #10
    Registered User
    Join Date
    Aug 2011
    Posts
    4
    "Works against you" is not the same thing as "is more capable". I use VS myself for compiling and debugging C++, but jGRASP for editing.

  11. #11
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    Quote Originally Posted by lbarowski View Post
    "Works against you" is not the same thing as "is more capable". I use VS myself for compiling and debugging C++, but jGRASP for editing.
    But 'works for everyone' is defined as 'capable'. Can you show an example of it 'not working for you' ?
    I'm not a Windows user, but having tried VS once, have been impressed by it.
    Using different programs for different tasks(with no particular reason) somewhat defeats the idea of an Integrated Development Environment .
    Last edited by manasij7479; 08-16-2011 at 09:43 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. jgrasp wont work?
    By camel-man in forum C++ Programming
    Replies: 1
    Last Post: 04-03-2011, 11:23 PM
  2. Problem going from Linux to jGrasp
    By madmax2006 in forum C Programming
    Replies: 0
    Last Post: 11-11-2009, 01:20 PM
  3. Using jGrasp for programming in C
    By freebird2008 in forum C Programming
    Replies: 6
    Last Post: 12-17-2008, 08:42 PM
  4. Linking OpenGL with Jgrasp+Cygwin
    By Pickels in forum C Programming
    Replies: 3
    Last Post: 08-31-2005, 05:09 PM
  5. How to: Use OpenGL with Jgrasp
    By Pickels in forum Game Programming
    Replies: 3
    Last Post: 08-30-2005, 10:37 AM