Newbie: How to use a compiled unit (*.ppu & *.o) lazarus / 9-Editor ---------------------------------------------------------------------- br4d · 2006-09-30 01:37 Hi, we have two teams at our school. The first has programmed some core units to access a postgres database. The second team is trying now to include the result of the first team. From the first team we can only get their compiled units, not the *.pas unit. Lazarus can compile and run the project, but code completion (CTRL+Space) doesn't work and gives the message like 'can't find TSys]"]>Blockedser'. Sorry, if we haven't understood the package principles for FPC. We appreciate any help, Bernadino Rad ---------------------------------------------------------------------- felipemdc · 2006-09-30 02:57 The algorithm to do code completion looks for the source files to do it, so it won´t  work without them. There are reasons why this works like this. For example, code completion works even if no units are compiled, a common scenario, in oposition to when you onlu have the compiled files, a uncommon scenarion. If the second team se good enougth documentation of the unit, they should be able to do their work without code completion. ---------------------------------------------------------------------- Marc · 2006-09-30 12:08 Just a gueass, You could give the secon team only the "headers" of the units, the units without implementation. In the future, laz may be able to scan ppus when no source is found. ---------------------------------------------------------------------- br4d · 2006-10-02 05:14 Many thanks for your immediate answers. But sorry again to bother you with newbie questions: Marc: How can I create a 'header' file (I assume it is like .h in c). Should I use abstract method declarations --> and remove the used units before compilation? . ---------------------------------------------------------------------- Marc · 2006-10-02 09:25 I wasn't thinking in that direction. More like: TeamA builds their units with complete source and passes the .ppu .o and the stripped version of the sources to TeamB. It is not really a header file (pascal doesn't know such thing), but my guess is that it is enough for the codetools to support code completion (and you don't show the implementation to TeamB) ---------------------------------------------------------------------- CCRDude · 2006-10-02 10:04 But wouldn't a source file attempt the compiler to try to compile it, and since it's stripped, fail directly, which wouldn't happen with just .ppu/.o? Abstracts sound like a much better idea in general, but I wouldn't know if the code tools would recognize that the class from the .ppu is based on the abstract base class that could be shared? ---------------------------------------------------------------------- Marc · 2006-10-03 11:46 don't put the "headers" in the (compuler) source path, only in the (codetools) browse path. ---------------------------------------------------------------------- br4d · 2006-10-09 09:05 Thanks everyone, we have decided to release the encapsulation and give the second team all source code. ---------------------------------------------------------------------- Danail · 2006-10-09 13:11 How about using DLLs? The firs team can compile the unit as DLL and the second team to use the ready DLL... maybe this can help... ---------------------------------------------------------------------- Marc · 2006-10-09 15:59 You cannot pass classes, strings or dynarrays to dlls, so it will limit your functionality