Recent

Author Topic: Trouble on mac / FV  (Read 5390 times)

d2klein

  • Newbie
  • Posts: 6
Trouble on mac / FV
« on: March 21, 2018, 08:31:45 am »
Hi together,

i just installed lazarus on my mac which i guess worked fine (well no debugging yet but...). Setting up a sample gui application compiles and starts. But as soon as i try to create a fv application following http://www.lazarusforum.de/viewtopic.php?f=22&t=11063

Code: Pascal  [Select][+][-]
  1. program Project1;
  2.  
  3. uses
  4.   App;   // TApplication
  5.  
  6. var
  7.   MyApp: TApplication;
  8.  
  9. begin
  10.   MyApp.Init;   // Inizialisieren
  11.   MyApp.Run;    // Abarbeiten
  12.   MyApp.Done;   // Freigeben
  13. end.

compiling ends with a message about duplicate PPU for menus and dialogs. One ppu belongs to fv, the second one to a cocoa wrapper or something like that.

Any idea how to solve the problem?

Thaddy

  • Hero Member
  • *****
  • Posts: 14157
  • Probably until I exterminate Putin.
Re: Trouble on mac / FV
« Reply #1 on: March 21, 2018, 09:49:24 am »
Code: Pascal  [Select][+][-]
  1. {$apptype console}
  2. uses
  3.   App;   // TApplication
  4.  
  5. var
  6.   MyApp: TApplication;
  7.  
  8. begin
  9.   MyApp.Init;   // Inizialisieren
  10.   MyApp.Run;    // Abarbeiten
  11.   MyApp.Done;   // Freigeben
  12. end.

This will force an ignore for widget sets, but you must be setting something wrong since cocoa should not be pulled in. Maybe a configuration issue?
« Last Edit: March 21, 2018, 10:00:12 am by Thaddy »
Specialize a type, not a var.

d2klein

  • Newbie
  • Posts: 6
Re: Trouble on mac / FV
« Reply #2 on: March 21, 2018, 11:03:46 am »
Probably but i don't find it :(

I just created a new project type "simple application" or so.

Thaddy

  • Hero Member
  • *****
  • Posts: 14157
  • Probably until I exterminate Putin.
Re: Trouble on mac / FV
« Reply #3 on: March 21, 2018, 11:49:28 am »
I tested my code on a MAC mini: it works.
Specialize a type, not a var.

d2klein

  • Newbie
  • Posts: 6
Re: Trouble on mac / FV
« Reply #4 on: March 21, 2018, 12:34:27 pm »
hmm then i'll try the compiler directive as soon as i'm at home. On a windows box it's not needed.

Thaddy

  • Hero Member
  • *****
  • Posts: 14157
  • Probably until I exterminate Putin.
Re: Trouble on mac / FV
« Reply #5 on: March 21, 2018, 02:43:17 pm »
hmm then i'll try the compiler directive as soon as i'm at home. On a windows box it's not needed.
That is not true: on a Windows box it IS needed. On a Linux box it is not needed.
It may be that a Default Laz configuration assumes a GUI, though, but the compiler needs to know.
Either through {$apptype GUI} or through passing -WG (on windows)
You are on a Mac: use {$apptype GUI} in your project file. (lpr not lpi)
« Last Edit: March 21, 2018, 03:06:35 pm by Thaddy »
Specialize a type, not a var.

d2klein

  • Newbie
  • Posts: 6
Re: Trouble on mac / FV
« Reply #6 on: March 21, 2018, 07:35:05 pm »
Well still no luck.

Compiling message:

Projekt kompilieren, Ziel: /Users/xxx/tmp/project1: Exit code 256, Fehler: 1, Warnungen: 2
project1.lpr(2,4) Warning: APPTYPE is not supported by the target OS
Warning: Recompiling App, checksum changed for Menus
project1.lpr(4,3) Fatal: Can't find unit App used by Project1


Project setting test:

ANMERKUNG: using config file /etc/fpc.cfg
WARNUNG: ppu ist zweimal vorhanden: /usr/local/lib/fpc/3.0.4/units/i386-darwin/univint/Dialogs.ppu, /usr/local/lib/fpc/3.0.4/units/i386-darwin/fv/dialogs.ppu
WARNUNG: ppu ist zweimal vorhanden: /usr/local/lib/fpc/3.0.4/units/i386-darwin/univint/Menus.ppu, /usr/local/lib/fpc/3.0.4/units/i386-darwin/fv/menus.ppu
WARNUNG: verwaiste Datei gefunden: /Users/xxx/tmp/lib/i386-darwin/unit1.o
WARNUNG: verwaiste Datei gefunden: /Users/xxx/tmp/lib/i386-darwin/unit1.ppu



Also tried removing fpc/lazarus according to http://wiki.freepascal.org/Installing_Lazarus_on_MacOS_X#Installed_from_disk_images_or_sources
manually removing everything fpc related I could find (e.g. .lazarus dir in home and so on) and reinstalling but still no luck

Thaddy

  • Hero Member
  • *****
  • Posts: 14157
  • Probably until I exterminate Putin.
Re: Trouble on mac / FV
« Reply #7 on: March 21, 2018, 10:37:45 pm »
Then your paths are incorrect. I double checked.
Specialize a type, not a var.

d2klein

  • Newbie
  • Posts: 6
Re: Trouble on mac / FV
« Reply #8 on: March 28, 2018, 07:58:08 pm »
Still trying.

compiling on console leads to error too. using fpc -vut source file I come to:


(APP)      Load from APP (interface) unit MENUS
(MENUS)    Loading unit MENUS
Unitsearch: Menus.ppu
Searching file Menus.ppu... not found
Searching file menus.ppu... not found
Searching file MENUS.PPU... not found
Unitsearch: Menus.pp
Searching file Menus.pp... not found
Searching file menus.pp... not found
Searching file MENUS.PP... not found
Unitsearch: Menus.pas
Searching file Menus.pas... not found
Searching file menus.pas... not found
Searching file MENUS.PAS... not found
Unitsearch: Menus.p
Searching file Menus.p... not found
Searching file menus.p... not found

.....

PPU Loading /usr/local/lib/fpc/3.0.4/units/x86_64-darwin/univint/Menus.ppu
(MENUS)    PPU Name: /usr/local/lib/fpc/3.0.4/units/x86_64-darwin/univint/Menus.ppu
(MENUS)    PPU Time: 2017/11/27 00:35:19
(MENUS)    PPU Flags: 143488
(MENUS)    PPU Crc: 685DCEB8
(MENUS)    PPU Crc: 34361E18 (intfc)
(MENUS)    PPU Crc: AC0504A1 (indc)

......

(MENUS)    Finished loading unit MENUS
(APP)      Adding dependency: APP depends on MENUS
(APP)      Recompiling App, checksum changed for Menus

And this is because while searching for ppus, the first MENUS.PPU found is the UNIVINT one. But instead of continue searching the compiler stops and tries to use the first one found (probably the wrong one? as there is another one in /usr/local/lib/fpc/3.0.4/units/x86_64-darwin/fv)  . Therefore the system tries to recompile APP which is not possible.

Still working on how to come around


d2klein

  • Newbie
  • Posts: 6
Re: Trouble on mac / FV
« Reply #9 on: March 28, 2018, 08:01:23 pm »
maybe it's possible to enhance my fpc.cfg by another ifdef FV flag pointing to the fv directory first?

 

TinyPortal © 2005-2018