BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Simple Library Question

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Deployment
View previous topic :: View next topic  
Author Message
Jeff W.
Guest





PostPosted: Wed Apr 12, 2006 12:03 am    Post subject: Simple Library Question Reply with quote



Co-worker and I have spent a day trying to solve what should be a simple
problem.

In Delphi 7, we have various applications and reusable units. The number
and complexity of these are increasing to the point that when we "use" a
unit from another project, the compiler keeps demanding more "missing"
units -- a slow

We want to bundle collections of these units into static libraries that we
can link into new applications. We don't want or need dynamic DLLs, just
simple, old fashioned libraries we can easily link against so the compiler
can immediately recognize a collection of utility functions -- old school
technology.

This seems like it should be easy, but Delphi Help, Delphi books and Google
aren't getting us very far.

Can someone suggest a website, article, book or anything that would put us
on the right path? We'd be extremely grateful.

Thanks.

Jeff
Back to top
Rob Kennedy
Guest





PostPosted: Wed Apr 12, 2006 12:03 am    Post subject: Re: Simple Library Question Reply with quote



Jeff W. wrote:
Quote:
Co-worker and I have spent a day trying to solve what should be a simple
problem.

In Delphi 7, we have various applications and reusable units. The number
and complexity of these are increasing to the point that when we "use" a
unit from another project, the compiler keeps demanding more "missing"
units -- a slow

We want to bundle collections of these units into static libraries that we
can link into new applications. We don't want or need dynamic DLLs, just
simple, old fashioned libraries we can easily link against so the compiler
can immediately recognize a collection of utility functions -- old school
technology.

This seems like it should be easy, but Delphi Help, Delphi books and Google
aren't getting us very far.

Can someone suggest a website, article, book or anything that would put us
on the right path? We'd be extremely grateful.

Take all the related units and put them in their own directory. Wrap
them up into a package.

Do not add those units to your other projects. Use them, of course, but
don't let them actually _belong_ to any project other than the single
package.

Set the package's "DCU output" directory to a common folder. Make sure
it's separate from any folder where you keep source files. Now add that
DCU folder to your EXE projects' "search" directories. By doing this,
you ensure that when you compile your projects, the compiler doesn't
somehow manage to recompile the library code when it's not supposed to.
The compiler won't recompile units it can't find the source for, and if
the DCUs are separate from the source code, then you won't need to
mention the source folder in the search path.

You don't need to *use* run-time packages in your other projects. Having
all your files in a package simply makes it easy to manage your library
in the IDE. You can add the library package to a project group to
quickly switch from your EXE to the library in case you need to make
changes to it.

Having the package scheme also lets you make sure that all your library
code really is separate -- that it doesn't have unexpected dependencies.
When you compile the package, the compiler will issue warnings if the
package ends up needing any units that aren't explicitly listed as part
of the package. When it does that, you can collect the missing units and
transfer them to the package. If they're already part of some other
package, then instead of moving the units to the new package, add the
previous package to the new package's "requires" section.

--
Rob
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Deployment All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.