> This type of errors are usually caused by wrong order of listed > libraries on the command line. If library A contains references to > library B, you need to list -lA before -lB on the command line because,
Yes I've caught a few of those in my time. This is coming from code that works well on a number of other platforms - -o ../dll/pdf.dll -Wl,--major-image-version,0,--minor-image-version,0 -Wl,--whole-archive CMakeFiles/pdf.dir/objects.a -Wl,--no-whole-archive ../dll/libplplot.dll.a D:/mingw/msys32/mingw32/lib/libhpdf.dll.a D:/mingw/msys32/mingw32/lib/libshp.dll.a D:/mingw/msys32/mingw32/lib/ libfreetype.dll.a CMakeFiles/pdf.dir/objects.a the object files assembled via ar which call the library libhpdf and libplplot ./dll/libplplot.dll.a D:/mingw/msys32/mingw32/lib/libhpdf.dll.a where the missing symbols are located. D:/mingw/msys32/mingw32/lib/libshp.dll.a D:/mingw/msys32/mingw32/lib/libfreetype.dll.a ... (lower level support libraries required by libplplot) ========================= I've tried this by moving -W1,--no-whole-archive downstream, past libqhull. It "succeeds" with the following clues: Warning: resolving __imp__HPDF_New by linking to __imp__HPDF_New@8 > Use --enable-stdcall-fixup to disable these warnings > Use --disable-stdcall-fixup to disable these fixups > Warning: resolving __imp__HPDF_SetCompressionMode by linking to > __imp__HPDF_SetCompressionMode@8 > Warning: resolving __imp__HPDF_AddPage by linking to __imp__HPDF_AddPage@4 > Warning: resolving __imp__HPDF_Page_SetSize by linking to > __imp__HPDF_Page_SetSize@12 Warning: resolving __imp__HPDF_Page_GetWidth by linking to __imp__HPDF_Page_GetWidth@4 Warning: resolving __imp__HPDF_Page_GetHeight by linking to __imp__HPDF_Page_GetHeight@4 Warning: resolving __imp__HPDF_Page_Concat by linking to __imp__HPDF_Page_Concat@28 Warning: resolving __imp__HPDF_Page_SetRGBFill by linking to __imp__HPDF_Page_SetRGBFill@16 Warning: resolving __imp__HPDF_Page_MoveTo by linking to __imp__HPDF_Page_MoveTo@12 Warning: resolving __imp__HPDF_Page_LineTo by linking to __imp__HPDF_Page_LineTo@12 Warning: resolving __imp__HPDF_Page_Fill by linking to __imp__HPDF_Page_Fill@4 Warning: resolving __imp__HPDF_SaveToStream by linking to __imp__HPDF_SaveToStream@4 Warning: resolving __imp__HPDF_ResetStream by linking to __imp__HPDF_ResetStream@4 Warning: resolving __imp__HPDF_ReadFromStream by linking to __imp__HPDF_ReadFromStream@12 Warning: resolving __imp__HPDF_Free by linking to __imp__HPDF_Free@4 Warning: resolving __imp__HPDF_Page_SetLineWidth by linking to __imp__HPDF_Page_SetLineWidth@8 Warning: resolving __imp__HPDF_Page_SetLineCap by linking to __imp__HPDF_Page_SetLineCap@8 Warning: resolving __imp__HPDF_Page_SetLineJoin by linking to __imp__HPDF_Page_SetLineJoin@8 Warning: resolving __imp__HPDF_Page_SetRGBStroke by linking to __imp__HPDF_Page_SetRGBStroke@16 Warning: resolving __imp__HPDF_Page_EofillStroke by linking to __imp__HPDF_Page_EofillStroke@4 Warning: resolving __imp__HPDF_Page_FillStroke by linking to __imp__HPDF_Page_FillStroke@4 Warning: resolving __imp__HPDF_Page_Stroke by linking to __imp__HPDF_Page_Stroke@4 Warning: resolving __imp__HPDF_Page_BeginText by linking to __imp__HPDF_Page_BeginText@4 Warning: resolving __imp__HPDF_Page_SetTextRenderingMode by linking to __imp__HPDF_Page_SetTextRenderingMode@8 Warning: resolving __imp__HPDF_Page_MoveTextPos by linking to __imp__HPDF_Page_MoveTextPos@12 Warning: resolving __imp__HPDF_Page_ShowText by linking to __imp__HPDF_Page_ShowText@8 Warning: resolving __imp__HPDF_Page_EndText by linking to __imp__HPDF_Page_EndText@4 Warning: resolving __imp__HPDF_Page_TextWidth by linking to __imp__HPDF_Page_TextWidth@8 Warning: resolving __imp__HPDF_Font_GetCapHeight by linking to __imp__HPDF_Font_GetCapHeight@4 Warning: resolving __imp__HPDF_GetFont by linking to __imp__HPDF_GetFont@12 Warning: resolving __imp__HPDF_Page_SetFontAndSize by linking to __imp__HPDF_Page_SetFontAndSize@12 Warning: resolving __imp__HPDF_Page_GSave by linking to __imp__HPDF_Page_GSave@4 Warning: resolving __imp__HPDF_Page_GRestore by linking to __imp__HPDF_Page_GRestore@4 OK so for some reason the library was built for stdcall inst4ad of c_decl interface, or visa-versa, the building was directed by CMake. On Tue, Sep 8, 2015 at 3:50 AM, Óscar Fuentes <[email protected]> wrote: > Greg Jung <[email protected]> writes: > > > My apologies to be posting such a basic problem here, I'm getting > undefined > > references: > > This type of errors are usually caused by wrong order of listed > libraries on the command line. If library A contains references to > library B, you need to list -lA before -lB on the command line because, > while resolving references, the GNU linker only looks at the libraries > that comes after the one it is currently processing. > > Although this is not your case, the Same rule applies to object files: > if you put the libraries before the object files on the command line, > the linker will not process those libraries while resolving the symbols > of the object files. > > > > ------------------------------------------------------------------------------ > _______________________________________________ > Msys2-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/msys2-users >
------------------------------------------------------------------------------
_______________________________________________ Msys2-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/msys2-users
