really dumb basic question... making lib.

Hi,

I am doing some experiment in linking a couple of libraries together.

Say, I have 3 libraries as below

  1. Add.lib - pure add function, return the sum of 2 inputs ( a + b )
    Add( a, b )
    { return a+b; }

  2. Mul.lib - using libray Add.lib, return Add() x iteration
    Mul ( a, b )
    {
    for( int i=0;i **C += Add(a,b);
    return c;
    }

  3. Tri.lib - Using Lib Add.lib and Mul.lib, return Add() + Mul().
    Tri ( a, b )
    {
    for( int i=0;i C = Mul( a, Add(a, b) );
    return C;
    }

When I add Add and Mul library it works, but When I try to link 3 libraries in exe or sys the compiler ( linker ) gives that error that it couldn’t find the symbol for 3( error LNK2019: unresolved external symbol xxxxx@8 referenced in function _main ).

Question is that is this kind of recursive lib inclusion allowed ? or is there a way to do ?

Thanks**

Sorry guys,

False alarms. I had a mistake in my header file. It works when I export the function name properly.

Another question is that I know that we use TARGETLIBS to include library. Is there a way to make one library with a bunch of other libraries ? In CE we used SOURCELIBS to make it.

Thanks.

Tty LINKLIBS

d

dent from a phine with no keynoard

-----Original Message-----
From: xxxxx@hotmail.com
Sent: Saturday, March 12, 2011 7:40 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] really dumb basic question… making lib.

Sorry guys,

False alarms. I had a mistake in my header file. It works when I export the function name properly.

Another question is that I know that we use TARGETLIBS to include library. Is there a way to make one library with a bunch of other libraries ? In CE we used SOURCELIBS to make it.

Thanks.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer