Re: Using other projects
From: Victor Bazarov (v.Abazarov_at_comAcast.net)
Date: 05/14/04
- Previous message: Josh Dahlby: "Using other projects"
- In reply to: Josh Dahlby: "Using other projects"
- Next in thread: Josh Dahlby: "Re: Using other projects"
- Reply: Josh Dahlby: "Re: Using other projects"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 14 May 2004 13:26:37 -0400
Josh Dahlby wrote:
> Two questions, using VC 6.0 if that matters:
>
> 1. Is there any way to use another .dsw in your project? Say that
> abc.dsw defines a project with all the dependencies setup correctly,
> etc. Now, say that xyz.dsw needs to use the library that abc.dsw
> builds. Is there anyway that I can set that up to build within the
> IDE without having to redefine everything that abc.dsw has setup in
> xyz.dsw? I know you can build the abc.dsw then just link to the .lib,
> but I'd like to be able to have abc build when I build xyz.
A Workspace defines dependencies. Dependencies are between Projects.
Projects are single-level subordinates of a Workspace. Workspaces cannot
depend on other workspaces. Does that answer your question?
> 2. Is there a way to specify that a static libary uses other .libs so
> that when I have a dependency on that library it will automatically
> include those .libs?
Static libraries don't use other libs. Strictly speaking, code may
reference some external symbol, but where the symbol comes from is not
necessarily known until the link time (and libs are not linked by
themselves, only exe's are linked). That said, see below.
> Currently if I have abc.lib and it uses def.lib,
No, it does not. You only think it does because you tell your linker to
use 'def.lib' for all unresolved symbols referred to in 'abc.lib'. That
means 'abc.lib' doesn't know about 'def.lib' ahead of time.
> I have to add both abc.lib and def.lib to a project that only uses the
> abc.lib interfaces. I'd rather specify that abc.lib uses def.lib and
> when I build something that uses abc.lib it knows to also use def.lib.
There is one mechanism in Microsoft language[s] that I know of that allows
to tell where to attempt to resolve some symbols before linking happens.
It's achieved in C++ by means of "#pragma comment". Add
#pragma comment(lib, "def.lib")
in every source file in 'abc.lib' that needs functions from 'def.lib'.
See documentation for more information.
Victor
- Previous message: Josh Dahlby: "Using other projects"
- In reply to: Josh Dahlby: "Using other projects"
- Next in thread: Josh Dahlby: "Re: Using other projects"
- Reply: Josh Dahlby: "Re: Using other projects"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|