<div dir="ltr">Thanks Nicolas.  I'm not quite there yet, but that has set me down a promising path.<div><br><div>cheers -ben<br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 7, 2017 at 2:33 AM, Nicolas Cellier <span dir="ltr"><<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br><div dir="ltr">And maybe another good hit<br><a href="https://www.gnu.org/software/gnulib/manual/html_node/Exported-Symbols-of-Shared-Libraries.html" target="_blank">https://www.gnu.org/software/<wbr>gnulib/manual/html_node/<wbr>Exported-Symbols-of-Shared-<wbr>Libraries.html</a><br></div><div class="gmail_extra"><br><div class="gmail_quote">2017-11-06 19:29 GMT+01:00 Nicolas Cellier <span dir="ltr"><<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@<wbr>gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Maybe google gcc export all symbols<br></div>a workaround would be -Wl,--export-all-symbols  or something like that...<br></div>I find the end of <a href="http://anadoxin.org/blog/control-over-symbol-exports-in-gcc.html" target="_blank">http://anadoxin.org/blog/contr<wbr>ol-over-symbol-exports-in-gcc.<wbr>html</a> interesting though it's the inverse problem<br></div><div class="gmail_extra"><br><div class="gmail_quote">2017-11-06 19:08 GMT+01:00 Ben Coman <span dir="ltr"><<a href="mailto:btc@openinworld.com" target="_blank">btc@openinworld.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br><div dir="ltr"><div><br></div>$ nm -A fpdfview.o | grep FPDF_Init<div>fpdfview.o:0000000000000000  T   FPDF_InitLibrary</div><div>fpdfview.o:0000000000000000  T   FPDF_InitLibraryWithConfig</div><div>fpdfview.o:0000000000000000   t   FPDF_InitLibraryWithConfig.pa<wbr>rt.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 around, object files are composed into a shared library like this...</div><div><br></div><div>$ g++ -fPIC -shared -o libmypdf.so fpdfview.o </div><div><br></div><div><br></div><div>but now the "FPDF_InitLibrary" symbol shows as internal and I can't link against it.</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.pa<wbr>rt.47</div><div><br></div><div><br></div><div>Here is my makefile...</div><div><br></div><div><div>INC_DIR= -I ./public<br></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 first first.c ${INC_DIR} ${LIB_DIR} ${PDF_LIBS} ${STD_LIBS}<br></div><div><br></div></div><div>So I know it finds the library, 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...<br></div><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><div><br></div><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><div><br></div><div><div>#ifdef __cplusplus</div><div>}</div><div>#endif</div></div><div><br></div><div><br></div><div><br></div><div><br></div></div>
<br></blockquote></div><br></div>
</blockquote></div><br></div>
<br></blockquote></div><br></div></div></div></div>