How to find what functions are in the c / C ++ static library in Visual Studio

I have an application and a static library. The library seems to be built just fine - it will certainly compile my foo and bar and geewhizz as accurately as possible, and create a static library without any errors or warnings.

However, when the application builds and references the static library, it manages to reference the foo and bar functions, but cannot find the geewhizz function. How can I determine if he geewhizz to the library? I do not see any /map option for libraries, for example, for creating applications. And it makes no sense to use the \map parameter when creating the application, because it cannot find my geewhizz function and has no reason to report it.

I work with a mixture of C and C ++, and I suspect that there is probably a problem with the spelling / translation of the function name or a problem with calls causing the problem, so I believe that the list of functions included in the library should be able to shine on this is. But if there are any general recommendations for resolving such issues, I would be glad to hear that.

+6
source share
1 answer

Thanks to the helpful comments from @indiv and @WhozCraig in particular, you have at least these two options:

  • Use the /LIST option in the Visual Studio linker program ( lib.exe )
  • Use the dumpbin utility with the /linkermember option

A visual studio is not entirely useful when using the /LIST option. You should specify it as an additional option on the command line, but how to do this is not clear. /LIST independently outputs the list to standard output, but neither specifying a file nor using the redirection operator > work in an obvious way. In fact, I gave up trying to figure out how to make this option at all.

Fortunately, dumpbin is a utility that ships with Visual Studio (even the Express version) and is well documented here . Therefore, while someone does remote work /LIST ordinary people, use dumpbin .

+6
source

Source: https://habr.com/ru/post/973137/


All Articles