Page 1 of 1

using devx with Puppy Linux. (now working)

Posted: Thu Sep 16, 2021 4:47 am
by cobaka

Hello fellow puppians:

I want to learn the C programming language. (more detail below)
I posted a request on this forum about devx and got some answers.
This is the link where I ask about devx: https://www.forum.puppylinux.com/viewto ... x&start=30

I got devx. It is on my disk here: /initrd/mnt/dev_save/devx_upupbb32_19.03.sfs
I followed the Mike-Walsh's instruction to do that.

After that I 'clicked' on devx_whatever.sfs and it gave me 2 options.
The first was 'glade' and I chose that.
I think that was a mistake. At any rate I'm stuck again.
Now I need to take my first steps in using devx

My experience in programming:
Recently I spent quite a lot of time at the (bash) command line interface (or terminal).
I'm comfortable there.

Before that I spent a lot of time using an assembler to code for microprocessors: (8085, 68HC11, 6809)
Once I wrote a FORTH-like language with real-time, interrupt-driven, pre-emptive tasks switching ability.
The point here is that I understand the edit/assemble/debug/ cycle.
The code I wrote ran industrial machines that involve movement control.

I remember writing in other languages too - like Pascal; to be honest I can't remember the syntax except it was fun to write code in Pascal. I wrote these programs on a teleprinter with a paper interface. (Yes, these existed once. I used one.)

My point here is that I understand (generally) the coding cycle. Here is the problem.
I assumed I would create/code/save the source code of my "C" program using Geany.
I imagined I would call it 'hello_world.c'
I assumed I would compile the source using something like #gcc hello_world.c <enter>
The problem: Glade (or GTK) appear to work differently from the above.
Please point me in the correct direction to work with GTK or Glade. eg what I'm doing wrong and maybe a link to some help file.
What don't I understand?

I looked at some courses on you-tube "C in 10 hours" (etc).
These seem to assume the development cycle is rather like my experience with assembler.

Thank you

cobaka

My goal: I see some source code (c source) on the net. I want to compile/edit/run this source.
It's C, not C++ or C# or python or ... Plain vanilla C.
My OS is uPupBB32 19.03


Re: using devx with Puppy Linux.

Posted: Thu Sep 16, 2021 7:49 am
by williams2

put the devx.sfs file in /mnt/home/

Run the sfs loader from the menu
or type sfs_load in a terminal
or type sfs_load /mnt/home/devx_bionicpup64_8.0.sfs
(use the correct devx.sfs file name for your system.

After you get the sfs file to load, click the quit button.
Do NOT click the run button.
Do NOT run gtk or glade.

Gcc is now ready to use.

For example:

Code: Select all

# cat hello.c
#include <stdio.h>
int main(void)
{
  puts("Hello, World");
  return 0;
}
#
# gcc hello.c
# ./a.out 
Hello, World
#

Python:

Code: Select all

python -c "print('hello, world')"
hello, world

Re: using devx with Puppy Linux.

Posted: Thu Sep 16, 2021 9:40 am
by April

I usually use sfs on the fly in the menu

Load in the devx sfs file and then quit.

Now open Geany and type in your program .
It has a compile button and a build button and a run facility so play away.

HelloWorldRunning1.jpg
HelloWorldRunning1.jpg (83.98 KiB) Viewed 1217 times

Re: using devx with Puppy Linux. (now working)

Posted: Thu Sep 16, 2021 11:36 am
by cobaka

Thanks to @April & @williams2

I compiled and ran my first program in C.

Now it's time to complete a full tutorial in that language.

Cobaka