Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
That's a much better idea. But maybe Lars should know what "assign" procedure to use with each compiler he runs because he may need to write Pascal programs for either or both platforms.

Absolutely! Always good to learn more. Though I think his Pascal experience will be limited to what is required for the coursework. ;)

He's already got some C under his belt and will hopefully soon be moving back to Objective C if he hasn't already.

B
 
Absolutely! Always good to learn more. Though I think his Pascal experience will be limited to what is required for the coursework. ;)

He's already got some C under his belt and will hopefully soon be moving back to Objective C if he hasn't already.

B
You're right, B. Still, I wonder why his college or his university offers a course about Pascal if no one will hire Pascal programmers anymore. Since I've quit programming professionally, I decide what languages I'll program in. So I don't care what language is most popular in the industry. The day I emailed Doug Cooper, a coauthor of my favorite Pascal book Oh! Pascal , I suggested he write a book about Ada 95. "There's no demand for it," he replied. Hmm, that's strange. I thought Boeing's programmers wrote their autopilot software in that language. What do I know? I'm a dinosaur with a 12-year-old SPARCstation under my bed. :) Ooh, I miss the old guy, too. Seriously, I do.
 
Hey Guys,

Bill - My instructor told us why Pascal the first day of class. It was a very easy and straight forward program to learn. Plus much of what I learn will pass forward to other languages in the future.

I found a couple links online to what I use. The programming environment is called 'Geany' and I found a link to what looks like it http://www.linoob.com/2010/06/geany-a-basic-programming-ide-for-linoobs/

On the Linux machines they are running http://www.ubuntu.com/

It would be great if I could write the code and then just take it with me to the Lab and print it out. Perhaps Xcode is not the right thing for this, I don't know?

Thanks for your help.

EDIT: perhaps I can install a dual boot for my Mac and install Ubuntu, found this.. https://help.ubuntu.com/community/SwitchingToUbuntu/FromMacOSX

-Lars
 
Bill - My instructor told us why Pascal the first day of class. It was a very easy and straight forward program to learn. Plus much of what I learn will pass forward to other languages in the future.
Are you still having to turn in your top-down designs with your assignments or is that part done? I think that is another big reason. The old fashioned book spends a while on program structure and pre-programming activities that will serve you well in any language.

perhaps I can install a dual boot for my Mac and install Ubuntu, found this.

No need for that for what you are doing, just install Virtualbox/Parallels/Fusion and install the right version of Ubuntu into the VM. You might even be able to get a preconfigured VM from SBCC. That way you can run stuff on Ubuntu while also doing other things in OS X.

B
 
I am a step a head of you. I have Parallels installed because I run billing software for my company on it under XP. I downloaded ubuntu and it is installing on it right now.

As for the TOP DOWN DESIGN my new chapter 9 home work assignment is to do my own TDD for the project. Before the teacher would do it on the board and we copied it. Now I have to do my own. Good news is it is Spring Break so no class next week and that gives me 2 weeks to finish the project.

I'll need help :)

-Lars
 
Bill - My instructor told us why Pascal the first day of class. It was a very easy and straight forward program to learn.
For me, programming languages are easy to learn. But I thought learning Pascal was much easier than learning C. Pascal includes some useful features that C doesn't have, sets, for example.

It would be great if I could write the code and then just take it with me to the Lab and print it out. Perhaps Xcode is not the right thing for this, I don't know?
I'll bet you already can do that with the TextEdit program that comes with Snow Leopard. I keep that editor's icon in my dock because I like to use an ordinary text editor when I type programs. If you use TextEdit, remember to make it save your document as plain ASCII text. I used to write programs at home, email them to myself, and compile them at school. You might even run the Emacs text editor, too. I like it a lot, but it's hardly the user-friendliest program I've ever used.
 
Good to know.

I installed Parallels and Ubuntu. I found in the "Synaptic Package Manager" Geany and installed it. I wrote the old Hello World and tried to compile and got this error '/bin/sh: fpc not found'

I am guessing that Geany is a text editor of some kind and I need to install a compiler, sine it won't compile?

any ideas?

Thanks

-Lars
 
Wow, you guys are so fast and helpful I think I will just send you my homework assignments to do for me.

That would be easiest for me :)

-Lars

EDIT: I installed it and it worked just fine. Thank you!
 
Last edited:
I compiled everything with in Geany, on Linux, it said successful but I get a warring in RED" /usr/bin/ld: warning: link.res contains output sections; did you forget -T? "

When I try to execute it I get a 'Runtime Error 102'.

In school when I hit execute a window pops up asking me for the input file and then the output file. It's the same window that comes up but with RunTime Error.

Any ideas?

-Lars
 
I compiled everything with in Geany, on Linux, it said successful but I get a warring in RED" /usr/bin/ld: warning: link.res contains output sections; did you forget -T? "
I wonder what program the computer runs when it expects the "-T" directive: the linker or the Pascal compiler. Snow Leopard's linker doesn't take a "-T" directive, or if it does the linker's, ld's, manual page doesn't mention it. I'd check the Pascal compiler's manual page for a "-T" directive. If I found one there, I'd recompile the program on a command-line, where I'd put the "-T" between the compiler's name and your program's name. So if the compiler's name is "pascal", and my program's name were "homework.pas", I'd type "pascal -T homework.pas" and press the "return" key.
 
