Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 24 Nov 2014, 03:12
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Running c++ programs
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [7 Posts]  
Author Message
TheMadScientist_2053

Joined: 17 Jun 2013
Posts: 8

PostPosted: Mon 01 Jul 2013, 00:35    Post subject:  Running c++ programs  

Okay so I just started running puppy on my tower and I am trying to figure it out. I have about 13 minutes of experience with all Linux distros, and am not very familiar with the terminal. I've downloaded the Devx.sfs and got that set up so at least I can compile whatever I write in Geany. The trick now is to actually run the darn thing. Most of the information I've found has to do with compiling and the Devx.sfs. Any and all help on the subject would be greatly appreciated.
Back to top
View user's profile Send private message 
amigo

Joined: 02 Apr 2007
Posts: 2276

PostPosted: Mon 01 Jul 2013, 06:06    Post subject:  

Once compiling is done, you must make sure the binary object is set 'executable'. Then, from the shell in a terminal you execute it like this:
Code:
[path-to]program-name
[/quote]
Back to top
View user's profile Send private message 
TheMadScientist_2053

Joined: 17 Jun 2013
Posts: 8

PostPosted: Mon 01 Jul 2013, 12:10    Post subject:  

amigo wrote:
Once compiling is done, you must make sure the binary object is set 'executable'. Then, from the shell in a terminal you execute it like this:
Code:
[path-to]program-name
[/quote]

How does one set the binary object to executable?
Back to top
View user's profile Send private message 
amigo

Joined: 02 Apr 2007
Posts: 2276

PostPosted: Mon 01 Jul 2013, 14:16    Post subject:  

From the terminal:
chmod 755 name-of-file

The linker may do this properly for you, but it doesn't hurt to run the command anyway.

If you are running a terminal in the same directory where the binary executable is located, then simply:
Code:
chmod 755 file-name
./file-name

In order to run the program without specifying the path to it, you need to place it in your PATH -usually under /usr/local/bin for stuff you compile yourself. Then, it can be run from a terminal anywhere or from a script, without giving the path:
Code:
file-name
Back to top
View user's profile Send private message 
6502coder

Joined: 23 Mar 2009
Posts: 105
Location: Western United States

PostPosted: Mon 01 Jul 2013, 14:24    Post subject: how to make it executable  

cd to the place where the binary is located, then

Code:
chmod  +x   program-name


BTW, if you tell us more about what you DO know, we can give you better help. You say you're not familiar with the terminal...Do you have any experience at all with using a command line, e.g. MS DOS or the command shell in Windows? Have you ever written and compiled a C++ program using either a command line or an IDE?
Back to top
View user's profile Send private message 
TheMadScientist_2053

Joined: 17 Jun 2013
Posts: 8

PostPosted: Mon 01 Jul 2013, 15:12    Post subject: Re: how to make it executable  

6502coder wrote:
cd to the place where the binary is located, then

Code:
chmod  +x   program-name


BTW, if you tell us more about what you DO know, we can give you better help. You say you're not familiar with the terminal...Do you have any experience at all with using a command line, e.g. MS DOS or the command shell in Windows? Have you ever written and compiled a C++ program using either a command line or an IDE?


ipconfig is about the extent of my knowledge of windows command shell. As far as C++ goes, I'm pretty familiar with it. I've done quite a bit of stuff using the MicroSoft Visual studios IDE.
Back to top
View user's profile Send private message 
ericsond

Joined: 13 Apr 2013
Posts: 5

PostPosted: Wed 24 Jul 2013, 20:30    Post subject:  

If you are planning to use Geany, this is even easier...for example just type (or cut and paste) a sample program like (assuming you have devx already installed):

#include <stdio.h>
int main( void )
{

printf("Hello World!");

return 0;

}


then you can go under the 'Build' drop down menu of Geany, and select Build, and then Execute, or even easier just do F9 and F5. You can even change what these do by using the 'Set Build Commands' under the 'Build' drop down menu.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [7 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0560s ][ Queries: 12 (0.0038s) ][ GZIP on ]