Re: Using other projects

From: Victor Bazarov (v.Abazarov_at_comAcast.net)
Date: 05/14/04

  • Next message: Josh Dahlby: "Re: Using other projects"
    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


  • Next message: Josh Dahlby: "Re: Using other projects"

    Relevant Pages

    • Re: Good math/stats libraries for Ruby?
      ... I'm not sure of the best overall scheme for structuring dependencies ... current ruby math libraries are gems. ... I don't mean to say that Python is crummy like ... It doesn't seem like basic scientific and math libraries ...
      (comp.lang.ruby)
    • Re: Dependencies
      ... ports files written by the port maintainers. ... because these dependencies are frequently over strict. ... Apparently there are cases were the version numbers of the libraries are ...
      (comp.unix.bsd.freebsd.misc)
    • Re: OpenGL extensions in Linux (Its not hard?)
      ... Try the binary on other Linux machines and it breaks about 10% ... No, only those libraries, that your programm accesses directly. ... yourself, making sure, that only minimal dependencies, that are ... The engine I'm developing shares the 90% of the ...
      (comp.graphics.api.opengl)
    • LNK1000
      ... Internal error during Pass2" during linking of an EXE ... list of dependencies for each of the static libraries. ... This causes LNK4006 warnings for me because two of my libs pull ...
      (microsoft.public.vsnet.ide)
    • Re: binary execution
      ... [Assembly Binding Log Viewer ] ... Try to avoid exotic libraries and try to ... or make sure your installer ... dependencies have been resolved. ...
      (microsoft.public.dotnet.languages.vc)