Transitive dependencies in VC6 
Author Message
 Transitive dependencies in VC6

Hi,

Imagine you have 10 executables, each linking a static
library "L1."  Now, lets say I have to add something to
"L1" which requires another library "L2."

It would be really cool if I could simply make L2 a
dependency of L1 so that all 10 of my apps don't need
to be futzed with.

It seems like there must be a way to do this, but I
haven't been able to cast the correct spell.  I know
about the #pragma trick which inserts comment objects
into the objs to tell the linker to link a library, but
that's inconvenient when there are multiple configurations
being built.

In general, the whole notion of workspaces, projects and
dependencies is a bit shakey, IMHO.

thoughts?

marco



Wed, 26 Feb 2003 23:56:03 GMT  
 Transitive dependencies in VC6
Open a Workspace that has multiple projects.  Then select Project ->
Dependencies.

Otherwise, use a common header file.  If the common header is edited, VC
will see its out of date.



Hi,

Imagine you have 10 executables, each linking a static
library "L1."  Now, lets say I have to add something to
"L1" which requires another library "L2."

It would be really cool if I could simply make L2 a
dependency of L1 so that all 10 of my apps don't need
to be futzed with.

It seems like there must be a way to do this, but I
haven't been able to cast the correct spell.  I know
about the #pragma trick which inserts comment objects
into the objs to tell the linker to link a library, but
that's inconvenient when there are multiple configurations
being built.

In general, the whole notion of workspaces, projects and
dependencies is a bit shakey, IMHO.

thoughts?

marco



Thu, 27 Feb 2003 07:26:14 GMT  
 Transitive dependencies in VC6


Quote:
> Open a Workspace that has multiple projects.  Then select Project ->
> Dependencies.

> Otherwise, use a common header file.  If the common header is edited, VC
> will see its out of date.

Hmmm.  Lets say "App" has a dependency called "Lib1" if I add a
library and make it a dependency of Lib1, "App" will no longer
link.  I need to make the new lib a dependency of App... not
quite what I wanted.  Unless I'm not going about this the
right way.

marco



Thu, 27 Feb 2003 08:52:59 GMT  
 Transitive dependencies in VC6
Hey Marco,

Are you authoring the static libraries?

The place I've added additional libraries (for example, netapi32.lib) is
under Project -> Settings -> Link Tab.  The extra libs can be entered under
Object\Library modules when selecting All Configurations.

Jeff




Quote:
> Open a Workspace that has multiple projects.  Then select Project ->
> Dependencies.

> Otherwise, use a common header file.  If the common header is edited, VC
> will see its out of date.

Hmmm.  Lets say "App" has a dependency called "Lib1" if I add a
library and make it a dependency of Lib1, "App" will no longer
link.  I need to make the new lib a dependency of App... not
quite what I wanted.  Unless I'm not going about this the
right way.

marco



Thu, 27 Feb 2003 09:18:18 GMT  
 Transitive dependencies in VC6


Quote:
> Hey Marco,

> Are you authoring the static libraries?

Yes.

Quote:

> The place I've added additional libraries (for example, netapi32.lib)
> is under Project -> Settings -> Link Tab.  The extra libs can be
> entered under Object\Library modules when selecting All
> Configurations.

Except I want my debug lib to be linked with the debug executable.
And, I want the fact that if I change a file in the new library,
the app will get relinked when I say build.

I think the problem is that the dependency structure is part
of the workspace and not of the projects.  Is this true?
If I say Lib2 is a dependency of Lib1 in a particular
workspace, will the same dependency show up when I make
Lib1 a part of another workspace?

My intuition is that in this particular case I'm not using
the tool the way it was intended.

Maybe VC7 will be more "Marco Oriented"... I can dream
can't I?

Thanks for the suggestions.

Tripping over my virtual feet,

marco



Thu, 27 Feb 2003 09:56:14 GMT  
 Transitive dependencies in VC6
I think I see now.  Forgive my ignorance.

I've never tackled this one.  I created a project named DependTest (EXE).
It depends on FirstDll and SecondDll (DLL).  I exported my makefile.
LINK32_OBJS in the makefile looks as below:

LINK32_OBJS= \
"$(INTDIR)\DependTest.obj" \
"$(INTDIR)\StdAfx.obj" \
".\FirstDll\Debug\FirstDll.lib" \
".\SecondDll\Debug\SecondDll.lib"

Additionally, I made FirstDll depend on SecondDll (exercising a somewhat
circular dependency):

LINK32_OBJS= \
"$(INTDIR)\StdAfx.obj" \
"$(INTDIR)\FirstDll.obj" \
"..\SecondDll\Release\SecondDll.lib"

It seems Visual Studio is picking up the proper dependencies for my small
sample.  Also, I looked at the Workspace (dsw file).  Here's what it looks
like in Wordpad:

Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
############################################################################
###
Project: "DependTest"=".\DependTest.dsp" - Package Owner=<4>
Package=<5>
{{{

Quote:
}}}

Package=<4>
{{{
Quote:
}}}

############################################################################
###
Project: "FirstDll"=".\FirstDll\FirstDll.dsp" - Package Owner=<4>
Package=<5>
{{{
Quote:
}}}

Package=<4>
{{{
Quote:
}}}

############################################################################
###
Project: "SecondDll"=".\SecondDll\SecondDll.dsp" - Package Owner=<4>
Package=<5>
{{{
Quote:
}}}

Package=<4>
{{{
Quote:
}}}

############################################################################
###
Global:
Package=<5>
{{{
Quote:
}}}

Package=<3>
{{{
Quote:
}}}

############################################################################
###

My Workspace looks as follows:

