Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 1999-07

Simple HelloWorld

7 messages · 5 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael A. Hess

I know everyone is waiting with baited breath for the IDE. But I'm sure some people would like to see how a program will be written, or at least can be written at this point.

I have built a really simple HelloWorld program. It gives you the opportunity to see how a program is organized using FPC and the class libraries. All the program does is create a window with a button located in the middle. As we develop and clean up more components we can expand on this example.

Since it isn't big I have attached the code to this email. Just unzip the file into the fpc directory. That is the same directory where you see lazarus, rtl, rcl. It will create a directory called hello. Then just change to that directory and type make. It assumes that you have the latest compiler (if not from CVS at least a snapshot) and the latest lazarus code from CVS.

You can see that it is very similar to Delphi code. Some things that are handled in the Delphi .frm file must be done manually but hopefully as the IDE/RAD develop they will be done automatically as they are in Delphi.

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com -------------- next part -------------- A non-text attachment was scrubbed... Name: zip00000.zip Type: application/octet-stream Size: 2045 bytes Desc: "hello.zip" Url : http://localhost/pipermail/lazarus/attachments/19990713/7d12b25d/zip00000.obj

Reply by email

Michael A. Hess
to Cliff Baeseman: Very nice and very few lines of code.... Sure beats programming the GTK native doesn't…
Cliff Baeseman wrote
Very nice and very few lines of code....

Yeah. I thought I would do this tonight instead of coding components. I figured it was time to show people that this really is more than just talk and not smoke and mirrors. It is for real. :-)

Sure beats programming the GTK native doesn't it... ;)

I think it will beat anything hands down when we are done. People can pick their API of choice or compile for different APIs and not have to change any of their own code. P O W E R F U L!

Once the API units are created that same Helloworld will work for Qt, XLib, Gnome, you name it. 8-)

I wish I could work on the code some but I have to get this java applet banged out for work.

Wish I could be doing more but I'm stuck doing some of that VB stuff during the day for greenies. :-(

As soon as my Navy contract kicks in I can get back to fun stuff. Heading down to the Truman the first week of August. :-)

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Cliff Baeseman

VB is ok for simple stuff but it was just pissing me off doing this web app so I am rewriting it in java...

Cliff

Earlier message 44 lines
-----Original Message----- From: Michael A. Hess To: Date: Tuesday, July 13, 1999 11:12 PM Subject: Re: [lazarus] Simple HelloWorld >Cliff Baeseman wrote: >> >> Very nice and very few lines of code.... > >Yeah. I thought I would do this tonight instead of coding components. I >figured it was time to show people that this really is more than just >talk and not smoke and mirrors. It is for real. :-) > >> Sure beats programming the GTK native doesn't it... ;) > >I think it will beat anything hands down when we are done. People can >pick their API of choice or compile for different APIs and not have to >change any of their own code. P O W E R F U L! > >Once the API units are created that same Helloworld will work for Qt, >XLib, Gnome, you name it. 8-) > >> I wish I could work on the code some but I have to get this java >> applet banged out for work. > >Wish I could be doing more but I'm stuck doing some of that VB stuff >during the day for greenies. :-( > >As soon as my Navy contract kicks in I can get back to fun stuff. >Heading down to the Truman the first week of August. :-) > >-- >==== Programming my first best destiny! ==== > >Michael A. Hess Miracle Concepts, Inc. > http://www.miraclec.com > >_________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus >

Reply by email

Michael Van Canneyt
to Cliff Baeseman
Cliff Baeseman wrote
VB is ok for simple stuff

If you mean by this 'macros in Word, Excel and Access' I fully agree :-)

Michael.

Show quoted text 54 lines
but it was just pissing me off doing this web app so I am rewriting it in java... Cliff -----Original Message----- From: Michael A. Hess To: Date: Tuesday, July 13, 1999 11:12 PM Subject: Re: [lazarus] Simple HelloWorld >Cliff Baeseman wrote: >> >> Very nice and very few lines of code.... > >Yeah. I thought I would do this tonight instead of coding components. I >figured it was time to show people that this really is more than just >talk and not smoke and mirrors. It is for real. :-) > >> Sure beats programming the GTK native doesn't it... ;) > >I think it will beat anything hands down when we are done. People can >pick their API of choice or compile for different APIs and not have to >change any of their own code. P O W E R F U L! > >Once the API units are created that same Helloworld will work for Qt, >XLib, Gnome, you name it. 8-) > >> I wish I could work on the code some but I have to get this java >> applet banged out for work. > >Wish I could be doing more but I'm stuck doing some of that VB stuff >during the day for greenies. :-( > >As soon as my Navy contract kicks in I can get back to fun stuff. >Heading down to the Truman the first week of August. :-) > >-- >==== Programming my first best destiny! ==== > >Michael A. Hess Miracle Concepts, Inc. > http://www.miraclec.com > >_________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus > _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Cliff Baeseman

Very nice and very few lines of code....

Sure beats programming the GTK native doesn't it... ;)

I wish I could work on the code some but I have to get this java applet banged out for work.

JBuilder3 all night tonight.

Cliff

