Recent

Author Topic: Simple installation  (Read 13240 times)

jimihendrix

  • New Member
  • *
  • Posts: 19
Simple installation
« on: April 12, 2010, 01:37:33 am »
Hi, Im new to the mac
Ive had to write a program for both windows/mac (normally I code in c++) but since this crossplatform I thought something like lazarus would suit me better, Yesterday I finished the windows program (first time Ive used pascal since 1985  :D but it was pretty painless )
Anyways I cant seem to install lazarus for my mac powerpc (*), is there a no brains required method to install it i.e. written for someone who's never used a mac before. My other option is to write the app with Xcode (which is installed) in either c/objective c. but that seems a shame since Ive already written it in lazarus with windows 

(*)I get the message bad CPU type in executable

cheers

Leledumbo

  • Hero Member
  • *****
  • Posts: 8835
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Simple installation
« Reply #1 on: April 12, 2010, 05:47:00 am »
Quote
I get the message bad CPU type in executable
Did you download the correct .dmg?

jimihendrix

  • New Member
  • *
  • Posts: 19
Re: Simple installation
« Reply #2 on: April 12, 2010, 08:11:51 am »
thanks Leledumbo for replying
yes I did, the powerpc one
but Ive solved it now

note to other newbies -
ignore the files from http://sourceforge.net/projects/lazarus/files/ which use fpc 2.2
and used the ones from the http://www.hu.freepascal.org/lazarus/ which use fpc 2.4

A couple of new questions
1/ The scrolling of the html is very jerky, I just wanna display some text in the html page (but require bold,italics on some words) thus cant use a memo control (a richmemo control would be nice I think) also I require this to be printed. Have I set this up wrong perhaps? (it scrolls nice on the windows lazarus version)

2/ the *.app file is huge ~16,000 kb for comparison on windows its 1,500 kb. FWIW with a staticlly linked c++ windows the *.exe is only 50kb!!!

I know pascal does generate larger files but 320x larger is a bit ridiculous   :D

cheers guys


Wodzu

  • Full Member
  • ***
  • Posts: 171
Re: Simple installation
« Reply #3 on: April 12, 2010, 08:31:45 am »
Hi, jimihendrix ;)

1. You should use THtml components, I use them in everydays work and they are good and fast.

http://www.lazarus.freepascal.org/index.php/topic,8104.0.html

2. http://www.lazarus.freepascal.org/index.php/topic,9066.0.html

Remember to turn off the debug info when you are making a release version. File size should drop to ~ 2MB

jimihendrix

  • New Member
  • *
  • Posts: 19
Re: Simple installation
« Reply #4 on: April 12, 2010, 09:20:34 am »
cheers mate

1/ yes just installed it (nice and simple, gotta love it)
and it works, much much nicer  ;D
Works so good that Im wondering if I should go back and add it to the windows version

there is a small bug though, if you press ther up/down arrows then the scrollbar moves but the actual html doesnt (I can live with that though) pageup/down work and draging the scrollbar also.

2/ I believe I am doing strip (which makes a huge difference with the size of the windows exe) but from what I can see makes bugger all difference to the mac *.app

Wodzu

  • Full Member
  • ***
  • Posts: 171
Re: Simple installation
« Reply #5 on: April 12, 2010, 09:26:45 am »
Glad you like it :)

As goes for the 2.
Go to the Menu -> Project\Project Options\Compiler Options\Linking and turn on Link Smart (-XX) and Strip Symbols From Executable (-Xs)

Hope that it helps.

Edit: If there is a bug in THtml, please report it in the Bugtracker.
« Last Edit: April 12, 2010, 09:28:32 am by Wodzu »

jimihendrix

  • New Member
  • *
  • Posts: 19
Re: Simple installation
« Reply #6 on: April 12, 2010, 10:17:53 pm »
Ta Wodzu

1/ doesnt seem to help, still a huge *.app size, setting those on windows makes the *.exe like 15% size so big help there
Perhaps theyre not implemented with the mac or Im doing it wrong (cant see how though)

2/ Submited to bugtracker (hopefully in the right place)

another minor question
3/
my app is reading a file from the same directory as the *.app
whats the standard way
LoadFromFile( 'filename' );
or
LoadFromFile( './filename' );

the reason I ask is cause when I run the app from lazarus it opens a different file to when I click on the *.app in Finder

cheers guys

jimihendrix

  • New Member
  • *
  • Posts: 19
Re: Simple installation
« Reply #7 on: April 12, 2010, 11:55:46 pm »
WRT *.app size

hello_world standard size = 18mb
 Link Smart (-XX) and Strip Symbols From Executable (-Xs) size = 13.9mb

so not a massive saving like the windows version has

But Ive run into a worse issue

apparently my app that Ive built doesnt run on a macintel, is it possible to create an macintel *.app on my powerpc?
or am I screwed  :o
If so what are the options?

Wodzu

  • Full Member
  • ***
  • Posts: 171
Re: Simple installation
« Reply #8 on: April 13, 2010, 07:13:06 am »
jimi I am sorry I can't help you with Mac cause I've never used it. :(

I am sure you can go down with the file size, though. Have you turned on level 3 optimization too?

I really hope you solve your problem with Mac. Maybe it is worth to start another thread for this.

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Simple installation
« Reply #9 on: April 13, 2010, 08:06:05 am »
apparently my app that Ive built doesnt run on a macintel, is it possible to create an macintel *.app on my powerpc?
or am I screwed  :o
If so what are the options?

what you need it to cross-compile LCL for Intel target.

Here's the explanation how to cross compile from Intel to PowerPC.
http://wiki.freepascal.org/Carbon_Interface#Getting_PowerPC_units

Cross-compiling from PowerPC to Intel should work in the similar way.
Try to specify target cpu as "i386".


jimihendrix

  • New Member
  • *
  • Posts: 19
Re: Simple installation
« Reply #10 on: April 13, 2010, 08:16:15 am »
yes I saw that skalogryz, I did try it but it didnt work before (it gave me errors), Ill give it another go though

@Wodzu I dont think u can change the -O1,2,3, etc, theres a lot less options under the mac, than there is with windows/unix

cheers guys

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Simple installation
« Reply #11 on: April 13, 2010, 08:18:23 am »
yes I saw that skalogryz, I did try it but it didnt work before (it gave me errors), Ill give it another go though
what kind of errors?

jimihendrix

  • New Member
  • *
  • Posts: 19
Re: Simple installation
« Reply #12 on: April 13, 2010, 08:37:52 am »
well if I go
Environment -> Options

and try to change compiler path
to anything thats not /usr/local/bin/ppcppc
eg
/usr/local/bin/ppc386

and press OK I get the message
"the compiler file /usr/local/bin/ppc386 is not an executable"

Wodzu

  • Full Member
  • ***
  • Posts: 171
Re: Simple installation
« Reply #13 on: April 13, 2010, 08:39:36 am »
@Wodzu I dont think u can change the -O1,2,3, etc, theres a lot less options under the mac, than there is with windows/unix


Sorry to misguide you than, I've assumed that the options will be the same.  :-[

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Simple installation
« Reply #14 on: April 13, 2010, 09:19:28 am »
"the compiler file /usr/local/bin/ppc386 is not an executable"
what fpc version are you using? where from did you download the fpc from (was it lazarus download page)?

 

TinyPortal © 2005-2018