Author Topic: How to associate headers with libraries  (Read 6881 times)

Storkman

  • Guest
How to associate headers with libraries
« on: December 10, 2005, 11:32:21 pm »
Good evening...

I"m trying to compile some PSDK samples; and I had the hardest time figuring out which libraries I need to link to.  Going through the platform SDK docs could take a while.  Is there a list somewhere that associates the header file with the library that needs to be linked to?  I'm using the Visual C++ Toolkit 2003, but I suppose the question would arise for any compiler.

Thanks.

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: How to associate headers with libraries
« Reply #1 on: December 11, 2005, 12:12:01 am »
Hello,

May be the Code::Blocks SDK Reference Manual for 1.0 RC2 WIP (http://forums.codeblocks.org/index.php?topic=1358.0) could be of some help.

Michael
 

takeshimiya

  • Guest
Re: How to associate headers with libraries
« Reply #2 on: December 11, 2005, 05:44:34 am »
Are you talking about MS Platform SDK or C::B SDK?
What do you want to compile?

Offline Vampyre_Dark

  • Regular
  • ***
  • Posts: 255
  • Hello!
    • Somewhere Over The Rainbow...
Re: How to associate headers with libraries
« Reply #3 on: December 11, 2005, 05:49:15 am »
Good evening...

I"m trying to compile some PSDK samples; and I had the hardest time figuring out which libraries I need to link to.  Going through the platform SDK docs could take a while.  Is there a list somewhere that associates the header file with the library that needs to be linked to?  I'm using the Visual C++ Toolkit 2003, but I suppose the question would arise for any compiler.
I think they all match up. mmsystem.h into mmsystem.lib and etc... If not, it's very easy to see just by browsing and seeing the matching names, like ~cmctrl.h ~cmctrlxx.lib for the common controls.
C::B Wishlist
~BOYCOTT THE EVIL YELLOW BOXES~

Storkman

  • Guest
Re: How to associate headers with libraries
« Reply #4 on: December 11, 2005, 06:57:55 pm »
I think they all match up.

Good afternoon...

Not exactly.  I mean some do, 1:1.  Others are pretty close, like commctrl.h to comctl32.lib.  But when headers are nested, i.e.: including windows.h includes winuser.h wihich is assoicated with user32.lib.  It's especially the last case that is troublesome.

Offline Urxae

  • Regular
  • ***
  • Posts: 376
Re: How to associate headers with libraries
« Reply #5 on: December 11, 2005, 07:26:40 pm »
How about this: don't bother with libraries until you get a link error, then you look at http://www.google.com/search?q=site%3Amsdn.microsoft.com%20SOME_NAME, with SOME_NAME replaced by whatever symbol you got the error on. (Might want to strip any 'A' or 'W' at the end off though)
I think MSDN lists for every function in the PSDK what library is required... At least, I've never had any problems doing this and I don't even use MSVC :D.

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: How to associate headers with libraries
« Reply #6 on: December 11, 2005, 07:33:24 pm »
there is a thread regarding this in another forum, where they try to automate this task
http://smorgasbordet.com/phpBB2/viewtopic.php?t=391&highlight=hdr2lib

there you can download a list (csv file) of matching headers <==> libraries

but personally i find it convenient to have a look at http://msdn.microsoft.com (or your local installed PSDK )
to resolve linker errors.

Storkman

  • Guest
Re: How to associate headers with libraries
« Reply #7 on: December 12, 2005, 04:55:53 pm »
there is a thread regarding this in another forum, where they try to automate this task
http://smorgasbordet.com/phpBB2/viewtopic.php?t=391&highlight=hdr2lib

wow!  there's so much cool stuff on the net.  thanks for pointing this one out to me.

there you can download a list (csv file) of matching headers <==> libraries

i haven't found the link to the download yet, but i'll try again later when i have more time to really read through the whole posting.

but personally i find it convenient to have a look at http://msdn.microsoft.com (or your local installed PSDK )
to resolve linker errors.

yeah, i can see when developing my own stuff i'll have the PSDK docs open and i'll naturally just include, add the lib, then use the function/class/whatever...  but when trying to setup an environment to compile someone else's code, who either did not provide a projet or like in this case where no project exists for C::B it'd be handy to have a quick-ref table. 

if i come up with anything i'll post it - somewhere in the neighborhood.