|
From: Jannick <thi...@gm...> - 2016-10-01 21:28:46
|
> From: Jannick [mailto:thi...@gm...] > Sent: Saturday, October 1, 2016 7:41 PM > However, now I am able to run a pure msys compilation to produce a > working executable (thanks to Sergio on this list!). I missed this in the first > place, since I had to additionally load the msys core utils to make that > happen with both the library bfd and liberty residing in the msys lib folders. > > Thus it looks to me that > - msys has consistent libs bfd and liberty to compile on msys level > - liberty.a is missing in the MinGW lib folder > - a mixed compilation approach (msys & MinGW) uses incompatible libs, > hence linking breaks. Here a way to get the initial main.c (see the initial posting) compiled purely with MinGW (i.e. without any reference to msys if I am not missing anything behind the scenes) and a linking a freshly compiled GNU binutils package (from https://www.gnu.org/software/binutils, v2.27 as of today). In a msys shell I compiled the package with ./configure --disable-nls make where `--disable-nls` avoids linking errors (with intl library involved). (I am hesitating to run 'make install' after passing '--prefix=C:/MinGW' to ./configure to not overwrite other files and executables). Then linking with, e.g., mingw32-gcc -o t.exe main.c \ C:path/to/binutils-2.27/bfd/.libs/libbfd.a\ C:/path/to/binutils-2.27/libiberty/libiberty.a -lz does the job for main.c here. I guess it would be great to push that - if possible - thru the MinGW package in one of the next MinGW releases. But this is certainly up to the maintainers, of course. Many thanks, J. |