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 Sat 23 Aug 2014, 09:50
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Why doesn't the "Compile the current file" button work?
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [8 Posts]  
Author Message
Antipodal

Joined: 26 Mar 2009
Posts: 135
Location: The other side of the world

PostPosted: Wed 27 Nov 2013, 10:19    Post subject:  Why doesn't the "Compile the current file" button work?
Subject description: Trying to understand what programming is about
 

I have chosen to understand what programming is about using C++ because I have heard that - though it's not the easiest language to understand - once you have figured it out, it simplifies understanding other languages.
Following "Lesson 1" at http://en.wikiversity.org/wiki/C%2B%2B I have typed at my Slacko's Geany the following

Code:
#include <iostream>
 
using namespace std;
 
int main()
{
   cout << "Hello World!" << endl;
   cin.get();
 
   return 0;
}

and I have tried to compile it there, but the "Compile the current file" button on Geany is not active and I don't understand why this occurs.
Could you please explain this for me?
Thank you

_________________
Slacko 533 Live CD_P4 3Ghz_ASUS P5G41T-M LX3_2G RAM_DVD Write
No internal HDD
Never saved files related to Puppy's configuration
I sometimes save personal stuff on small flash stick or access via USB data on old big internal NTFS formated SATA HDD
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 3254
Location: Ontario

PostPosted: Wed 27 Nov 2013, 17:47    Post subject:  

I think that geany needs to be specially setup to compile.
Only the 'experts' do that.

First of all make sure that devx file is installed. For recent puppy distros
this is easy. Just download the devx file for your distro and click on it
and it will install automatically.


I'll check if the following example from your course is possible.
Puppy uses GCC
Quote:

Each compiler has its own way of compiling programs. If you use GCC, type the following in a terminal:
c++ example.cpp -o example


___________________________________________
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5016
Location: Arizona, U.S.A.

PostPosted: Wed 27 Nov 2013, 21:06    Post subject:  

Geany can be set up to edit and run many different languages.

You can also select the syntax highlighting by doing this:

On the menubar select:
[ Document ] > [ Set Filetype ] > [ Programming Languages ] > [ C++ file ]

# Note: C isn`t the best way to start learning, it has a rather large learning curve.
A better start for a new comer is Bash scripting. Much easier to start learning.

All languages I`ve ever seen, all have the same methods: Branching, Looping, and Functions.
Each was designed for a purpose, and has a different method and syntax for doing things.
Bash is a good starter to learn the basics, as it will teach you these programming methods.
.
Back to top
View user's profile Send private message 
puppyluvr


Joined: 06 Jan 2008
Posts: 3195
Location: Chickasha Oklahoma

PostPosted: Thu 28 Nov 2013, 00:28    Post subject:  

Very Happy Hello,
Bash is the best tool to start off with in Linux.
You dont need the devx for it. You do to compile.
D/L the devx and enable it thru the bootmanager.
Test it. Open a terminal and enter
make
You should get a warning
"No makefile.found"
If you get
"Command not found"
It didnt work.
After you have it working the compile button in geany should work.

_________________
Close the Windows, and open your eyes, to a whole new world
http://puppylinuxstuff.meownplanet.net/puppyluvr/
Puppy Linux Users Group on Facebook

Puppy since 2.15CE...
Back to top
View user's profile Send private message Visit poster's website 
Moose On The Loose


Joined: 24 Feb 2011
Posts: 513

PostPosted: Thu 28 Nov 2013, 15:40    Post subject: Re: Why doesn't the "Compile the current file" button work?
Subject description: Trying to understand what programming is about
 

Antipodal wrote:
I have chosen to understand what programming is about using C++ because I have heard that - though it's not the easiest language to understand - once you have figured it out, it simplifies understanding other languages.


C++ is indeed hard to learn. Knowing its obscure workings does very little to teach you about programming. If you really want to learn to program (as opposed to code), you want something more like a PIC microcontroller in assembly and a project like finding the squareroot of a 32 bit number. It is easy to see if you got it right and requires you to actually learn to program to get it done. As a second option try this as a project:

tic-tac-toe is a very simple game but it does require you to do many of the things needed for programming. You can write one in bash in 100 lines of bash that plays with it taking the X and always winning if it can be done against your moves.

The nice thing about coding in bash instead of C++ is that you can do multithread programs etc without a lot of trouble with libraries.
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 3254
Location: Ontario

PostPosted: Thu 28 Nov 2013, 17:49    Post subject:  

I was able to get geany to work in Precise Puppy and Wheezy Puppy
by doing the following....

1 ) Load devx file
2 ) Save the geany text to /root as example.cpp
3 ) Select 'Build' from menu ---> this runs c++ example.cpp -o example
4 ) Select 'Execute' from menu and terminal will launch automatically
and Hello World will show.

_______________________________________
Back to top
View user's profile Send private message 
Antipodal

Joined: 26 Mar 2009
Posts: 135
Location: The other side of the world

PostPosted: Thu 28 Nov 2013, 18:51    Post subject:  Thanking everybody
Subject description: idem
 

Thank you folks!
My delay in doing this is due to the shock I have suffered from the amount of things I have discovered since I read don570's first post and to the fact that I was left without my internet connection for at least 12 hours.

sunburnt's, puppyluvr's & Moose On The Loose's posts are also very welcome!

Thank you very much indeed!

I'm sure that after I have digested my discoveries and your experienced comments I will come back for some more.
Smile
Back to top
View user's profile Send private message 
Moose On The Loose


Joined: 24 Feb 2011
Posts: 513

PostPosted: Fri 29 Nov 2013, 12:02    Post subject: Re: Thanking everybody
Subject description: idem
 

Antipodal wrote:
Thank you folks!
My delay in doing this is due to the shock I have suffered from the amount of things I have discovered since I read don570's first post and to the fact that I was left without my internet connection for at least 12 hours.

sunburnt's, puppyluvr's & Moose On The Loose's posts are also very welcome!

Thank you very much indeed!

I'm sure that after I have digested my discoveries and your experienced comments I will come back for some more.
Smile


Also: I use DDD to make debugging a point and click matter. On rare occasions, even I make bugs in my programs.

It is in one of the ubuntu repos.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [8 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.0806s ][ Queries: 12 (0.0122s) ][ GZIP on ]