Compiling freeciv-2.4.0-beta1 using MinGW

You can get help here if Freeciv doesn't start on your computer, or if you keep getting fatal errors while playing etc.
Unknown
Posts: 20
Joined: Sat Feb 23, 2013 5:18 pm

Compiling freeciv-2.4.0-beta1 using MinGW

Postby Unknown » Sun Feb 24, 2013 7:53 am

When I tried compile freeciv-2.4.0-beta1 using MinGW configure fails with following result. However I was able to compile freeciv-2.3.3 without any problems.

Code: Select all

$ ./configure
checking build system type... i686-pc-mingw32
checking host system type... i686-pc-mingw32
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether byte ordering is bigendian... no
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for getaddrinfo... no
checking for inet_pton... no
checking for inet_ntop... no
checking for getnameinfo... no
checking for MagickWand-config in default path... no
checking for gawk... (cached) gawk
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking how to run the C preprocessor... gcc -E
checking whether ln -s works... no, using cp -p
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc... c:/mingw/mingw32/bin/ld.exe
checking if the linker (c:/mingw/mingw32/bin/ld.exe) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /mingw/bin/nm
checking the name lister (/mingw/bin/nm) interface... BSD nm
checking the maximum length of command line arguments... 8192
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert i686-pc-mingw32 file names to i686-pc-mingw32 format...
func_convert_file_msys_to_w32
checking how to convert i686-pc-mingw32 file names to toolchain format... func_c
onvert_file_msys_to_w32
checking for c:/mingw/mingw32/bin/ld.exe option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... file_magic ^x86 archive import|
^x86 DLL
checking for dlltool... dlltool
checking how to associate runtime and link libraries... func_cygming_dll_for_imp
lib
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /mingw/bin/nm output from gcc object... ok
checking for sysroot... no
checking for mt... no
checking if : is a manifest tool... no
checking for dlfcn.h... no
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -DDLL_EXPORT -DPIC
checking if gcc PIC flag -DDLL_EXPORT -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (c:/mingw/mingw32/bin/ld.exe) supports shared li
braries... yes
checking dynamic linker characteristics... Win32 ld.exe
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking for ar... (cached) ar
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... c:/mingw/mingw32/bin/ld.exe
checking if the linker (c:/mingw/mingw32/bin/ld.exe) is GNU ld... yes
checking whether the g++ linker (c:/mingw/mingw32/bin/ld.exe) supports shared li
braries... yes
checking for g++ option to produce PIC... -DDLL_EXPORT -DPIC
checking if g++ PIC flag -DDLL_EXPORT -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (c:/mingw/mingw32/bin/ld.exe) supports shared li
braries... yes
checking dynamic linker characteristics... Win32 ld.exe
checking how to hardcode library paths into programs... immediate
checking whether C++ compiler works... yes
checking for uname... uname
checking for ld used by GCC... c:/mingw/mingw32/bin/ld.exe
checking if the linker (c:/mingw/mingw32/bin/ld.exe) is GNU ld... yes
checking for shared library run path origin... done
checking for iconv... yes
checking for working iconv... yes
checking how to link with libiconv... -liconv
checking for iconv declaration...
         extern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, ch
ar * *outbuf, size_t *outbytesleft);
checking for libcharset... yes
checking for nl_langinfo and CODESET... no
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking for LC_MESSAGES... no
checking libintl.h usability... yes
checking libintl.h presence... yes
checking for libintl.h... yes
checking for ngettext in libc... no
checking for bindtextdomain in -lintl... yes
checking for ngettext in -lintl... yes
checking for dgettext in -lintl... yes
checking for bind_textdomain_codeset... yes
checking for msgfmt... /mingw/bin/msgfmt
checking for dcgettext... yes
checking if msgfmt accepts -c... yes
checking for gmsgfmt... /mingw/bin/msgfmt
checking for xgettext... /mingw/bin/xgettext
checking for catalogs to be installed...  ar bg cs ca da de el en_GB eo es et fa
 fi fr ga gd he hu id it ja ko lt nl nb no pl pt pt_BR ro ru sr sv tr uk zh_CN
checking for ngettext in -lc... no
checking for ngettext in -lintl... (cached) yes
checking whether libintl's ngettext works at runtime... yes
checking for GNU xgettext version >= 0.10.36... yes
checking for GNU msgfmt version >= 0.10.35... yes
checking for pkg-config... /mingw/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for CURL... yes
checking for C99 variadic macros... yes
checking for C99 variable arrays... yes
checking for C99 initializers... yes
checking for stdint.h... (cached) yes
checking for C99 stdint.h... yes
checking for windres... windres
checking for gzgets in -lz... yes
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for gzip... /bin/gzip
checking for BZ2_bzReadOpen in -lbz2... no
checking for lzma_code in -llzma... no
checking for threads implementation... pthreads
configure: checking for which client to compile:...
checking for pkg-config... /mingw/bin/pkg-config
checking for GTK+ - version >= 2.12.0... no
*** Could not run GTK+ test program, checking why...
*** The test program failed to compile or link. See the file config.log for the
*** exact error that occured. This usually means GTK+ is incorrectly installed.
checking for pkg-config... (cached) /mingw/bin/pkg-config
checking for GTK+ - version >= 3.4.0... no
*** Could not run GTK+ test program, checking why...
*** The test program failed to compile or link. See the file config.log for the
*** exact error that occured. This usually means GTK+ is incorrectly installed.
checking for sdl-config... no
checking for SDL - version >= 1.1.4... no
*** The sdl-config script installed by SDL could not be found
*** If SDL was installed in PREFIX, make sure PREFIX/bin is in
*** your path, or set the SDL_CONFIG environment variable to the
*** full path to sdl-config.
checking for X... no
checking whether Xfuncproto was supplied... no
checking for compilable FUNCPROTO definition... no, cannot determine
checking for workable NARROWPROTO definition... no, cannot determine
checking whether Xfuncproto was determined... no
checking for Xfuncproto control definition FUNCPROTO... no
checking for Xfuncproto control definition NARROWPROTO... no
checking pkg-config is at least version 0.9.0... yes
checking for PNG... yes
checking extra paths for Xpm... library no, include no
checking for XOpenDisplay in X library -lX11... no
checking will compile gui-beos... no
checking pkg-config is at least version 0.9.0... yes
checking for PNG... yes
configure: error: could not guess which client to compile

