Recent

Author Topic: compiler hangs  (Read 31000 times)

RxRick

  • New Member
  • *
  • Posts: 23
Re: compiler hangs
« Reply #15 on: July 03, 2010, 04:07:36 pm »
yes, the svn lazarus is in \Developer\lazarus

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: compiler hangs
« Reply #16 on: July 03, 2010, 06:06:11 pm »
ok. your options seems to be fine.

is your bug fixed now? does Lazarus launch a project fine?

RxRick

  • New Member
  • *
  • Posts: 23
Re: compiler hangs
« Reply #17 on: July 03, 2010, 09:49:19 pm »
thanks so much for all your help, i've been struggling with this, on and off, for weeks.

yes, i can compile a project if i start lazarus from a terminal window, as you explained in a earlier reply. (hurray, my first working mac program!)

however, if i start lazarus from the icon on the dock, it throws this fatal error when I try to build:
Error: resource compiler "fpcres" not found, switching to external mode.
Fatal: There were 1 errors compiling module, stopping

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: compiler hangs
« Reply #18 on: July 03, 2010, 10:17:50 pm »
Error: resource compiler "fpcres" not found, switching to external mode.
Fatal: There were 1 errors compiling module, stopping
that's fine and the problem is known.
As far as i can see, you're using fpc svn version as well. Or you've used some quite old .dmg that didn't competely installed FPC.

The compiler cannot find fpcres tool. A symbol link to the tool must be created at /usr/local/bin directory.

First of all you need to find "fpcres". Run Terminal and type
Code: [Select]
find / -iname fpcres
This will take some time.
I suspect the fpcres binary would be located at /Developer/freepascal/fpc/ directory.

once you've the fpcres found
you need to create the symbolic link. in the Terminal execute the following commands
Code: [Select]
cd /usr/local/bin
sudo ln -s full_path_to_fpcres_here
(i.e: "sudo ln -s /Developer/freepascal/fpc/bin/fpcres"). The operation will query you for the admin password.

After that you can check if the symbolic link is working properly by executing "fpcres" command at the Terminal.

---------------
If there's no fpcres tool found, please re-install FPC from the official download page http://freepascal.org/down/i386/macosx.var. After reinstallatoni fpc you might need to rebuild Lazarus and LCL as well, using Clean All)


RxRick

  • New Member
  • *
  • Posts: 23
Re: compiler hangs
« Reply #19 on: July 04, 2010, 06:27:58 pm »
thank you.

it finds two instances of fpcres:
/usr/local/bin
/Developer/freepascal/fpc/utils/fpcres

running fpcres -V in both directories yields the same version: 2.5.1

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: compiler hangs
« Reply #20 on: July 04, 2010, 08:26:04 pm »
so there's fpcres tool installed.

if it still cannot be found by the compiler (when compiling lazarus project), try to make the symbolic link at /usr/bin

Code: [Select]
cd /usr/bin
sudo ln -s /Developer/freepascal/fpc/utils/fpcres
« Last Edit: July 04, 2010, 08:45:51 pm by skalogryz »

RxRick

  • New Member
  • *
  • Posts: 23
Re: compiler hangs
« Reply #21 on: July 05, 2010, 04:14:07 am »
okay, thanks again.

sudo ln -s /Developer/freepascal/fpc/utils/fpcres

didn't alter the issue.

it compiles when i start lazarus in terminal from the /Developer/lazarus/lazarus.app/Contents/MacOS:
./lazarus

but not when i run from the icon in the dock:
Error: Can't call the resource compiler "/usr/bin/fpcres"

believe me, i'm happy with starting it from terminal.

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: compiler hangs
« Reply #22 on: July 05, 2010, 06:55:59 am »
but not when i run from the icon in the dock:
Error: Can't call the resource compiler "/usr/bin/fpcres"

believe me, i'm happy with starting it from terminal.
just remove /usr/bin/fpcres symbol link, to avoid any problems in future. /usr/local/bin is enough.

Maybe you can try to re-create Lazarus dock icon? first by removing it, and dragging it again from /Developer/lazarus/ directory.

RxRick

  • New Member
  • *
  • Posts: 23
Re: compiler hangs
« Reply #23 on: July 05, 2010, 08:44:54 am »
well, i take my last comment back, because now it won't compile even if i start lazarus from terminal.
Can't call the resource compiler "/usr/bin/fpcres", switching to external mode

so, the last thing i did killed it, which was this:
sudo ln -s /Developer/freepascal/fpc/utils/fpcres

so, i tried this:
cd usr/bin/fpcres
rm fpcres

that didn't do anything, it's broken, now it won't compile at all.
 

RxRick

  • New Member
  • *
  • Posts: 23
Re: compiler hangs
« Reply #24 on: July 05, 2010, 08:55:39 am »
find / -iname fpcres

results:
/Developer/freepascal/fpc/utils/fpcres
/Users/rxrick/.Trash/fpc/utils/fpcres
/Users/rxrick/.Trash/fpc/utils/fpcres/fpcres
/usr/bin/fpcres
/usr/local/bin/fpcres

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: compiler hangs
« Reply #25 on: July 05, 2010, 08:59:09 am »
cd - is "change directory" command.

