Forum > Other OS

MorphOS and MorpOS Lazarus from Alb42

(1/3) > >>

saashapont:
We talk about morphOS in amiga topic. And now new right topic for it :)

What we have now for cross compilation for example for mac:
1. Cross binutils
2. Cross compilation for MorpOS
3. Lazarus 1.7 from Alb42 Special "MorpOS edition"

I want to use this lazarus as main.
And there is same questions and problems with it
1. What are the right options to rebuild this lazarus after packages installation?
2. When i try compile for win32 i have error:

Free Pascal Compiler version 3.0.0 [2016/01/06] for i386
Copyright (c) 1993-2015 by Florian Klaempfl and others
(1002) Target OS: Win32 for i386
.......
(3104) Compiling lazfileutils.pas
(3104) Compiling lazutilsstrconsts.pas
(1010) Writing Resource String Table file: lazutilsstrconsts.rsj
/Volumes/MacHD2/Downloads/lazarus-lazarus-morphos/components/lazutils/lazfileutils.pas(175,3) Fatal: (2003) Syntax error, "BEGIN" expected but "identifier UNIX" found
Fatal: (1018) Compilation aborted
Error: /sw/bin/ppc386 returned an error exit code

Are there any easy way to fix that?

molly:

--- Quote from: saashapont on August 04, 2016, 09:54:08 am ---(1010) Writing Resource String Table file: lazutilsstrconsts.rsj
/Volumes/MacHD2/Downloads/lazarus-lazarus-morphos/components/lazutils/lazfileutils.pas(175,3) Fatal: (2003) Syntax error, "BEGIN" expected but "identifier UNIX" found

--- End quote ---


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---implementation // to get more detailed error messages consider the osuses{$IFDEF HASAMIGA}  Exec, dos;{$ELSE}  {$IFDEF Windows}    Windows {$IFnDEF WinCE}, ShlObj, ActiveX, WinDirs{$ENDIF};  {$ELSE}    {$IFDEF darwin}      MacOSAll,    {$ENDIF}  {$ENDIF}  Unix, BaseUnix;{$ENDIF} 

--- Quote ---Are there any easy way to fix that?

--- End quote ---
Ah, come on. Now that everything works, this is the easy part  ;)

I promise you (provided that your setup is done ok) that this is the last tiny hurdle that you need to take. I really would like to suggest to take that one small hurdle by yourself.

As a hint: it is a very obvious oversight. Start at the top of the snippet and follow all ifdefs and ask yourself what is happening when you compile for Windows.

PS: without pasting any code what-so-ever nobody here is going to help you as you are using a unofficial-fork-with-official-unsupported-lazarus-branch.

saashapont:
Thank you for quick answer!
--- Quote from: molly on August 04, 2016, 11:18:34 am ---PS: without pasting any code what-so-ever nobody here is going to help you as you are using a unofficial-fork-with-official-unsupported-lazarus-branch.

--- End quote ---

There are no code, i try compile empty project :)

I try analyze all ifdef, and compare with official lazarus& In official we have in this piece
// to get more detailed error messages consider the os
uses
{$IFDEF Windows}
  Windows {$IFnDEF WinCE}, ShlObj, ActiveX, WinDirs{$ENDIF};
{$ELSE}
  {$IFDEF darwin}
  MacOSAll,
  {$ENDIF}
  Unix, BaseUnix;
{$ENDIF}

he logic is right
if non amiga else windows if non windows else darwin and if non amiga^ non windows non darwin then unix

molly:

--- Quote from: saashapont on August 04, 2016, 11:52:21 am ---There are no code, i try compile empty project

--- End quote ---
I was talking about the code that causes the error  ;D


--- Quote ---I try analyze all ifdef, and compare with official lazarus& In official we have in this piece

--- End quote ---
You have done some homework. That's very good  8)


--- Quote ---he logic is right
if non amiga else windows if non windows else darwin and if non amiga^ non windows non darwin then unix

--- End quote ---
Well, the logic behind the ifdefs is perfectly ok, it is the actual implementation part that has a (small) flaw. As said, a simple oversight from the developer by placing something at the wrong location  :-X

Why otherwise would the compiler complain ?

I know, it might be frustrating on your end but please have a closer look.

In case things really eludes you, then use a setup that works, copy paste the ifdefs into an empty project and instead of making the code add units to a uses clause, place things somewhere inside an empty procedure or function and let the compiler inform you about things with using warning messages.

Something like this:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---program includings; // compile this with a working fpc compiler, target must be Windows and inspect the output. procedure TestUnits;begin{$IFDEF HASAMIGA}  {$WARNING Has Amiga was defined, including units Exec and Dos}{$ELSE}  {$WARNING Has Amiga was not defined, checking for windows}  {$IFDEF Windows}    {$WARNING Windows was defined, include unit windows and do some wince checking that we conveniently skip here}  {$ELSE}    {$WARNING Windows was not defined, so apparantly we compile for another target, lets check if its darwin}    {$IFDEF darwin}      {$WARNING Darwin was defined, including MacOSAll}    {$ENDIF}    {$WARNING Windows was not defined and darwin was also not defined, we are directly before the end of else ifdef windows construction}  {$ENDIF}  {$WARNING HasAmiga was not defined, include units Unix and BaseUnix}{$ENDIF}end; begin  TestUnits;end. 
We have no mimicked the implementation in a small simple testexample which is now completely controlled by us and that shows the same behaviour as the original code.

Now, when compiling (for windows target) pay close atttention to the output in your messages window. Do you see anything wrong with that ? (remember that the target is windows).

saashapont:
Compile Project, Mode: Windows, OS: win32, Target: project1.exe: Success, Warnings: 3
unit1.pas(39,4) Warning: User defined: Has Amiga was not defined, checking for windows
unit1.pas(41,6) Warning: User defined: Windows was defined, include unit windows and do some wince checking that we conveniently skip here
unit1.pas(49,4) Warning: User defined: HasAmiga was not defined, include units Unix and BaseUnix

You want to say that
HasAmiga was not defined, include units Unix and BaseUnix
are superfluous?

Navigation

[0] Message Index

[#] Next page

Go to full version