Cywgin make failure: C compiler cannot create executables

You can get help here if Freeciv doesn't start on your computer, or if you keep getting fatal errors while playing etc.
asdf994
Posts: 3
Joined: Sun Feb 09, 2014 11:53 pm

Cywgin make failure: C compiler cannot create executables

Postby asdf994 » Mon Feb 10, 2014 12:15 am

I'm trying to compile freeciv for the first time using directions at http://freeciv.wikia.com/wiki/Install-Windows For Windows/CygWin/GTK client and have run into trouble.

I enter:
./autogen.sh --enable-client=gtk-2.0 --with-libiconv-prefix=/usr --host=mingw32 CPPFLAGS=-mno-cygwin

but get "configure: C compiler cannot create executables" - As far as I know I'm running latest for Cygwin and MinGW, as well as current Freeciv. I don't know much about makefiles, but it looks like GCC fails with -V option and doesn't continue to try the lowercase -v option.

Hmm, I tried to attach a file, but I get "The extension txt is not allowed" - so far .log and .txt are not allowed, and neither is a blank extension. I'd upload the config.log file but don't know how to do that? So, here's what I think is the relevant part of config.log:

## ----------- ##
## Core tests. ##
## ----------- ##

configure:3137: checking build system type
configure:3151: result: i686-pc-cygwin
configure:3171: checking host system type
configure:3184: result: i386-pc-mingw32
configure:3215: checking for mingw32-gcc
configure:3231: found /cygdrive/c/civdev/MinGW/bin/mingw32-gcc
configure:3242: result: mingw32-gcc
configure:3511: checking for C compiler version
configure:3520: mingw32-gcc --version >&5
mingw32-gcc.exe (GCC) 4.8.1
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:3531: $? = 0
configure:3520: mingw32-gcc -v >&5
Using built-in specs.
COLLECT_GCC=C:\civdev\MinGW\bin\mingw32-gcc.exe
COLLECT_LTO_WRAPPER=c:/civdev/mingw/bin/../libexec/gcc/mingw32/4.8.1/lto-wrapper.exe
Target: mingw32
Configured with: ../gcc-4.8.1/configure --prefix=/mingw --host=mingw32 --build=mingw32 --without-pic --enable-shared --enable-static --with-gnu-ld --enable-lto --enable-libssp --disable-multilib --enable-languages=c,c++,fortran,objc,obj-c++,ada --disable-sjlj-exceptions --with-dwarf2 --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-runtime-libs --with-gmp=/usr/src/pkg/gmp-5.1.2-1-mingw32-src/bld --with-mpc=/usr/src/pkg/mpc-1.0.1-1-mingw32-src/bld --with-mpfr= --with-system-zlib --with-gnu-as --enable-decimal-float=yes --enable-libgomp --enable-threads --with-libiconv-prefix=/mingw32 --with-libintl-prefix=/mingw --disable-bootstrap LDFLAGS=-s CFLAGS=-D_USE_32BIT_TIME_T
Thread model: win32
gcc version 4.8.1 (GCC)
configure:3531: $? = 0
configure:3520: mingw32-gcc -V >&5
mingw32-gcc.exe: error: unrecognized command line option '-V'
mingw32-gcc.exe: fatal error: no input files
compilation terminated.
configure:3531: $? = 1
configure:3520: mingw32-gcc -qversion >&5
mingw32-gcc.exe: error: unrecognized command line option '-qversion'
mingw32-gcc.exe: fatal error: no input files
compilation terminated.
configure:3531: $? = 1
configure:3551: checking whether the C compiler works
configure:3573: mingw32-gcc mno-cygwin conftest.c >&5
mingw32-gcc.exe: error: mno-cygwin: No such file or directory
configure:3577: $? = 1
configure:3615: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "freeciv"
| #define PACKAGE_TARNAME "freeciv"
| #define PACKAGE_VERSION "2.5.99-dev"
| #define PACKAGE_STRING "freeciv 2.5.99-dev"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:3620: error: in `/home/chris/freeciv':
configure:3622: error: C compiler cannot create executables
See `config.log' for more details

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

Re: Cywgin make failure: C compiler cannot create executable

Postby cazfi » Mon Feb 10, 2014 6:22 am

asdf994 wrote:I'm trying to compile freeciv for the first time using directions at http://freeciv.wikia.com/wiki/Install-Windows For Windows/CygWin/GTK client and have run into trouble.

Don't know when that document has last been updated, but I've recently updated (after it had been unmaintained for a decade) doc/INSTALL.Cygwin distributed with the code.

asdf994 wrote:./autogen.sh --enable-client=gtk-2.0 --with-libiconv-prefix=/usr --host=mingw32 CPPFLAGS=-mno-cygwin

Do you really need --host option? The default is native build, so if you're not cross-compiling, leaving "--host=mingw32" just allows configure to decide right tools.

asdf994 wrote:mingw32-gcc.exe: error: mno-cygwin: No such file or directory

That's the final error it encounters.

What does it says if you leave all parameters out and rely on defaults:
./autogen.sh

( or, as I prefer using separate build dirs, even multiple ones with different configurations:
mkdir build-gtk2
cd build-gtk2
../autogen.sh --enable-client=gtk2
make
cd ..
mkdir build-gtk3
cd build-gtk3
../autogen.sh --enable-client=gtk3
make
)

asdf994
Posts: 3
Joined: Sun Feb 09, 2014 11:53 pm

Re: Cywgin make failure: C compiler cannot create executable

Postby asdf994 » Tue Feb 11, 2014 5:42 am

Thanks for the response, cazfi... I tried your much simpler instructions and got different results - now apparently a problem with libcurl:

./configure --enable-client=gtk2 as well as ./autogen --enable-client=gtk2 both produce the following config.log file:

configure:20685: checking for pkg-config
configure:20703: found /cygdrive/c/civdev/MinGW/bin/pkg-config
configure:20715: result: /cygdrive/c/civdev/MinGW/bin/pkg-config
configure:20740: checking pkg-config is at least version 0.9.0
configure:20743: result: yes
configure:20753: checking for CURL
configure:20760: $PKG_CONFIG --exists --print-errors "libcurl"
Package libcurl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcurl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcurl' found
configure:20763: $? = 1
configure:20777: $PKG_CONFIG --exists --print-errors "libcurl"
Package libcurl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcurl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcurl' found
configure:20780: $? = 1
configure:20794: result: no
No package 'libcurl' found
configure:20810: error: libcurl development files required

But according to cygwin setup I have 7.34.0-1 libcurl-devel installed. I tried both:
export PKG_CONFIG_PATH=/lib/pkgconfig
export PKG_CONFIG_PATH=/cygdrive/c/civdev/cygwin/lib/pkgconfig
but neither made any difference. I have libcurl.pc at c:\civdev\cygwin\lib\pkgconfig.

Any suggestions? Thanks!

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

Re: Cywgin make failure: C compiler cannot create executable

Postby cazfi » Tue Feb 11, 2014 5:17 pm

Right, for the doc update I tested building freeciv S2_4, libcurl is a new dependency in 2.5. You've already checked the obvious possibility of lacking libcurl development package or libcurl.pc.

I would do further testing directly with pkg-config -command to avoid need to run all of configure that far for each test. What is the contents of libcurl.pc -file?