AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen FreePascal [GNU/Linux, FPC] Linkerproblem bei SO's
Thema durchsuchen
Ansicht
Themen-Optionen

[GNU/Linux, FPC] Linkerproblem bei SO's

Ein Thema von implementation · begonnen am 11. Feb 2011 · letzter Beitrag vom 13. Feb 2011
 
Benutzerbild von implementation
implementation

Registriert seit: 5. Mai 2008
940 Beiträge
 
FreePascal / Lazarus
 
#1

[GNU/Linux, FPC] Linkerproblem bei SO's

  Alt 11. Feb 2011, 10:56
Guten Morgen,

ich habe meine Testbibliothek aus diesem Thread etwas erweitert mit einer Variable:
Delphi-Quellcode:
{$mode objfpc}{$longstrings on}

unit CrayLib;

interface

uses CrayInter;

type
   TPowerstaff = class(TInterfacedObject, IPowerstaff)
   public
      procedure Writeln(s: pchar);
   end;
   
procedure Hello;
procedure Bye;
function RequestStaff: IPowerstaff;

implementation

var
   FAppRunning: Boolean;

procedure TPowerstaff.Writeln(s: pchar);
begin
   System.WriteLn(String(s));
end;

procedure Hello;
begin
   if FAppRunning then WriteLn('Error: Application is already running!');
   FAppRunning := true;
end;

procedure Bye;
begin
   if not FAppRunning then WriteLn('Error: Application isn''t running!');
   FAppRunning := false;
end;

function RequestStaff: IPowerstaff;
begin
   Result := TPowerstaff.Create;
end;

initialization
   FAppRunning := false;
end.

// --------------------------------------

library Cray;

uses CrayLib, CrayInter;

procedure println(s: pchar); deprecated;
begin
   WriteLn(String(s));
end;

exports println, bye name 'cfbye', hello name 'cfhello', RequestStaff name 'reqpow';

end.
Leider wird daraus nichts:
Code:
/usr/bin/ld: CrayLib.o: relocation R_X86_64_32S against `U_CRAYLIB_FAPPRUNNING' can not be used when making a shared object; recompile with -fPIC
Wenn ich alle Zeilen auskommentiere, in denen die Variable benutzt wird, gibt es keine Probleme.

Was kann ich machen?
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 02:22 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz