Adding link libraries

To determine which library files to link, include link: targets and specify {SimpleLinkList} as the tag in each list. {SimpleLinkList} is a variable specifying a minimal set of libraries that most applications require:

    library JustAViewLib {
    source:
        MyView.C
    
    
    link:
        {SimpleLinkList}        // Minimal set
    }
    
    binary JustAView {
    source:
        Main.C
    
    link:
        JustAViewLib            // The JustAView library created above
        {SimpleLinkList}        // Minimal set
    }
When you build the JustAView project, Makeit lists errors for undefined symbols encountered when MakeSharedLib executes. In the messages, look for errors like these below the MakeSharedLib command line:

      ... MakeSharedLib -o JustAViewLib ...
      ld: 0711-317 ERROR: Undefined symbol: .TGArea::~TGArea()
      ld: 0711-317 ERROR: Undefined symbol: .TRGBColor::~TRGBColor()
      ld: 0711-317 ERROR: Undefined symbol: .TGRect::~TGRect()
      ld: 0711-317 ERROR: Undefined symbol: __vtt12TContentView
      ld: 0711-317 ERROR: Undefined symbol: TTEmplateClass<TClass>::MemberFunction()
NOTE The last line in the listing is an example of what can occur if you are using class templates and trying to reduce the size of your compiled code. For information about eliminating this type of error, see "Reduced compiled code size" on page 70.

Using FindSymbols

To find the library files in which these symbols are defined, use FindSymbols. (The first time you run FindSymbols, it parses all library files and builds a database file so that subsequent lookups execute quickly.) To perform a lookup, run FindSymbols and specify the symbol exactly as it appears in the error listing. The symbol name must be enclosed in single quotes (`).

    FindSymbols `.TGArea::~TGArea()`
Which produces a listing like this:

    TGArea::~TGArea(): HighLevelAlbert This is the unique set of libraries identified: HighLevelAlbert
This listing indicates that the symbol is in HighLevelAlbert. Add that name as the tag in the library's link: target. To look for multiple symbols at once, include each as a separate argument on the FindSymbols command line:

    FindSymbols `.TRGBColor::~TRGBColor()` `.TGRect::~TGRect()` `__vtt12TContentView`
Which produces this listing:

    TRGBColor::~TRGBColor(): LowLevelAlbert TGRect::~TGRect(): CommonAlbert HighLevelAlbert __vtt12TContentView: NewGraphicApplicationLib This is the unique set of libraries identified: CommonAlbert HighLevelAlbert LowLevelAlbert NewGraphicApplicationLib
Notice that TGRect::~TGRect(): appears in CommonAlbert and HighLevelAlbert. When you get multiple libraries, you probably need to include only one. Try one, and if you still get errors for the symbol, try the other. In a worst case, include both. (The example needed only HighLevelAlbert.)

    library JustAViewLib {
    source:
        MyView.C
    
    
    link:
        HighLevelAlbert             // Add
        LowLevelAlbert              // Add
        NewGraphicApplicationLib    // Add
        {SimpleLinkList}
    }
    
    binary JustAView {
    source:
        Main.C
    
    link:
        {SimpleLinkList}
    }
Even if you look up every symbol in the list, you probably won't find enough to build completely, because the libraries might also require other libraries. When you build JustAView again, you get these errors:

    ... MakeSharedLib ... ld: 0711-317 ERROR: Undefined symbol: __vtt5TView ld: 0711-317 ERROR: Undefined symbol: .TView::GetClassMetaInformation() ld: 0711-317 ERROR: Undefined symbol: .TEventSenderSurrogate::GetClassMetaInformation()
Repeat the lookup and *.PinkMake modification until MakeSharedLib doesn't return an error.

Once your build gets past MakeSharedLib without error, you will probably find MakeSharedApp producing similar errors:

      ... MakeSharedLib ...
      ... MakeSharedApp ...
      ld: 0711-317 ERROR: Undefined symbol: TView::virtual-fn-table-ptr-table
      ld: 0711-317 ERROR: Undefined symbol: .TView::GetClassMetaInformation()
      ld: 0711-317 ERROR: Undefined symbol: .TEventSenderSurrogate::GetClassMetaInformation()
      ld: 0711-317 ERROR: Undefined symbol: .TInputDevice::GetClassMetaInformation()
      ld: 0711-317 ERROR: Undefined symbol: .TViewRoot::~TViewRoot()
      ld: 0711-317 ERROR: Undefined symbol: .TViewRoot::TViewRoot(TRequestProcessor*)
      ld: 0711-317 ERROR: Undefined symbol: .TViewRoot::AdoptChild(TView*)
Use FindSymbols again, but this time, add the link: tags to the binary target.

    library JustAViewLib {
    source:
        MyView.C
    
    link:
        ViewSystemLib
        InputLib
        HighLevelAlbert
        LowLevelAlbert
        NewGraphicApplicationLib
        {SimpleLinkList}
    }
    
    binary JustAView {
    source:
        Main.C
    
    
    link:
        ViewSystemLib
        InputLib
        JustAViewLib
        {SimpleLinkList}
    }
Repeat the process until Makeit completes the build.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker