GNOME Bugzilla – Bug 545427
valac fails to link on Cygwin/MinGW
Last modified: 2008-07-30 21:32:28 UTC
valac fails to link on Cygwin (and MinGW). This occurs because it puts the link flags before the compiled object files, and binutils in PE/COFF requires the required libraries to be on the command line after the object files requiring their symbols. (This is similar to -as-needed on Linux.) I'm attaching a patch which fixes this.
Created attachment 115540 [details] [review] 0.3.4 as-needed patch * gobject/valaccodecompiler.vala (Vala.CCodeCompiler.compile): Place pkg-config flags and Xcc flags at the end of the command line, so that the object files precede the link libraries. Required for linking on Cygwin and MinGW. Fixes bug 545427.
2008-07-30 Jürg Billeter <j@bitron.ch> * gobject/valaccodecompiler.vala: Fix linking with --as-needed and on Windows, patch by Yaakov Selkowitz, fixes bug 545427 Fixed in r1728.