Pelles C > Feature requests

Library to header correlation...

(1/4) > >>

Anonymous:
Ok, I'm just thinking out loud here, but...

Since there is an obvious correlation between headers and libraries in your C distribution, wouldn't it make sense to put #pragma lib "..." lines in each of your headers?

eg.  in the shellapi.h header add #pragma lib "shell32.lib" so that the correct library is automatically added to the linker's list whenever we include a header.  It would completely eliminate the linker errors related to us forgetting to manually add the libraries (or not being sure which libraries to add) to the linker settings...

Pelle:
I don't have the entire Windows #include file tree at the top of my head, but it can't be an exact 1:1 mapping between include files and libraries (100+ libraries and 300+ include files). Part of the process of producing import libraries (*.lib) is automated, so maybe I can do something in that area... I will look at it.

Not sure how useful it is, but the linker will accept a *.lib file specification (using wildcards) - maybe this feature can be used? I havn't actually tried it (from a project file)...

Pelle

Anonymous:

--- Quote from: "Pelle" ---I don't have the entire Windows #include file tree at the top of my head, but it can't be an exact 1:1 mapping between include files and libraries (100+ libraries and 300+ include files). Part of the process of producing import libraries (*.lib) is automated, so maybe I can do something in that area... I will look at it.

--- End quote ---


As I said I was just thinking out loud... almost wishing.

It sounds like I might be setting you a massive task, and I rather suspect you have a full day already.  

Tell you what... don't do anything on it for a few days... let me look at a couple of ideas and see if I can't solve this one for you, without massive changes to your headers or code.

Pelle:

--- Quote from: "ldblake" ---It sounds like I might be setting you a massive task, and I rather suspect you have a full day already.
--- End quote ---

For the moment, yes. But it's a good idea - it would simplify things.


--- Quote from: "ldblake" ---
Tell you what... don't do anything on it for a few days... let me look at a couple of ideas and see if I can't solve this one for you, without massive changes to your headers or code.
--- End quote ---

OK - thanks.

Pelle

TimoVJL:
First Aid:

You could make include file for example libs.h
and insert known libs to there.

// libs.h
#ifdef _SHELLAPI_H
#pragma lib "shell32.lib"
#endif

Navigation

[0] Message Index

[#] Next page

Go to full version