Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Home NTDEV

Before Posting...

Please check out the Community Guidelines in the Announcements and Administration Category.

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


Build environment

OSR_Community_UserOSR_Community_User Member Posts: 110,217
Ok, I am pretty well to the point where I have thrown my hands up and
shouted %*%&$(%*!! For several ours now I have tried to create a library of
an API that I can use to link different versions of my driver.

I build the library using Visual Studio to compile the source files and then
use LIB to build the library. However when I pass the resulting .lib file to
the build for the driver itself, VS bitches about symbols not found, but the
symbols are there in that lib.

This has got to be doable, and I figure it's something really really simple
...

Comments

  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    From: "Gary Little" <[email protected]>
    Sent: Friday, April 28, 2000 7:13 PM


    > Ok, I am pretty well to the point where I have thrown my hands up and
    > shouted %*%&$(%*!! For several ours now I have tried to create a library
    of
    > an API that I can use to link different versions of my driver.

    Yes, I've often shouted, "What the percent asterisk percent ampersand
    dollar-sign is going on here?!??!", myself. ;-)

    > I build the library using Visual Studio to compile the source files and
    then
    > use LIB to build the library. However when I pass the resulting .lib file
    to
    > the build for the driver itself, VS bitches about symbols not found, but
    the
    > symbols are there in that lib.
    >
    > This has got to be doable, and I figure it's something really really
    simple

    A couple of troubleshooting suggestions:

    First, have you dumped out the symbols in your "client" .obj files and the
    symbols in your .lib and compared them for differences? Perhaps some slight
    variation in compiler settings is causing a mismatch. Calling convention?
    Leading underscores?

    Secondly, assuming the symbols seem to match, are you sure the linker is
    even using your .lib file? I realize you say that you "pass the .lib" to
    the linker, but have you tried that without actually putting the file where
    you told the linker is way?

    For example, if you remove or hide the .lib file, you should receive some
    sort of "file not found" error, right? If you don't, maybe something else
    is wrong that's causing the linker to ignore your library altogether.

    - Matt
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    Thanks Mat. I may have found one problem. The driver was compiling with the
    _stdcall, where as the lib was compiling with _cdecl. At least it got rid of
    the LNK2001 errors. Now I get LNK1229, and guess what!?!?! LNK1229 is NOT
    defined in the help files!!!

    What it says is "commit size greater than reserve size in "/STACK".

    :-(

    -----Original Message-----
    From: Matt A. [mailto:[email protected]]
    Sent: Friday, April 28, 2000 4:53 PM
    To: NT Developers Interest List
    Subject: [ntdev] Re: Build environment

    From: "Gary Little" <[email protected]>
    Sent: Friday, April 28, 2000 7:13 PM


    > Ok, I am pretty well to the point where I have thrown my
    hands up and
    > shouted %*%&$(%*!! For several ours now I have tried to
    create a library
    of
    > an API that I can use to link different versions of my
    driver.

    Yes, I've often shouted, "What the percent asterisk percent
    ampersand
    dollar-sign is going on here?!??!", myself. ;-)

    > I build the library using Visual Studio to compile the
    source files and
    then
    > use LIB to build the library. However when I pass the
    resulting .lib file
    to
    > the build for the driver itself, VS bitches about symbols
    not found, but
    the
    > symbols are there in that lib.
    >
    > This has got to be doable, and I figure it's something
    really really
    simple

    A couple of troubleshooting suggestions:

    First, have you dumped out the symbols in your "client" .obj
    files and the
    symbols in your .lib and compared them for differences?
    Perhaps some slight
    variation in compiler settings is causing a mismatch.
    Calling convention?
    Leading underscores?

    Secondly, assuming the symbols seem to match, are you sure
    the linker is
    even using your .lib file? I realize you say that you "pass
    the .lib" to
    the linker, but have you tried that without actually putting
    the file where
    you told the linker is way?

    For example, if you remove or hide the .lib file, you should
    receive some
    sort of "file not found" error, right? If you don't, maybe
    something else
    is wrong that's causing the linker to ignore your library
    altogether.

    - Matt


    ---
    You are currently subscribed to ntdev as:
    [email protected]
    To unsubscribe send a blank email to
    $subst('Email.Unsub')
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    Oh God! My stupid ... in trying to set the version, I set Reserve and
    commit. <sigh> Now I get "LNK1136: invalid or corrupt file".

    Da' battle continues ...

    -----Original Message-----
    From: Gary Little [mailto:[email protected]]
    Sent: Friday, April 28, 2000 5:25 PM
    To: NT Developers Interest List
    Subject: [ntdev] Re: Build environment

    Thanks Mat. I may have found one problem. The driver was
    compiling with the
    _stdcall, where as the lib was compiling with _cdecl. At
    least it got rid of
    the LNK2001 errors. Now I get LNK1229, and guess what!?!?!
    LNK1229 is NOT
    defined in the help files!!!

    What it says is "commit size greater than reserve size in
    "/STACK".

    :-(

    -----Original Message-----
    From: Matt A. [mailto:[email protected]]
    Sent: Friday, April 28, 2000 4:53 PM
    To: NT Developers Interest List
    Subject: [ntdev] Re: Build
    environment

    From: "Gary Little" <[email protected]>
    Sent: Friday, April 28, 2000 7:13 PM


    > Ok, I am pretty well to the point where I
    have thrown my
    hands up and
    > shouted %*%&$(%*!! For several ours now I
    have tried to
    create a library
    of
    > an API that I can use to link different
    versions of my
    driver.

    Yes, I've often shouted, "What the percent
    asterisk percent
    ampersand
    dollar-sign is going on here?!??!", myself.
    ;-)

    > I build the library using Visual Studio to
    compile the
    source files and
    then
    > use LIB to build the library. However when
    I pass the
    resulting .lib file
    to
    > the build for the driver itself, VS
    bitches about symbols
    not found, but
    the
    > symbols are there in that lib.
    >
    > This has got to be doable, and I figure
    it's something
    really really
    simple

    A couple of troubleshooting suggestions:

    First, have you dumped out the symbols in
    your "client" .obj
    files and the
    symbols in your .lib and compared them for
    differences?
    Perhaps some slight
    variation in compiler settings is causing a
    mismatch.
    Calling convention?
    Leading underscores?

    Secondly, assuming the symbols seem to
    match, are you sure
    the linker is
    even using your .lib file? I realize you
    say that you "pass
    the .lib" to
    the linker, but have you tried that without
    actually putting
    the file where
    you told the linker is way?

    For example, if you remove or hide the .lib
    file, you should
    receive some
    sort of "file not found" error, right? If
    you don't, maybe
    something else
    is wrong that's causing the linker to ignore
    your library
    altogether.

    - Matt


    ---
    You are currently subscribed to ntdev as:
    [email protected]
    To unsubscribe send a blank email to
    $subst('Email.Unsub')

    ---
    You are currently subscribed to ntdev as:
    [email protected]
    To unsubscribe send a blank email to
    $subst('Email.Unsub')
  • Mark_RoddyMark_Roddy Member - All Emails Posts: 4,627
    Uh. perhaps I am missing something obvious here. Have you tried building the
    library using BUILD and a SOURCES file? This works.


    Mark Roddy
    Windows 2000/NT Consultant
    Hollis Technology Solutions
    www.hollistech.com

    -----Original Message-----
    From: [email protected]
    [mailto:[email protected]]On Behalf Of Gary Little
    Sent: Friday, April 28, 2000 8:25 PM
    To: NT Developers Interest List
    Subject: [ntdev] Re: Build environment


    Thanks Mat. I may have found one problem. The driver was compiling with the
    _stdcall, where as the lib was compiling with _cdecl. At least it got rid of
    the LNK2001 errors. Now I get LNK1229, and guess what!?!?! LNK1229 is NOT
    defined in the help files!!!

    What it says is "commit size greater than reserve size in "/STACK".

    :-(

    -----Original Message-----
    From: Matt A. [mailto:[email protected]]
    Sent: Friday, April 28, 2000 4:53 PM
    To: NT Developers Interest List
    Subject: [ntdev] Re: Build environment

    From: "Gary Little" <[email protected]>
    Sent: Friday, April 28, 2000 7:13 PM


    > Ok, I am pretty well to the point where I have thrown my
    hands up and
    > shouted %*%&$(%*!! For several ours now I have tried to
    create a library
    of
    > an API that I can use to link different versions of my
    driver.

    Yes, I've often shouted, "What the percent asterisk percent
    ampersand
    dollar-sign is going on here?!??!", myself. ;-)

    > I build the library using Visual Studio to compile the
    source files and
    then
    > use LIB to build the library. However when I pass the
    resulting .lib file
    to
    > the build for the driver itself, VS bitches about symbols
    not found, but
    the
    > symbols are there in that lib.
    >
    > This has got to be doable, and I figure it's something
    really really
    simple

    A couple of troubleshooting suggestions:

    First, have you dumped out the symbols in your "client" .obj
    files and the
    symbols in your .lib and compared them for differences?
    Perhaps some slight
    variation in compiler settings is causing a mismatch.
    Calling convention?
    Leading underscores?

    Secondly, assuming the symbols seem to match, are you sure
    the linker is
    even using your .lib file? I realize you say that you "pass
    the .lib" to
    the linker, but have you tried that without actually putting
    the file where
    you told the linker is way?

    For example, if you remove or hide the .lib file, you should
    receive some
    sort of "file not found" error, right? If you don't, maybe
    something else
    is wrong that's causing the linker to ignore your library
    altogether.

    - Matt


    ---
    You are currently subscribed to ntdev as:
    [email protected]
    To unsubscribe send a blank email to
    $subst('Email.Unsub')

    ---
    You are currently subscribed to ntdev as: [email protected]
    To unsubscribe send a blank email to $subst('Email.Unsub')
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    No, your not missing anything obvious. My BUILD environment went south last
    week, and I've been trying to recover. Every time I did a BUILD, the source
    files would compile twice, complain about the first object file, compile the
    sources files again and complain about the first object file and quit. No
    obj's were generated and as a consequence no lib or sys files.

    The only thing I can figure that caused this is uninstalling several old
    versions of the SDK and then installing the new Platform SDK. I musta munged
    something in doing the cleanup.

    I pulled my hair out (as rare as that may be) trying to figure that one out
    until today when I said "Fuckit" and decided the best way was to simply
    build a library with our api sources and then link the driver versions with
    that.

    <blush> I finally got that to work (all under Visual Studio) after
    unscrewing several bonehead maneuvers and dumbshit mistakes in setting the
    VS build and link settings.

    Thanks Mat, and Mark for your help.

    -----Original Message-----
    From: Mark Roddy [mailto:[email protected]]
    Sent: Friday, April 28, 2000 5:52 PM
    To: NT Developers Interest List
    Subject: [ntdev] Re: Build environment

    Uh. perhaps I am missing something obvious here. Have you
    tried building the
    library using BUILD and a SOURCES file? This works.


    Mark Roddy
    Windows 2000/NT Consultant
    Hollis Technology Solutions
    www.hollistech.com

    -----Original Message-----
    From: [email protected]
    [mailto:[email protected]]On Behalf Of Gary
    Little
    Sent: Friday, April 28, 2000 8:25 PM
    To: NT Developers Interest List
    Subject: [ntdev] Re: Build environment


    Thanks Mat. I may have found one problem. The driver was
    compiling with the
    _stdcall, where as the lib was compiling with _cdecl. At
    least it got rid of
    the LNK2001 errors. Now I get LNK1229, and guess what!?!?!
    LNK1229 is NOT
    defined in the help files!!!

    What it says is "commit size greater than reserve size in
    "/STACK".

    :-(

    -----Original Message-----
    From: Matt A. [mailto:[email protected]]
    Sent: Friday, April 28, 2000 4:53 PM
    To: NT Developers Interest List
    Subject: [ntdev] Re: Build
    environment

    From: "Gary Little" <[email protected]>
    Sent: Friday, April 28, 2000 7:13 PM


    > Ok, I am pretty well to the point where I
    have thrown my
    hands up and
    > shouted %*%&$(%*!! For several ours now I
    have tried to
    create a library
    of
    > an API that I can use to link different
    versions of my
    driver.

    Yes, I've often shouted, "What the percent
    asterisk percent
    ampersand
    dollar-sign is going on here?!??!", myself.
    ;-)

    > I build the library using Visual Studio to
    compile the
    source files and
    then
    > use LIB to build the library. However when
    I pass the
    resulting .lib file
    to
    > the build for the driver itself, VS
    bitches about symbols
    not found, but
    the
    > symbols are there in that lib.
    >
    > This has got to be doable, and I figure
    it's something
    really really
    simple

    A couple of troubleshooting suggestions:

    First, have you dumped out the symbols in
    your "client" .obj
    files and the
    symbols in your .lib and compared them for
    differences?
    Perhaps some slight
    variation in compiler settings is causing a
    mismatch.
    Calling convention?
    Leading underscores?

    Secondly, assuming the symbols seem to
    match, are you sure
    the linker is
    even using your .lib file? I realize you
    say that you "pass
    the .lib" to
    the linker, but have you tried that without
    actually putting
    the file where
    you told the linker is way?

    For example, if you remove or hide the .lib
    file, you should
    receive some
    sort of "file not found" error, right? If
    you don't, maybe
    something else
    is wrong that's causing the linker to ignore
    your library
    altogether.

    - Matt


    ---
    You are currently subscribed to ntdev as:
    [email protected]
    To unsubscribe send a blank email to
    $subst('Email.Unsub')

    ---
    You are currently subscribed to ntdev as:
    [email protected]
    To unsubscribe send a blank email to
    $subst('Email.Unsub')



    ---
    You are currently subscribed to ntdev as:
    [email protected]
    To unsubscribe send a blank email to
    $subst('Email.Unsub')
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    At 05:25 PM 4/28/00 -0700, you wrote:
    > I may have found one problem. The driver was compiling with the
    >_stdcall, where as the lib was compiling with _cdecl.

    I though everything now used type safe linking, which means a _cdecl
    defined function has a different public name than a _stdcall function. You
    might get unresolved references during linking, but not code linked
    together that will corrupt the stack.

    - Jan
  • OSR_Community_User-35OSR_Community_User-35 Member Posts: 154
    That is what he encountered: link errors due to name mismatches,
    not runtime errors.

    -----------------------------------------------------------------------
    Dave Cox
    Hewlett-Packard Co.
    HPSO/SSMO (Santa Barbara)
    https://ecardfile.com/id/Dave+Cox


    -----Original Message-----
    From: Jan Bottorff [mailto:[email protected]]
    Sent: Friday, April 28, 2000 6:57 PM
    To: NT Developers Interest List
    Subject: [ntdev] Re: Build environment


    At 05:25 PM 4/28/00 -0700, you wrote:
    > I may have found one problem. The driver was compiling with the
    >_stdcall, where as the lib was compiling with _cdecl.

    I though everything now used type safe linking, which means a _cdecl
    defined function has a different public name than a _stdcall function. You
    might get unresolved references during linking, but not code linked
    together that will corrupt the stack.

    - Jan


    ---
    You are currently subscribed to ntdev as: [email protected]
    To unsubscribe send a blank email to $subst('Email.Unsub')
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    > The only thing I can figure that caused this is uninstalling several old
    > versions of the SDK and then installing the new Platform SDK. I musta
    munged
    > something in doing the cleanup.

    Setenv.bat is the only file from SDK needed for NT4 DDK. And IIRC w2k
    DDK does not need SDK at all.
    Do you need a setenv.bat file suitable for NT4 DDK?

    Max
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Internals & Software Drivers 19-23 June 2023 Live, Online
Writing WDF Drivers 10-14 July 2023 Live, Online
Kernel Debugging 16-20 October 2023 Live, Online
Developing Minifilters 13-17 November 2023 Live, Online