Lazarus Newbie Adventure on Linux

Here is a nice and well written Delphi-loving Linux newbie adventure experience that got positively thrilled by Lazarus…

I recently made the move from Windows to Linux. I got a nice friendly debian distribution from the Ubuntu folks. It took me a few days to get my wifi working and so forth, but soon I had my cozy little Gnome desktop all set up and I could do all the things I ever did before with Windows.

The ways of Linux are still murky for me, though day by day, I work my way up the learning curve. Installing stuff… easy if it’s in the nice GUI “package manager”, or if I can find a nice “deb” with no dependencies – but oh those dependencies – and sometimes the dependencies would have dependencies – and where to look?

So it was with some trepidation that I turned my attention to the task of setting up a Pascal compiler which I could use for my (purely recreational) programming now that I had become a disciple of the great penguin.

Linux… GNU… there’s some sort of connection there, or so it seemed to me, I certainly like free stuff. And gcc, well, that’s like THE Linux compiler, right? (Actually, I had to install that to get some other things, distributed as source, to install.) So if gcc is good… gpc must be… just right.

Well, I could get Hello World displayed on the little black terminal window, but that was about it. Beyond that, I got reams and reams of error output, and I couldn’t begin to make sense of any of it. (I suppose perhaps I needed to supply some “-l” switches, but to what, and where, and did I even have those things? Argh!)

The idea of writing nothing but seventies-style text terminal applications was unappealing. There appeared to be some sort of svgalib I could get, but apparently that would give me eighties-style pixels in a big black void – still not really what I wanted.

There was some mention of IDEs, one called rHide. Well, maybe that would make things easier. Got it. It runs… in the terminal window. It’s “graphical”, in a style very reminiscent of Borland IDEs… of the late eighties. This didn’t seem very promising.

Then there was this GTK stuff. Apparently that would give me some sort of API through which to eventually work within Gnome. I’m sure it would have taken me only a few short years to learn how.

Somewhere in all my surfing, I came across some mention of a thing called “Lazarus”, though it was apparently built upon this “other” pascal called “free pascal”. I was reluctant to give up on my gpc, I mean, after all, it was just one letter away from gcc, it had to be… the thing! …well, other than the fact that I couldn’t get off the ground with it.

So, “Lazarus” huh? Sounds stupid. But then, for a year or so, I thought “Delphi” was a feminine hygiene product, before I realized it was the TP 8.0 I had been waiting for.

Ok, I’ll grab all these debs. There’s a zillion of them. I’ll start clicking them. Sure enough, some of them complain. Although… they only seem to complain that they want certain of the other debs to go in first. I can do that. Gradually, cancelling the unhappy ones, and trying them again after the others, I discover that I’ve managed to get all the debs in. Great.

But it’s never that easy, is it? It’s not as if I’m going to go to the Applications menu and discover that there’s now some new submenu called, say, “Programming”, and containing the lone entry “Lazarus”.

Wait. There’s a new submenu called Programming, and it contains the lone entry “Lazarus”.

Well this should be good for a laugh. I brace myself for a barrage of unsatisfied dependencies and other incomprehensible error messages, or more likely still… a great nothing.

Wait. Where’s the great nothing? Where are the ugly messages? …and why is Delphi suddenly appearing before me here in Linux? I mean, there’s the usual dummy unit “Unit1”. I hit F12, there’s the usual dummy form “Form1”. I grab a button from the palette, drop it on. I grab a label from the palette, drop it on. There’s the object inspector, right where it should be. Let’s make the label invisible. Ok. Let’s double click the button. Wow, right into the code editor, just as it should be. Ok… Label1.Show;

There’s my program. But, now come on. This is Linux. It’s not like I can just go to the Run menu and click Run. I go to the Run menu. I click Run. …and my freshly-written and fantastically-sophisticated program… runs.

Ohhhhhhh. Man. Great creators of Lazarus: You are my heroes.😀

Taken from Lazarus forum on this thread.🙂

3 Responses to Lazarus Newbie Adventure on Linux

  1. Bee says:

    Avatar test.😀

  2. Peter Laman says:

    And, have you created anything beyond “Hello world”? Converted a Delphi project, or package? I’m trying to convert some Delphi stuff, but it’s JUST NOT COMPATIBLE. AFAICS now, I could as well switch to a completely different IDE and language.

  3. bee says:

    I had, both desktop-based app and web-based app. However, you can’t expect FPC/Lazarus would be 100% compatible with Delphi. Simply because FPC/Lazarus is not a Delphi clone/copycat and would not ever be, though both using object pascal. Nevertheless, moving to FPC/Lazarus is much much more reliable compare to moving to completely different language since you don’t need to re-write (and learn) the whole thing. You even don’t need to re-write anything if you write the code in pure object pascal (no dependencies to OS API). Been there, done that!😉

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: