![]() |
[GNU/Linux, FPC] Linkerproblem bei SO's
Guten Morgen,
ich habe meine Testbibliothek aus ![]()
Delphi-Quellcode:
Leider wird daraus nichts:
{$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.
Code:
Wenn ich alle Zeilen auskommentiere, in denen die Variable benutzt wird, gibt es keine Probleme.
/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
Was kann ich machen? |
AW: [GNU/Linux, FPC] Linkerproblem bei SO's
Zitat:
Ohne zu wissen, was dann passiert: Hast du das mal probiert? PS: ![]() |
AW: [GNU/Linux, FPC] Linkerproblem bei SO's
Das Flag ist aber für gcc, beim FPC bringt das nichts.
|
AW: [GNU/Linux, FPC] Linkerproblem bei SO's
hilft das weiter?
![]() ![]() ansonsten würd ich an deiner Stelle mal in der FPC Mailinglist fragen |
AW: [GNU/Linux, FPC] Linkerproblem bei SO's
PIC == Position Independent Code
Im Windows-Jargon heißt das "relozierbar". Ob es nun in FPC eine Option dazu gibt, weiß ich nicht. |
AW: [GNU/Linux, FPC] Linkerproblem bei SO's
Zitat:
Code:
Und ja, der Schalter funktioniert.
[sven@artemis ~]$ fpc -h | grep -i pic
-Cg Generate PIC code -fPIC Same as -Cg Gruß, Sven |
AW: [GNU/Linux, FPC] Linkerproblem bei SO's
Es läuft!
Vielen Dank :thumb: |
Alle Zeitangaben in WEZ +1. Es ist jetzt 02:39 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