Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-06

Graphics32 carbon

20 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

CA Gorski

When I try to compile Graphics32 (http://graphics32.org) against carbon I get

Error: Generating PIC, but reference is not PIC-Safe

for GR32_Blend.pas
lea edi, [eax+DivTable]

Why is FPC generating PIC here?

Laz 0.9.29
FPC 2.4.0
Mac OSX Leopard

Reply by email

dmitry boyarintsev
to CA Gorski
CA Gorski wrote 9 lines
When I try to compile Graphics32 (http://graphics32.org) against carbon I get Error: Generating PIC, but reference is not PIC-Safe for GR32_Blend.pas lea edi, [eax+DivTable] Why is FPC generating PIC here?

It's default mode for darwin target. Try to compile the project with the additional compiler option (Project Compiler
Options->Other->Custom options): -Cg-
This should disable PIC code generation.

fpc-pascal mailing list is the better place to ask about it: http://lists.freepascal.org/mailman/listinfo/fpc-pascal

thanks,
dmitry

Reply by email

CA Gorski
to dmitry boyarintsev: It's default mode for darwin target. Try to compile the project with the additional …
Show quoted text 5 lines
It's default mode for darwin target. Try to compile the project with the additional compiler option (Project Compiler Options->Other->Custom options): -Cg- This should disable PIC code generation.

It does. Didn't know and couldn't find anywhere that a - behind disables an option.

What is the reason for having PIC for darwin? I have read that it slows down and is only useful for libs, if at all.

fpc-pascal mailing list is the better place to ask about it: http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Yesterday I posted something regarding a compenent (VT) there and was told the better place would be here. ;)
Problem is, as the questioner you don't know in advance where it leads to...

Reply by email

dmitry boyarintsev
to CA Gorski: It does. Didn't know and couldn't find anywhere that a - behind disables an option. What…
CA Gorski wrote
It does. Didn't know and couldn't find anywhere that a - behind disables an option.

run fpc (or fpc -h) in command line, you'll find something like this:

Free Pascal Compiler version 2.5.1 [2010/04/05] for i386 Copyright (c) 1993-2009 by Florian Klaempfl
C:\FPC_Laz\root\bin\i386-win32\ppc386.exe [options] <inputfile> [options] *** Put + after a boolean switch option to enable it, - to disable it ***

It should also be said, somewhere in FPC docs.

What is the reason for having PIC for darwin? I have read that it slows down and is only useful for libs, guess Jonas Maebe at fpc-pascal should know the answer.

thanks,
dmitry

Reply by email

CA Gorski
to Felipe Monteiro de Carvalho
Sure you use the port, I commited in the official repository and it was merged with the previous sources.

Ok, sorry. Didn't know that! ;)

The compiler switch -Cg- solved the PIC problem.

But with GR32 I get randomly can't find unit errors, which disappear after compiling or installing or even rebuilding Lazarus again. Mostly is it GR32_Blend but sometimes also others.

Reply by email

Felipe Monteiro de Carvalho
to CA Gorski

Just from your description of the error I can't say anything, but you are lucky that I now have a contract which involves Graphics32, so I will be testing, updating and expanding the port.

Felipe Monteiro de Carvalho

Reply by email

CA Gorski
to Felipe Monteiro de Carvalho

As far as I have more precise infos I will let you know. Would you prefer private mail?

But two things I had to change to compile for carbon are:

GR32_Bindings.pas:
{$I GR32.INC} changed to {$I GR32.inc}
GR32_Containers:
uses
{$IFDEF FPC}
   {$IFDEF Windows}
   Windows,
   {$ENDIF}
{$ELSE}

changed to

uses
{$IFDEF FPC}
   {$IFDEF Windows}
   Windows,
   {$ELSE}
   LCLIntf,
   {$ENDIF}
{$ELSE}

otherwise PRect was not found.

Felipe Monteiro de Carvalho wrote 5 lines
Just from your description of the error I can't say anything, but you are lucky that I now have a contract which involves Graphics32, so I will be testing, updating and expanding the port.