Earlier message 34 lines
-----Original Message----- From: Michael A. Hess To: Lazarus-List Date: Tuesday, July 13, 1999 9:59 PM Subject: [lazarus] Simple HelloWorld >I know everyone is waiting with baited breath for the IDE. But I'm sure >some people would like to see how a program will be written, or at least >can be written at this point. > >I have built a really simple HelloWorld program. It gives you the >opportunity to see how a program is organized using FPC and the class >libraries. All the program does is create a window with a button located >in the middle. As we develop and clean up more components we can expand >on this example. > >Since it isn't big I have attached the code to this email. Just unzip >the file into the fpc directory. That is the same directory where you >see lazarus, rtl, rcl. It will create a directory called hello. Then >just change to that directory and type make. It assumes that you have >the latest compiler (if not from CVS at least a snapshot) and the latest >lazarus code from CVS. > >You can see that it is very similar to Delphi code. Some things that are >handled in the Delphi .frm file must be done manually but hopefully as >the IDE/RAD develop they will be done automatically as they are in >Delphi. > >-- >==== Programming my first best destiny! ==== > >Michael A. Hess Miracle Concepts, Inc. > http://www.miraclec.com

Reply by email

Unknown author
to Payne Thomas E CNIN: Anyone else having problems with hello_world? I deleted my /etc/ppc386.cfg. I can still…
Payne Thomas E CNIN wrote 20 lines
Anyone else having problems with hello_world? I deleted my /etc/ppc386.cfg. I can still rebuild the compiler, fcl, gtk, and lazarus without it. I noticed that the makefile for hello_world looks for units in ../units/linux??? So I created a symbolic link to my /usr/lib/fpc/0.99.13/units in /usr/src/fpc0.99.11 (which is my source dir) (sorry I am not using the linux HOWTO, after initially getting it to work, did not to disturb it). I tried to manually insert the -Fu directories that ppc386 was complaining about, but then it finally gave me an internal error 1234124??? fpc-0.99.11]# cd hello hello]# make ppc386 -Tlinux -Fu../rtl/linux -Fu../units/linux -Fu../fcl/linux -Fu../rtl/linux -Fu../gtk -Fu../lazarus -Fl/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66 -Fl/usr/X11R6/lib -Fl/usr/lib -Fl/usr/i486-linux-libc5/lib -FE. -di386 hello_world.pp syslinux.pp(34,2) Fatal: Can't open include file systemh.inc

Ok, what is happening here ?
The message clearly states that the compiler tries to recompile the system units. This is BAD. it means that it found sources that are newer than the units in /usr/lib/fpc/etc.
This is natural, because ../rtl/linux is in the units path.

1) The compiler will look in the directory ../rtl/linux for the system units.
2) The compiler will look in the directory ../fcl/linux for the classes stuff.
3) The compiler will look in the directory ../gtk for gtk stuff.
4) the compiler will look in the directory ../lazarus for lazarus stuff.

Now, 2 depends on 1
3 depends on 1
4 depends on 2 and 1 and 3

So the following should build everything;
cd rtl/linux
make clean; make
cd ../../fcl/linux
make clean; make
cd ../../gtk
make clean; make
cd ../lazarus
make clean; make
cd ../hello_world
make

These are the _EXACT_ steps as I do them every day; apart from errors in the source code, this has never failed me.

I suggest you try this.

Michael.

Reply by email

Payne Thomas E CNIN

Anyone else having problems with hello_world?

I deleted my /etc/ppc386.cfg. I can still rebuild the compiler, fcl, gtk, and lazarus without it.
I noticed that the makefile for hello_world looks for units in ../units/linux??? So I created a symbolic link to my /usr/lib/fpc/0.99.13/units in /usr/src/fpc0.99.11 (which is my source dir) (sorry I am not using the linux HOWTO, after initially getting it to work, did not to disturb it). I tried to manually insert the -Fu directories that ppc386 was complaining about, but then it finally gave me an internal error 1234124???

fpc-0.99.11]# cd hello
hello]# make
ppc386 -Tlinux -Fu../rtl/linux -Fu../units/linux -Fu../fcl/linux -Fu../rtl/linux -Fu../gtk -Fu../lazarus
-Fl/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66 -Fl/usr/X11R6/lib -Fl/usr/lib -Fl/usr/i486-linux-libc5/lib -FE. -di386 hello_world.pp syslinux.pp(34,2) Fatal: Can't open include file systemh.inc make: *** [hello_world] Error 1
hello]# cd ..
fpc-0.99.11]# make fpc_info

== Configuration info ==

FPCDir....
FPCMake... makefile.fpc

Version... 0.99.13
CPU....... i386
Source.... linux
Target.... linux

== Object info ==

LoaderObjects.
UnitObjects...
ExeObjects....

ExtraUnits....

== Tools info ==

Pwd....... /bin/pwd
Echo...... @/bin/echo
Sed....... /bin/sed
Date...... /bin/date
Diff...... /usr/bin/diff
Cmp....... /usr/bin/cmp
Zip....... /usr/bin/zip -D9 -r

== Install info ==

DateStr.............. 19990715
PackageSuffix........ linux

BaseInstallDir....... /usr/lib/fpc/0.99.13
BinInstallDir........ /usr/bin
UnitInstallDir....... /usr/lib/fpc/0.99.13/units/linux StaticUnitInstallDir. /usr/lib/fpc/0.99.13/units/linux/static SharedUnitInstallDir. /usr/lib/fpc/0.99.13/units/linux/shared LibInstallDir........ /usr/lib/fpc/0.99.13
StaticLibInstallDir.. /usr/lib/fpc/0.99.13/units/linux/static SharedLibInstallDir.. /usr/lib
MsgInstallDir........ /usr/lib/fpc/0.99.13/msg
DocInstallDir........ /usr/doc/fpc/0.99.13

== Directory info ==

Basedir......... /usr/src/fpc-0.99.11

GCC library..... /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66 Other library... /usr/X11R6/lib /usr/lib /usr/i486-linux-libc5/lib

fpc-0.99.11]#

Tom

(I was going to learn something about GTK today but win32 and hello_world has consumed me)

Reply by email