"cd /usr/bin/fpcres" - won't do anything because /usr/bin/fpcres is a file. You can't change a directory to a file, you should use "cd /usr/bin" instead

"rm fpcres" from /usr/bin might not work, because you don't have access rights to delete (unlink) the file. you should use "sudo rm fpcres".


RxRick

  • New Member
  • *
  • Posts: 23
Re: compiler hangs
« Reply #26 on: July 06, 2010, 12:23:58 am »
thanks again, yes I do understand what cd means (i know you can't assume). i mistyped, my bad.

regardless, it's now broken, it won't compile even if i call lazarus from terminal.

it was working from terminal, before i did this, per your suggestion.
 cd /usr/bin
 sudo ln -s /Developer/freepascal/fpc/utils/fpcres

to which i received this:
ln: ./fpcres: File exists

i then restarted lazarus from terminal:
./lazarus (from /Developer/lazarus/lazarus.app/Contents/MacOS)

and it does not compile, throwing this error:
Can't call the resource compiler "/usr/bin/fpcres", switching to external mode

so, i tried to "undo" this last step by removing the fpcres:
cd /usr/bin
rm fpcres

of course, that did not do anything.


i understand basic unix commands, what i don't understand is how to configure lazarus so it will compile.

i thank you for all your help. i wish i would have left well enough alone, as once again, i am stuck with a broken installation.
 

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: compiler hangs
« Reply #27 on: July 06, 2010, 08:09:57 am »
i understand basic unix commands, what i don't understand is how to configure lazarus so it will compile.
fpcres is compiler's tool, it's called by the compiler, not Lazarus.
Your Lazarus installation seems to be configured fine.

you can try the following:
* Create new program (not Application) project.
* go to project options menu, remove "use manifest file..." and clean the icon.
* press ok.
This should remove {$ *.res} line from the code. (if it doesn't delete it manually).
* add writeln('hello world'); line
* try to compile the project.
It should compile fine, because fpcres tool won't be used.

you might also try to change
Compiler path:
/Developer/freepascal/fpc/compiler/ppc386

to
/Developer/freepascal/fpc/compiler/fpc
(there should be fpc binary somethere)

btw, you've said that fpcres tool is 2.5.1 version. What's the compiler's version?
fpc -iV

« Last Edit: July 06, 2010, 08:14:17 am by skalogryz »

RxRick

  • New Member
  • *
  • Posts: 23
Re: compiler hangs
« Reply #28 on: July 07, 2010, 12:22:44 am »
i guess we should call it fp/lazarus (like gnu/linux)?

i may understand simple, basic unix commands, but i do not grok the file structure of unix. nor the purpose of all the various directories, e.g. /usr/local/... etc. nor how to tell if something listed with ls is a binary or a directory, since there are no file extensions for binary files. i feel blind as a bat, stumbling around in terminal. unfortunately I've used DOS for 25 years, ls -F helps somewhat.

as you mentioned earlier in this thread, i likely have multiple versions of fp/lazarus "installed", because I originally downloaded the dmg's, but could never get anything to work, and had no idea where the fp/lazarus files were installed, in order to remove the failed install.

fpc version is 2.4.0.

if i change compiler path to
/Developer/freepascal/fpc/compiler/fpc
i get error dialog:
Invalid compiler filename
The compiler file "/Developer/freepascal/fpc/compiler/fpc" is not an executable.

created a new project, here is the code
program Project1;

{$mode objfpc}{$H+}

uses
  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
  Classes
  { you can add units after this };

begin
   writeln('hello word');
end.  

would not compile, here are the errors:
ld: can't open out file for writing: /Users/rxrick/Documents/lithium, errno=21
An error occurred while linking
project1.lpr(13,4) Error: Error while linking
project1.lpr(13,4) Fatal: There were 1 errors compiling module, stopping

if i change compiler path to
/usr/local/bin/ppc386

then attempt build:
Error: Error while linking

« Last Edit: July 07, 2010, 12:28:08 am by RxRick »

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: compiler hangs
« Reply #29 on: July 07, 2010, 09:29:27 am »
1. please download the compiler from here:

http://sourceforge.net/projects/freepascal/files/Mac%20OS%20X/2.4.0/fpc-2.4.0.intel-macosx.dmg/download

2. Download and install the .dmg file. This will install the new compiler, and would probably override all current fpc settings.

3. The next thing is you need fpc sources. cd to /Developer/freepascal directory. Run the command there:
Code: [Select]
svn co http://svn.freepascal.org/svn/fpc/tags/release_2_4_0/ fpc240src
this is lengthy process, so please, be patient.

4. When the installation complete. Open Lazarus.
Go to environment settings and change,
* compiler path to: /usr/local/bin/fpc
* complier sources path to: /Developer/freepascal/fpc240src/

5. Select. Tools->Configure "Build Lazarus"... ->Quick Build options.
select Clean Up + Build All. and press build.

This should rebuild the Lazarus with all components, using your newly configure compiler.
After this you should be able to compile projects without any errors.
« Last Edit: July 07, 2010, 09:40:19 am by skalogryz »

 

TinyPortal © 2005-2018