how to find which libraries to link to? or, how can I create *-config (such as sdl-config, llvm-con

Posted by numeric on Stack Overflow See other posts from Stack Overflow or by numeric
Published on 2010-06-13T23:11:36Z Indexed on 2010/06/13 23:22 UTC
Read the original article Hit count: 163

Hey,

I want to write a program that outputs a list of libraries that I should link to given source code (or object) files (for C or C++ programs).

In *nix, there are useful tools such as sdl-config and llvm-config. But, I want my program to work on Windows, too.

Usage:

get-library-names -l /path/to/lib a.cpp b.cpp c.cpp d.obj

Then, get-library-names would get a list of function names that are invoked from a.cpp, b.cpp, c.cpp, and d.obj. And, it'll search all library files in /path/to/lib directory and list libraries that are needed to link properly.

Is there such tool already written? Is it not trivial to write a such tool? How do you find what libraries you should link to?

Thanks.

© Stack Overflow or respective owner

Related posts about configuration

Related posts about gcc