cazfi
Elite
Posts: 1713
Joined: Tue Jan 29, 2013 6:54 pm

Re: Compiling freeciv-2.4.0-beta1 using MinGW

Postby cazfi » Sun Feb 24, 2013 9:00 am

What versions you are using? Is that with generic MinGW environment, or are you using one from http://download.gna.org/freeciv/package ... /gnuwin32/ ?

It seems that in your environment no client can be built, it lacks some requirement for every one of them. I assume you've been using gtk2-client in freeciv-2.3. Minimum gtk version has been increased from 2.6 in freeciv-2.3 to 2.12 in freeciv-2.4. Even gtk-2.12 is already almost six years old.

Unknown
Posts: 20
Joined: Sat Feb 23, 2013 5:18 pm

Re: Compiling freeciv-2.4.0-beta1 using MinGW

Postby Unknown » Sun Feb 24, 2013 10:57 am

I am using generic MinGW environment with gtk-2.24 (All in one bundle).
While configuring freeciv-2.3.3 gtk2-2.24 was detected.

cazfi
Elite
Posts: 1713
Joined: Tue Jan 29, 2013 6:54 pm

Re: Compiling freeciv-2.4.0-beta1 using MinGW

Postby cazfi » Sun Feb 24, 2013 5:04 pm

In that case, do as it says about failed gtk2-check:
See the file config.log for the
*** exact error that occured.

Unknown
Posts: 20
Joined: Sat Feb 23, 2013 5:18 pm

Re: Compiling freeciv-2.4.0-beta1 using MinGW

Postby Unknown » Sun Feb 24, 2013 7:36 pm

I found following error message in config.log.

Code: Select all

configure:21190: checking for GTK+ - version >= 2.12.0
configure:21300: gcc -o conftest.exe -I/usr/local/include -IC:/MinGW/msys/1.0/local/include -pthread -mms-bitfields -Ic:/mingw/include/gtk-2.0 -Ic:/mingw/lib/gtk-2.0/include -Ic:/mingw/include/atk-1.0 -Ic:/mingw/include/cairo -Ic:/mingw/include/gdk-pixbuf-2.0 -Ic:/mingw/include/pango-1.0 -Ic:/mingw/include/glib-2.0 -Ic:/mingw/lib/glib-2.0/include -Ic:/mingw/include -Ic:/mingw/include/freetype2 -Ic:/mingw/include/libpng14    -DBINDIR="\"${exec_prefix}/bin\"" -L/usr/local/lib conftest.c -Lc:/mingw/lib -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0 -lgio-2.0 -lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lintl    -liconv -LC:/MinGW/msys/1.0/local/lib -lcurl   -lwsock32 -lpthread >&5
gcc.exe: error: unrecognized option '-pthread'
configure:21300: $? = 1
configure: program exited with status 1
How to resolve this?

cazfi
Elite
Posts: 1713
Joined: Tue Jan 29, 2013 6:54 pm

Re: Compiling freeciv-2.4.0-beta1 using MinGW

Postby cazfi » Mon Feb 25, 2013 8:46 am

gcc.exe: error: unrecognized option '-pthread'

This seems like a real bug in build system. Please file a bug report to http://gna.org/bugs/?func=additem&group=freeciv

Unknown
Posts: 20
Joined: Sat Feb 23, 2013 5:18 pm

Re: Compiling freeciv-2.4.0-beta1 using MinGW

Postby Unknown » Tue Feb 26, 2013 9:27 am

What information should I specify while reporting a bug?
Should I attach config.log file?

cazfi
Elite
Posts: 1713
Joined: Tue Jan 29, 2013 6:54 pm

Re: Compiling freeciv-2.4.0-beta1 using MinGW

Postby cazfi » Tue Feb 26, 2013 2:57 pm

Unknown wrote:What information should I specify while reporting a bug?
Should I attach config.log file?

Give link to this thread at least. Config.log might help so attaching it is a good idea.

Unknown
Posts: 20
Joined: Sat Feb 23, 2013 5:18 pm

Re: Compiling freeciv-2.4.0-beta1 using MinGW

Postby Unknown » Thu Feb 28, 2013 2:59 pm

Thank you for the patch.
Now I could finish configure without any problems. But make fails with following error message.

Code: Select all

*** No rule to make target `-lm', needed by `tolua.exe'.  Stop.

cazfi
Elite
Posts: 1713
Joined: Tue Jan 29, 2013 6:54 pm

Re: Compiling freeciv-2.4.0-beta1 using MinGW

Postby cazfi » Thu Feb 28, 2013 5:12 pm

See bug #20095, fixed since beta1 was released.