PDA

View Full Version : FPC Multi Unit Compilations



code_glitch
18-10-2010, 04:02 PM
A bit of frustration found me again, just a day after my last post... My dilemna is I would like to use Audorra as a starting point for Prometheus_Audio, but it requires haveing around 100 files in the root directory, inconvenient and I the only solution I have seen is to use -Fi and -Fu switches, which rules out default IDE compiling and requires custom build commands. Not newbie-friendly.

My question is how can I tell fpc where to look for the unit files from within the unit? I have succeeded (sort of) where it finds the destination unit but not the other unit's requirements... Ie. PROM_AUDIO -> Unit1 but if Unit1 needs Unit2 it cant find it althouh Unit2 is in the same directory as Unit1...

Is it possible to compile many units into one big .ppu file? if so how. As in, can the Prometheus_Audio.ppu file contain ALL dependancies somehow?

cheers,
code_glitch.

code_glitch
18-10-2010, 04:06 PM
Or alternatively, would someone be willing to submit an FPC version of their audio interface I could use to make Prometheus_Audio?? I've had so many problems and minor issues, its unbelievable. And yes, I tried everything for Noeska's tutorials to no avail. WAV is 100% but no other files seem to work in FPC. And thats a problem.

Andru
18-10-2010, 04:21 PM
My question is how can I tell fpc where to look for the unit files from within the unit?
Without compiler/IDE options only in this way


uses
MyUnit in 'MyUnitDirectory/MyUnit.pas';

code_glitch
18-10-2010, 04:25 PM
I tried that. it finds the target unit but not the targets dependencies. eg.

uses
CustomUnit in 'Prometheus\Audio\CustomUnit.pas';

And it will find it. But if customunit uses bobunit and bobunit is also in the Prometheus\Audio\ folder it will not find it. Hence the problem.

cheers for the response though,
code_glitch

Andru
18-10-2010, 04:31 PM
But if customunit uses bobunit and bobunit is also in the Prometheus\Audio\ folder it will not find it. Hence the problem.
If you want to do something in wrong way you must "go to the end" by fixing all the units. For normal people developers invented special options for compilers... :)

code_glitch
18-10-2010, 04:35 PM
Just wondering if this COULD work.

If I copy Paste ALL the code into one big file and compile it. Could I just link to that mega-unit?

And anyone have an FPC demo program that plays ogg? Sorry to go there again but all example I found for FPC were outdated and use the AL_EXT_VORBIS and the like (which to my understanding are depreciated) and thus dont work. Other than that all I have seen are for Delphi/lazarus. Both of them are alien worlds to me and make no sense... Any help would be soooo apreciated.

User137
18-10-2010, 04:39 PM
the only solution I have seen is to use -Fi and -Fu switches, which rules out default IDE compiling and requires custom build commands. Not newbie-friendly.
-Fu paths are exactly what i have to use with Lazarus libs. It doesn't even work recursively so you have to add each single directory. If you directly program FPC with command line you can say that's million years away from newbie friendly anyway (lol).

Andru
18-10-2010, 04:46 PM
And anyone have an FPC demo program that plays ogg?
I think you will never find the standalone example. But with source code of FreePascal you can find a standard demo. Unpack the archive and go to "src/packages/openal/examples". There are madopenl.pas and Makefile.


Other than that all I have seen are for Delphi/lazarus. Both of them are alien worlds to me and make no sense...
The world would be boring and not interesting without complicated situations, so try to do something by your self. For example - try to understand those examples and translate them to your own code :)

JSoftware
19-10-2010, 05:38 PM
Said in the words of the master "Programming is inherently non-trivial" [Grandmaster Wirth], so live with it. We still have it way better than the competition :D