My Internet is down so I am typing in on my iPhone. I found a link on line that said free pascal was the problem. I did run it in terminal and it first asked fir the file, then wrote out the -T line but the after it wrote the correct answer, so it worked. I downloaded GPC and tried that one to compile and it worked without any problems. Geany automatically picks the co
Compiler. I need to delete / remove fpc and use fpc instead. From what I read there are no options to select a compiler in Geany.
 
I found a work around. Write it in Geany, compile in the terminal with fpc and not fpc, the execute it back in Geany.

The problem is fpc.
 
I found a work around. Write it in Geany, compile in the terminal with fpc and not fpc, the execute it back in Geany.

The problem is fpc.

I would argue that the problem is Geany as fpc works fine.

Why not just get fpc going on OS X?

-Lee
 
I would argue that one of Lars' "fpc"s was supposed to be "gpc". :p

B
How many letters are between the quotation marks in "A A A?" One and three. There are three instances of only one letter, the letter "A." Or as Charles Saundes Pierce might say, there are three tokens of the "A" type. Pierce was a philosopher who named his philosophy "Pragmaticism." He wasn't a programmer.
 
Sorry, I ment gpc. I Internet is down till Sunday so I have to type it all into my iPhone. When u use fpc to compile in the terminal I get that warning with -T which I listed above. But when I use gpc to compile I dis not get that -T warning. I installed ubuntu in Linux and use Geany to emulate the envoirnmet. I did read on the free pascal site about this issue. If I could switch Geany to use gpc instead of fpc the problem would be solved. I uninstalled fpc and installed gpc but Geany kept saying fpc was missing. There are no settings inside Geany for selecting the compiler that I could find.
 
Sorry, I ment gpc. I Internet is down till Sunday so I have to type it all into my iPhone. When u use fpc to compile in the terminal I get that warning with -T which I listed above. But when I use gpc to compile I dis not get that -T warning. I installed ubuntu in Linux and use Geany to emulate the envoirnmet. I did read on the free pascal site about this issue. If I could switch Geany to use gpc instead of fpc the problem would be solved. I uninstalled fpc and installed gpc but Geany kept saying fpc was missing. There are no settings inside Geany for selecting the compiler that I could find.

Maybe just stick a symlink in /usr/bin or something pointing fpc to gpc and see how that treats you?

ln -s /usr/bin/gpc /usr/bin/fpc

(substitute where gpc is actually installed, you can type which gpc to find out if you don't know).

At the end of the day, it seems easier to just use a text editor and gpc at the commandline that go through all of this rigmarole to use Geany.

-Lee
 
Maybe just stick a symlink in /usr/bin or something pointing fpc to gpc and see how that treats you?
If you do create a symlink, Scott, be careful. You might accidentally create a circular one, a link that points to itself. After I did that, my poor Sun workstation got stuck in an infinite loop.

If you don't want to use a symlink, you could put an alias into your .bashrc file.

At the end of the day, it seems easier to just use a text editor and gpc at the commandline that go through all of this rigmarole to use Geany.
Sometimes supposedly user-friendly programs aren't so user-friendly after all. The command-line can make life easier than some fancy GUIs do.
 
At the end of the day, it seems easier to just use a text editor and gpc at the commandline that go through all of this rigmarole to use Geany.

I think part of what larswik was facing with having to translate between home and school was using GNU Pascal at home and Free Pascal at school.

Using the same compiler with the same switches will avoid having to rewrite the code later. The IDE is just window dressing, but having it be common should make things easier once configured properly.

B
 
My internet is back. It was out for 24 hours and now I know 'The Internet' is a drug that we have withdrawals from.

I didn't look to see what they compile with at school but you are right Balawm. I am trying to emulate the school to avoid rewriting the code when I get there.

I will give it a try Lee and see what happens. From what I understand of programing so far Geany is a text editor and it uses a compiler to convert my code to machine code. There are a number of different compilers on the market (maybe not so with Pascal), but you pick the best one for your needs. Geany only seems to like FPC. But successfully compiles with GPC in the terminal.

I found this on the Free Pascal site for my problem......

There is a bug in GNU LD 2.19 and 2.19.1 that causes it to crash when processing FPC-generated linker scripts. This bug has been fixed in the mean time.

At the same time, LD has been modified to emit a warning of the form

/usr/bin/ld: warning: link.res contains output sections; did you forget -T?

This warning is benign, and FPC intentionally does not pass -T to LD. The reason is that if -T is used, LD's internal linker script is ignored and only FPC's linker script is used. Such linker scripts also contain paths to libraries however, and if we would ignore the internal linker script then LD would no longer find libraries in distribution-specific directories."

So it must be FPC

Thanks!

-Lars
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.