View Full Version : Freepascal SVN trunk build problems
When trying to build my library under freepascal 2.1.1 i get the following error:
rpExposedMaterial.pas(20,1) Warning: Use of unsupported feature!
rpExposedMaterial.pas(20,1) Fatal: Syntax error, "BEGIN" expected but "EXPORTS" found
with this code
unit rpExposedMaterial;
interface
uses
libNewtonImport, RageExposedTypes, VectorTypes, VectorGeometry, RagePhysicsHeader;
implementation
procedure rpMaterialSetContactTangentDirection(aMaterial: PrpMaterial; aDirection: TVector3f); stdcall;
begin
NewtonMaterialContactRotateTangentDirections(PNewt onMaterial(aMaterial), @aDirection[0]);
end;
procedure rpMaterialSetContactTangentAcceleration(aMaterial: PrpMaterial; aAcceleration: Single; aIndex: Integer); stdcall;
begin
NewtonMaterialSetContactTangentAcceleration(PNewto nMaterial(aMaterial), aAcceleration, aIndex);
end;
exports
rpMaterialSetContactTangentDirection, rpMaterialSetContactTangentAcceleration;
end.
Surely creating libraries isnt unsupported?
paul_nicholls
14-07-2006, 10:42 PM
When trying to build my library under freepascal 2.1.1 i get the following error:
rpExposedMaterial.pas(20,1) Warning: Use of unsupported feature!
rpExposedMaterial.pas(20,1) Fatal: Syntax error, "BEGIN" expected but "EXPORTS" found
with this code
unit rpExposedMaterial;
interface
uses
libNewtonImport, RageExposedTypes, VectorTypes, VectorGeometry, RagePhysicsHeader;
implementation
procedure rpMaterialSetContactTangentDirection(aMaterial: PrpMaterial; aDirection: TVector3f); stdcall;
begin
NewtonMaterialContactRotateTangentDirections(PNewt onMaterial(aMaterial), @aDirection[0]);
end;
procedure rpMaterialSetContactTangentAcceleration(aMaterial: PrpMaterial; aAcceleration: Single; aIndex: Integer); stdcall;
begin
NewtonMaterialSetContactTangentAcceleration(PNewto nMaterial(aMaterial), aAcceleration, aIndex);
end;
exports
rpMaterialSetContactTangentDirection, rpMaterialSetContactTangentAcceleration;
end.
Surely creating libraries isnt unsupported?
When you are using stdcall and Exports, I assume you are trying to write a DLL :-)
Here is an example of creating a DLL (at least under Delphi)
library MinMax;
function Min(X, Y: Integer): Integer; stdcall;
begin
if X < Y then Min := X else Min := Y;
end;
function Max(X, Y: Integer): Integer; stdcall;
begin
if X > Y then Max := X else Max := Y;
end;
exports
Min,
Max;
begin
end.
I believe you should be using Library instead of Unit and you forgot the Begin right before the final End.
I hope this helps,
Paul.
sorry, this is a unit. the main library file has a uses that links to the export units.
so stdcall and exports is only for windows? what about osx?
dmantione
15-07-2006, 01:13 PM
A unit cannot contain an exports section. Afaik you can export procedures inside units from the library file.
hmm. delphi copes fine...
the dpr contains the uses to the export units and the units contain the procedures / exports. makes it easier to update across multiple platforms (just update the uses instead of the uses and exports)
and aparently my code compiles fine with lazarus in windows
So i fixed all the code problems but FPC still doesnt want to build my project.
this is the output from xterm
TCompiler.Compile WorkingDir="/Users/jon/Documents/Development/Rage-Engine/Rage3D/Exposed/RagePhysicsLib/" CompilerFilename="/usr/local/bin/ppc386" CompilerParams=" -S2cdgi -O2 -TDarwin -Pi386 -gl -vewnhi -l -Fu../../RagePhysics/ -Fu../../Library/ -Fu../../RagePhysics/Joints/ -Fu../../RagePhysics/Libraries/ -Fu../ -Fu. -FU../../DCU/ -o../../DCU/RagePhysics.dylib RagePhysics.dpr"
[TCompiler.Compile] CmdLine="/usr/local/bin/ppc386 -S2cdgi -O2 -TDarwin -Pi386 -gl -vewnhi -l -Fu../../RagePhysics/ -Fu../../Library/ -Fu../../RagePhysics/Joints/ -Fu../../RagePhysics/Libraries/ -Fu../ -Fu. -FU../../DCU/ -o../../DCU/RagePhysics.dylib RagePhysics.dpr"
Hint: Start of reading config file /etc/fpc.cfg
Hint: End of reading config file /etc/fpc.cfg
Free Pascal Compiler version 2.1.1 [2006/07/14] for i386
Copyright (c) 1993-2006 by Florian Klaempfl
Target OS: Darwin for i386
Compiling RagePhysics.dpr
RagePhysics.dpr(4,50) Hint: Unit "RagePhysicsHeader" not used in RagePhysics
RagePhysics.dpr(5,45) Hint: Unit "rpWorld" not used in RagePhysics
RagePhysics.dpr(6,43) Hint: Unit "rpBody" not used in RagePhysics
RagePhysics.dpr(7,60) Hint: Unit "rpJointBase" not used in RagePhysics
RagePhysics.dpr(8,62) Hint: Unit "rpJointHinge" not used in RagePhysics
RagePhysics.dpr(14,49) Hint: Unit "rpVehicle" not used in RagePhysics
RagePhysics.dpr(16,53) Hint: Unit "rpCallbacks" not used in RagePhysics
RagePhysics.dpr(17,68) Hint: Unit "rpJointUpVector" not used in RagePhysics
RagePhysics.dpr(18,71) Hint: Unit "libNewtonImport" not used in RagePhysics
RagePhysics.dpr(19,48) Hint: Unit "RageExposedTypes" not used in RagePhysics
RagePhysics.dpr(20,38) Hint: Unit "VectorTypes" not used in RagePhysics
RagePhysics.dpr(22,47) Hint: Unit "rpJoints" not used in RagePhysics
Assembling ragephysics
Linking ../../DCU/libRagePhysics.dylib
/usr/bin/libtool: can't locate file for: -lX11
/usr/bin/libtool: file: -lX11 is not an object file (not allowed in a library)
Error: Error while linking
any ideas? if your interested the project is RagePhysicsLibOSX.lpi at http://rage-engine.cvs.sourceforge.net/rage-engine/Rage3D/Exposed/RagePhysicsLib/
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.