<div dir="ltr">Whoops, I was only half way through composing that.<div><br></div><div>I hope you don't mind my seeking on expertise here in C library linking.  I've exhausted my search-fu and this is the place people know me.  I hope my question is low level and generic enough that what I learn could be useful later working on opensmalltalk-vm.</div><div><br></div><div>PDFium is a component of Chromium/Chrome for rendering PDFS.  By default it only builds a static library, but I found a configuration option to builds shared library, but it seems it misses some symbols.  Now the object file remain available and I found the required symbol exported from them. For example... </div><div><br></div><div><div>$ nm -A fpdfview.o | grep FPDF_Init</div><div>fpdfview.o:0000000000000000  T   FPDF_InitLibrary</div><div>fpdfview.o:0000000000000000  T   FPDF_InitLibraryWithConfig</div><div>fpdfview.o:0000000000000000   t   FPDF_InitLibraryWithConfig.part.47</div><div><br></div><div><br></div><div>IIUC, the capital "T" means the "FPDF_InitLibrary" symbol is exported and available for another program to link against. Browsing the web, it seems like object files can be composed into a shared library like this...</div><div><br></div><div>$ gcc -fPIC -shared -o libmypdf.so fpdfview.o </div><div><br></div><div><br></div><div>but I end up with the "FPDF_InitLibrary" hidden as an internal symbol...</div><div><br></div><div>$ nm -A libmypdf.so | grep FPDF_Init</div><div>libmypdf.so:0000000000003e60  t   FPDF_InitLibrary</div><div>libmypdf.so:0000000000003e80  t   FPDF_InitLibraryWithConfig</div><div>libmypdf.so:00000000000031f0   t   FPDF_InitLibraryWithConfig.part.47</div><div><br></div><div> so I can't link my test code against it <br></div><div><br></div><div><br></div><div>Here is my makefile...</div><div><br></div><div>INC_DIR= -I ./public</div><div>LIB_DIR= -L ./out</div><div>STD_LIBS= -lpthread -lm -lc -lstdc++</div><div>PDF_LIBS= -lmypdfium</div><div>default:</div><div>        gcc -o test test.c ${INC_DIR} ${LIB_DIR} ${PDF_LIBS} ${STD_LIBS}</div><div><br></div><div>Now I know the library is found, since if I change its name the linker complains it can't find the file.</div><div><br></div><div><br></div><div><br></div><div>I don't think the following adds useful extra info, but for completeness... The header file fpdfview.h has...</div><div><br></div><div>#if defined(_WIN32) && defined(FPDFSDK_EXPORTS)</div><div>// On Windows system, functions are exported in a DLL</div><div>#define FPDF_EXPORT __declspec(dllexport)</div><div>#define FPDF_CALLCONV __stdcall</div><div>#else</div><div>#define FPDF_EXPORT</div><div>#define FPDF_CALLCONV</div><div>#endif</div><div><br></div><div>#ifdef __cplusplus</div><div>extern "C" {</div><div>#endif</div><div><br></div><div>FPDF_EXPORT void FPDF_CALLCONV FPDF_InitLibrary();</div><div><br></div><div>#ifdef __cplusplus</div><div>}</div><div>#endif</div></div><div><br></div><div>cheers -ben</div></div>