Reply by email

Felipe Monteiro de Carvalho
to CA Gorski

Hello,

I prefer the mailling list.

And thanks, I will commit your improvements as soon as I regain commit access. I had it on their old repository, but recently they moved to SVN.

I will also implement a Qt Backend for GR32.

Felipe Monteiro de Carvalho

Reply by email

CA Gorski
to Felipe Monteiro de Carvalho
Show quoted text 5 lines
About the Unit not found thing, are you using the Lazarus package for Graphics32? I would recommend using it instead of adding the units to your PATH

Yes, I use the package. Nothing added to PATH.
Btw, I have the same problems on Win and Mac, and also with Laz 0.9.28 and 0.9.29.

Reply by email

CA Gorski
to Felipe Monteiro de Carvalho: About the Unit not found thing, are you using the Lazarus package for Graphics32? I would…
About the Unit not found thing, are you using the Lazarus package for Graphics32? I would recommend using it instead of adding the units to your PAT

I explain in detail, what I do. Maybe this is already wrong. I open GR32_L.lpk and compile it. After that I open G32_DSGN_L.lpk and install it.

Is that the right way?

How can I completely uninstall a package from Lazarus?

Reply by email

Felipe Monteiro de Carvalho
to CA Gorski

Hello,

I took a look at the file that you sent and it has the wrong options. The option -va shows the searching of units, you used another option which just shows the IFDEFs...

Anyway, one possible cause is that you added the GR32 path to your Compiler Options search path. Is it so, or is it clean? Do you have old .ppu, .o files or else another unit called GR32?

I was having this problem with lNet, because I had my own unit called OpenSSL which conflicts with the one in FPC. (It's the same unit, but I use a better one and I am still testing it before commiting).

Maybe your problem is one of those...

CA Gorski wrote 5 lines
I explain in detail, what I do. Maybe this is already wrong. I open GR32_L.lpk and compile it. After that I open G32_DSGN_L.lpk and install it. Is that the right way?

Yes, that's the right way.

How can I completely uninstall a package from Lazarus?

Menu Packages --> Configure Installed Packages

Felipe Monteiro de Carvalho

Reply by email

CA Gorski
to Felipe Monteiro de Carvalho: I took a look at the file that you sent and it has the wrong options. The option -va…
Felipe Monteiro de Carvalho wrote 11 lines
Hello, I took a look at the file that you sent and it has the wrong options. The option -va shows the searching of units, you used another option which just shows the IFDEFs... Anyway, one possible cause is that you added the GR32 path to your Compiler Options search path. Is it so, or is it clean? Do you have old .ppu, .o files or else another unit called GR32?

I did not add anything to something. And I have no other units with the same name. I get those errors after clean install of Lazarus and GR32, even the OS was clean.

You want a -va message file?

Menu Packages --> Configure Installed Package

Yes, but then Lazarus still knows that there is that package, though uninstalled. I meant, is there an XML file where Laz keeps tab on them?

Reply by email

Mattias Gärtner
to CA Gorski

Zitat von CA Gorski :

Show quoted text 19 lines
On 07.06.2010 09:39, Felipe Monteiro de Carvalho wrote: > > Hello, > > I took a look at the file that you sent and it has the wrong options. > The option -va shows the searching of units, you used another option > which just shows the IFDEFs... > > Anyway, one possible cause is that you added the GR32 path to your > Compiler Options search path. Is it so, or is it clean? Do you have > old .ppu, .o files or else another unit called GR32? > I did not add anything to something. And I have no other units with the same name. I get those errors after clean install of Lazarus and GR32, even the OS was clean. You want a -va message file?

Yes.

> Menu Packages --> Configure Installed Package Yes, but then Lazarus still knows that there is that package, though uninstalled. I meant, is there an XML file where Laz keeps tab on them?

Yes, your project. See view / project inspector.

You can see the what packages do to your project in the "inherited" page of the compiler options.

Mattias

Reply by email