MantisBT - CMake
View Issue Details
0008184CMakeModulespublic2008-11-27 08:352010-11-09 22:57
Fabian Wenzel 
Miguel Figueroa 
normalminoralways
closedfixed 
CMake-2-6 
CMake 2.8.3CMake 2.8.3 
0008184: FindwxWidgets uses wrong order of include libraries on Win32 for Makefiles
The order of libraries "base" and "core" is wrong when generating Makefiles (e.g. for MinGW) on Win32: As core depends on base, base must be defined *after* core in LINK_LIBRARIES, otherwise there will be undefined symbols when linking.

A fixed version is attached to this report.
No tags attached.
? FindwxWidgets.cmake (37,523) 2008-11-27 08:35
https://public.kitware.com/Bug/file/1875/FindwxWidgets.cmake
Issue History
2008-11-27 08:35Fabian WenzelNew Issue
2008-11-27 08:35Fabian WenzelFile Added: FindwxWidgets.cmake
2008-11-28 16:14Miguel FigueroaStatusnew => assigned
2008-11-28 16:14Miguel FigueroaAssigned To => Miguel Figueroa
2008-12-24 05:00Miguel FigueroaNote Added: 0014436
2009-11-12 12:13Fabian WenzelNote Added: 0018403
2010-08-28 10:24Kovarththanan RajaratnamCategoryCMake => Modules
2010-09-01 12:50Miguel FigueroaNote Added: 0022068
2010-09-01 12:50Miguel FigueroaStatusassigned => resolved
2010-09-01 12:50Miguel FigueroaFixed in Version => CMake 2.8.3
2010-09-01 12:50Miguel FigueroaResolutionopen => fixed
2010-09-09 23:49David ColeTarget Version => CMake 2.8.3
2010-11-09 22:57Philip LowmanStatusresolved => closed

Notes
(0014436)
Miguel Figueroa   
2008-12-24 05:00   
I'm puzzled why has this worked for people so far? If I understand correctly, then that means that the library list should be prepended and that the order that they are specified in the FIND_PACKAGE command is important...

I need to verify all this before I apply a complete patch.

Any comments are welcome.

--Miguel
(0018403)
Fabian Wenzel   
2009-11-12 12:13   
Hi there - this bug has now been present for one year and not closed yet even though the solution is just to switch two words in the FIND_PACKAGE statement.

Meanwhile I have upgraded to CMake 2.6.4 and still had to replace the FindWxWidgets file with my patched version.

Regarding your comment above:

1. The order of the library gets passed to the link command. On Mingw this *does* play a role, see http://www.mingw.org/category/wiki/faq [^] -> constantly undefined references

2. My assumption is that it did *not* work for people so far, but that there might be only a few working with Mingw/CMake/wxWidgets on Windows, the vast majority is probably using MSVC

3. The patch works for me, so even if I were telling complete nonsense, then it would be great if you could just let it flow into the trunk as if the order of the libraries would not matter, it does not harm changing it (but helps me)

Regards,

   Fabian
(0022068)
Miguel Figueroa   
2010-09-01 12:50   
commit 3dbeeb77934d6dff85c71b001e07622c5ac6fe4c
Author: Miguel A. Figueroa-Villanueva <miguelf@ieee.org>
Date: Wed Sep 1 12:27:31 2010 -0400

    BUG 0008184: Fixed FindwxWidgets wrong order of default libs for MinGW.
    
    Also fixed usage sample in comments, which can be misleading for MinGW
    users as demonstrated by mantis issue 0010089.