C++ School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

C++ on kubuntu (Kate Compiler) Need help with kate compiler run script Rate Topic: -----

#1 frozzenfire  Icon User is offline

  • New D.I.C Head
  • Pip

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 10-October 08


Dream Kudos: 0

Share |

C++ on kubuntu (Kate Compiler)

Post icon  Posted 10 October 2008 - 09:23 PM

hey guys i am actually VERY new at development and just installed kubuntu on my computer. Using a compiler named kate. For some reason i just cant seem to figure out why i cannot run script.

I just put in the following code that i found to test out the kate compiler:

#include <iostream>

int main()
{
	int num1;  //create a variable "int" to hold a number

	int num2;  //and also create another variable to hold another interfer
	
	std::cout << "type a number: ";  //no endl....
	std::cin >> num1; //puts inpot to num1
	std::cout << "type another number; ";
	std::cin >> num2;

	int result;
	result = num1 + num2;  //adds the two numbers

	std::cout << result;  //outputs results to screen
	return 0;
}


Then i clicked on Tools - external tools - run script

Nothing happens except a quick flash.

When it comes to the code itself i actually got the code from the following location:
http://www.youtube.c...h?v=Yob_vRFaqs0
So i know the code works...

Can someone please help me get my compiler working please?
attaching some screen shots as well

thanks in advance

yahoo im - rockstyle44
i am in the #c++ channel as well as frozzenfire

Attached thumbnail(s)

  • Attached Image

Was This Post Helpful? 0
  • +
  • -


#2 JackOfAllTrades  Icon User is offline

  • Rama-llama-ding-dong
  • Icon

Reputation: 1334
  • View blog
  • Posts: 10,565
  • Joined: 23-August 08


Dream Kudos: 50

Expert In: Being annoyed with lazy people.

Re: C++ on kubuntu (Kate Compiler)

Posted 11 October 2008 - 06:11 AM

Read the pinned topic at the top of the forum, Holding The Execution Window Open.
Was This Post Helpful? 0
  • +
  • -

#3 linuxknight317  Icon User is offline

  • New D.I.C Head
  • Pip

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 11-May 09


Dream Kudos: 0

Re: C++ on kubuntu (Kate Compiler)

Posted 11 May 2009 - 12:17 PM

try adding this right before return(0);


SYSTEM("PAUSE");


that will pause and display a 'Press any key to continue' dialog in your program. you maight want to start a new line

cout << "last line of tex /n";

SYSTEM("PAUSE");
return(0);
}

hope it helps!
Was This Post Helpful? 0
  • +
  • -

#4 IngeniousHax  Icon User is offline

  • |>|20-514<|{3|2
  • PipPipPipPipPip

Reputation: 40
  • View blog
  • Posts: 1,085
  • Joined: 28-March 09


Dream Kudos: 0

Re: C++ on kubuntu (Kate Compiler)

Posted 11 May 2009 - 03:27 PM

why not jusy compile through the konsole? just go into the konsole and type "g c c <program name>" with-out the spaces in g c c & <>, and than to run it just type ./a.out and if you get fancy rename the file to something like g c c -o <what you want it named> <program file> and than run it by ./<what you named it>

This post has been edited by IngeniousHax: 11 May 2009 - 03:28 PM

Was This Post Helpful? 0
  • +
  • -

#5 UG Cyber  Icon User is offline

  • D.I.C Regular
  • PipPipPip

Reputation: 14
  • Posts: 414
  • Joined: 24-July 08


Dream Kudos: 0

Re: C++ on kubuntu (Kate Compiler)

Posted 11 May 2009 - 07:18 PM

so thats why you typed it as g c c...lol
to get you a good ide. type this into your Konsole / Terminal
sudo apt-get update
sudo apt-get install codeblocks



code blocks works great for me.
but you may also need a g c c or g + + if it gives you an error
so type this
sudo apt-get install g++


This post has been edited by UG Cyber: 11 May 2009 - 07:26 PM

Was This Post Helpful? 0
  • +
  • -

#6 janotte  Icon User is offline

  • code > sword
  • Icon

Reputation: 281
  • View blog
  • Posts: 3,102
  • Joined: 28-September 06


Dream Kudos: 0

Expert In: C/C++

Re: C++ on kubuntu (Kate Compiler)

Posted 12 May 2009 - 02:25 AM

The responses about how to hold a MS Windows console window open don't apply to you because you have, to your credit, chosen to work in a developer friendly OS (Linux) with a real console unlike the half-hearted attempt provided in Windows. You can safely ignore those well intended responses.

1 - Terminology
Kate is a text editor not a compiler.

2 - What you have there is not a script.
It is C++ source code that needs to be compiled.
A script can be run from the editor because it is interpreted language.
C++ must be compiled to create a program that can then be run.

As already suggested:
"gcc" is a good option
"code::blocks" is another good option
There are a lot more options here:
http://www.dreaminco...wtopic20933.htm
Was This Post Helpful? 0
  • +
  • -



Fast Reply

  

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users