DependTest WorkSpace (DSW)
    |- DependTest EXE (DSP)
    |- FirstDll (DSP)
    |- SecondDll (DSP)

I don't think this will work (which is what you might have - separate
WorkSpaces):

DependTest WorkSpace (DSW)
    |- DependTest EXE (DSP)
    |- FirstDll (DSP)

SecondDll WorkSpace (DSW)
    |- SecondDll (DSP)

All project files should be under the same EXE workspace.  You might be able
to get the latter to work if you add Custom Build Steps to the projects, but
I'm not very familiar with using it (Project -> Setting -> Custom Build
Tab).

Hope it Helps,
Jeff




Quote:
> Hey Marco,

> Are you authoring the static libraries?

Yes.

Quote:

> The place I've added additional libraries (for example, netapi32.lib)
> is under Project -> Settings -> Link Tab.  The extra libs can be
> entered under Object\Library modules when selecting All
> Configurations.

Except I want my debug lib to be linked with the debug executable.
And, I want the fact that if I change a file in the new library,
the app will get relinked when I say build.

I think the problem is that the dependency structure is part
of the workspace and not of the projects.  Is this true?
If I say Lib2 is a dependency of Lib1 in a particular
workspace, will the same dependency show up when I make
Lib1 a part of another workspace?

My intuition is that in this particular case I'm not using
the tool the way it was intended.

Maybe VC7 will be more "Marco Oriented"... I can dream
can't I?

Thanks for the suggestions.

Tripping over my virtual feet,

marco



Thu, 27 Feb 2003 10:57:48 GMT  
 Transitive dependencies in VC6


Quote:
> My Workspace looks as follows:

> DependTest WorkSpace (DSW)
>     |- DependTest EXE (DSP)
>     |- FirstDll (DSP)
>     |- SecondDll (DSP)

> I don't think this will work (which is what you might have - separate
> WorkSpaces):

Yup.  I have separate workspaces.  In essense, I have this
collection of libraries which I can piece to gether into
a tool.  Pain 1: writing a new tool, I have to manually
go through and add about 20 projects.  Pain 2: adding
a new library means I need to go to *every* workspace
and add it.

I had considered putting everything in one workspace,
but that just didn't seem right.

Thanks for the help,
marco



Fri, 28 Feb 2003 00:02:48 GMT  
 Transitive dependencies in VC6

Quote:
> Imagine you have 10 executables, each linking a static
> library "L1."  Now, lets say I have to add something to
> "L1" which requires another library "L2."
> It would be really cool if I could simply make L2 a
> dependency of L1 so that all 10 of my apps don't need
> to be futzed with.

By 'futzed with', do you mean that you don't want to have to relink
all your applications, or that you don't want to have to keep going
through the tedious process of opening each of ten workspaces to
rebuild after making changes to L1 / L2?

If the first case, you'd have to do some thoughtful designing of the
libraries, making them dynamic with interfaces such that L1 retains
a stable linkage, forwards calls through into L2, and is itself
recompiled when L2 is changed.

If the second...  I've got a product, a system of applications, that
we've been porting from UNIX - something like fif{*filter*} applications,
twenty or thirty libraries that the applications link to.  The person
before me put everything into one workspace as a bunch of projects.
Ugly, because there was no way to rebuild everything - in fact, turned
out there were some directories, executables, that had never been
compiled and built.

What I did to facilitate rebuilds was to add a brand new project,
a 'Utility Project' I think, named it 'AFullBuild' in order to have
it show up at the top of the workspace view, and added all the other
projects as dependencies.  Now, when I need to relink everything, or
want to kick off a complete rebuild, I select the AFullBuild as the
active project and  do a Build / Rebuild All.

Quote:
> In general, the whole notion of workspaces, projects and
> dependencies is a bit shakey, IMHO.

Shakey?  I'd say retarded, myself, or crippled.  M$ doesn't even have
the internal consistency to allow you to see the type of a project by
displaying the different icons used in the New/Project dialog, nor do
they allow you to find out via the Properties.  Their{*filter*}poor design
means that developers have to resort to such kludges as I describe
above.  Ah well.

--
-- Chase Vogelsberg, Senior Principal Analyst
-- Logicon Information Systems & Services
-- Wormwood and wine, and the bitter taste of ashes.



Sat, 01 Mar 2003 22:52:32 GMT  
 Transitive dependencies in VC6


Quote:

> > Imagine you have 10 executables, each linking a static
> > library "L1."  Now, lets say I have to add something to
> > "L1" which requires another library "L2."

> > It would be really cool if I could simply make L2 a
> > dependency of L1 so that all 10 of my apps don't need
> > to be futzed with.

> By 'futzed with', do you mean that you don't want to have to relink
> all your applications, or that you don't want to have to keep going
> through the tedious process of opening each of ten workspaces to
> rebuild after making changes to L1 / L2?

> If the second...

Yup.  But not only rebuilding, but going through all the
workspaces to add L2 as a dependency.

[building everything snipped]

Building everything isn't a problem as I've written
some scripts to do that... old habits die hard.

thanks,
marco



Sun, 02 Mar 2003 03:00:00 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Update Dependencies in VC6????

2. VC6-SP3 Dependencies

3. Dependencies in VC6

4. Update Dependencies in VC6?

5. Is it possible to convert my German VC6.0 to an English VC6.0

6. Add "External Dependencies" to VC7's solution explorer as seen in VC6

7. VC6: Help! Bogus Dependencies!

8. circular dependency using C# DLLs

9. error: dependency cannot copied to run directory

10. Resource.h and dependencies

11. VS.NET 2003 linker dependencies bug

12. VS.NET 2003 file dependencies problem.

 

 
Powered by phpBB® Forum Software