CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 18 of 18
  1. #16
    Join Date
    Mar 2000
    Location
    Oxford, UK.
    Posts
    352

    Re: libraries and linking

    I have cleverly discovered what "link library dependencies" is all about. I think it means "link against project dependencies". Are Microsoft good at misleading people?

  2. #17
    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    3,654

    Re: libraries and linking

    The settings dialog says: Specifies whether or not library outputs from project dependencies are automatically linked in. Could they be more clear than that?
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are, by
    definition, not smart enough to debug it.
    - Brian W. Kernighan

    To enhance your chance's of getting an answer be sure to read
    http://www.codeguru.com/forum/announ...nouncementid=6
    and http://www.codeguru.com/forum/showthread.php?t=366302 before posting

    Refresh your memory on formatting tags here
    http://www.codeguru.com/forum/misc.php?do=bbcode

    Get your free MS compiler here
    https://visualstudio.microsoft.com/vs

  3. #18
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,633

    Re: libraries and linking

    Quote Originally Posted by c94wjpn View Post
    ... you missed the bit that said
    Okay, let's try this other way.

    Code:
    // library B
    void b() { . . . }
    
    // library A
    void a()
    {
        b();
    }
    
    // application P
    int main()
    {
        a();
        return 0;
    }
    In case you build A providing no path to B, the library builds fine leaving symbol b unresolved. Further you build P "against A and only A". Now, how can you expect P to build successfully when the code chain depends on symbol b which still remains unresolved?

    To resolve b, you either let P know about B, or otherwise A must know about B. In the latter case A copies object b to be inside A, and ultimately P copies object b from A. In the former case P should take that copy directly from B. (Actually, this is what my sample was all about )

    Does this description match to your case? If it doesn't, you need to explain the missed details.
    Last edited by Igor Vartanov; April 5th, 2012 at 05:35 PM.
    Best regards,
    Igor

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured