I would like to ask a question, why are not exported static library functions visible to dumpbin?
I have following code of x86 C++ static library (Release) using precompiled headers (Visual Studio 2017):
StaticLibTest.h (tried both mangled names and without):
/*extern "C"*/ __declspec(dllexport) void fnStaticLibTest();
StaticLibTest.cpp
#include "pch.h"
void fnStaticLibTest(){
printf("Static library from another project.\n");
}
pch.h:
#ifndef PCH_H
#define PCH_H
#include <stdio.h>
// add headers that you want to pre-compile here
#include "StaticLibrary.h"
#endif //PCH_H
I apply command of dumpbin (Developer Command Prompt for VS 2017 (also x86)), which should gave me table of exported functions:
dumpbin /SYMBOLS "C:\\pathToLibrary\\StaticLibrary.lib"
This should be right command according to How to See the Contents of Windows library (*.lib)
The output is following (for both mangled and not mangled names):
Microsoft (R) COFF/PE Dumper Version 14.16.27045.0
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file C:\\pathToLibrary\\StaticLibrary.lib
File Type: LIBRARY
If I apply dumpbin \export
to DLL, it works like a charm.
This problem is very important to me, because I am currently solving problem with linking of static libraries.
Regarding your question, the phenomenon is an expected behavior. For detailed reasons, please read this issue carefully.