Configure fails: checking whether the C compiler works... no Ubuntu 22.04

Questions about Wine on Linux
Locked
garfunkel445
Newbie
Newbie
Posts: 1
Joined: Sat Aug 27, 2022 7:17 am

Configure fails: checking whether the C compiler works... no Ubuntu 22.04

Post by garfunkel445 »

Trying to run configure script on Ubuntu 22.04 for wine 7.15 and receiving this:

checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/home/david/Downloads/wine-7.15':
configure: error: C compiler cannot create executables
See `config.log' for more details

I have tried reinstalling gcc and build-essential to no avail. The config log is as follows:

## --------- ##
## Platform. ##
## --------- ##

hostname = D1885M
uname -m = x86_64
uname -r = 5.15.0-46-generic
uname -s = Linux
uname -v = #49-Ubuntu SMP Thu Aug 4 18:03:25 UTC 2022

/usr/bin/uname -p = x86_64
/bin/uname -X = unknown

/bin/arch = x86_64
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown

PATH: /usr/local/sbin/
PATH: /usr/local/bin/
PATH: /usr/sbin/
PATH: /usr/bin/
PATH: /sbin/
PATH: /bin/
PATH: /usr/games/
PATH: /usr/local/games/
PATH: /snap/bin/
PATH: /snap/bin/


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

configure:3929: looking for aux files: config.guess config.sub
configure:3942: trying ./tools/
configure:3971: ./tools/config.guess found
configure:3971: ./tools/config.sub found
configure:4479: checking build system type
configure:4494: result: x86_64-pc-linux-gnu
configure:4514: checking host system type
configure:4528: result: x86_64-pc-linux-gnu
configure:4558: checking whether make sets $(MAKE)
configure:4581: result: yes
configure:4652: checking for gcc
configure:4673: found /usr/local/bin/gcc
configure:4684: result: gcc
configure:5037: checking for C compiler version
configure:5046: gcc --version >&5
gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0
Copyright (C) 2021 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:5057: $? = 0
configure:5046: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 11.2.0-19ubuntu1'
--with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs --enable-languages=c,ada
,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-on
ly --program-suffix=-11 --program-prefix=x86_64-linux-gnu- --enable-shared --ena
ble-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-th
reads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=g
nu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx
-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --en
able-default-pie --with-system-zlib --enable-libphobos-checking=release --with-t
arget-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror
--enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx
32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/bu
ild/gcc-11-gBFGDP/gcc-11-11.2.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-11
-gBFGDP/gcc-11-11.2.0/debian/tmp-gcn/usr --without-cuda-driver --enable-checking
=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-
gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=2
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.2.0 (Ubuntu 11.2.0-19ubuntu1)
configure:5057: $? = 0
configure:5046: gcc -V >&5
gcc: error: unrecognized command-line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:5057: $? = 1
configure:5046: gcc -qversion >&5
gcc: error: unrecognized command-line option '-qversion'; did you mean '--versio
n'?
gcc: fatal error: no input files
compilation terminated.
configure:5057: $? = 1
configure:5046: gcc -version >&5
gcc: error: unrecognized command-line option '-version'
gcc: fatal error: no input files
compilation terminated.
configure:5057: $? = 1
configure:5077: checking whether the C compiler works
configure:5099: gcc -march=native -O2 -pipe conftest.c >&5
gcc: fatal error: cannot execute 'cc1': execvp: No such file or directory
compilation terminated.
configure:5103: $? = 1
configure:5143: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "Wine"
| #define PACKAGE_TARNAME "wine"
| #define PACKAGE_VERSION "7.15"
| #define PACKAGE_STRING "Wine 7.15"
| #define PACKAGE_BUGREPORT "[email protected]"
| #define PACKAGE_URL "https://www.winehq.org"
| /* end confdefs.h. */
|
| int
| main (void)
| {
|
| ;
| return 0;
| }
configure:5148: error: in `/home/david/Downloads/wine-7.15':
configure:5150: error: C compiler cannot create executables
See `config.log' for more details



I didn't paste the rest of the config log but this is the section I think is most relevant. I see that cc1:execvp is not found so tried reinstalling build-essential again with no luck.
invisible kid
Level 5
Level 5
Posts: 368
Joined: Tue Dec 24, 2019 3:23 pm

Re: Configure fails: checking whether the C compiler works... no Ubuntu 22.04

Post by invisible kid »

Hi, just a fellow user here. Yeah, it is showing a bunch off gcc related errors there. It looks like some are just complaining about the right --version flag and aren't impactful as it tries the next way. So, like you pointed out, the real culprit looks like it isn't able to compile that test program. I compiled the test file on my system and it did work.

It could be helpful for you to try this standalone and see what's going wrong, but something looks wrong with your gcc install.

conftest.c:

Code: Select all

/* confdefs.h */
#define PACKAGE_NAME "Wine"
#define PACKAGE_TARNAME "wine"
#define PACKAGE_VERSION "7.15"
#define PACKAGE_STRING "Wine 7.15"
#define PACKAGE_BUGREPORT "[email protected]"
#define PACKAGE_URL "https://www.winehq.org"
/* end confdefs.h. */

int
main (void)
{

;
return 0;
}

Code: Select all

gcc -march=native -O2 -pipe conftest.c
On my machine it doesn't produce any errors, and produces a.out. Then run a.out even though it doesn't do anything:

Code: Select all

./a.out
I tried poking around to help pinpoint it further, but came up empty.
jkfloris
Level 12
Level 12
Posts: 3201
Joined: Thu Aug 14, 2014 10:10 am

Re: Configure fails: checking whether the C compiler works... no Ubuntu 22.04

Post by jkfloris »

It looks like you are missing some packages. cc1 is part of cpp
The easiest way is to install the build-essential package.

Code: Select all

sudo apt-get update
sudo apt-get install --reinstall build-essential
The WineHQ Wiki lists the other packages you will need.
guest3543
Level 2
Level 2
Posts: 12
Joined: Sat Feb 20, 2010 12:00 am

Re: Configure fails: checking whether the C compiler works... no Ubuntu 22.04

Post by guest3543 »

Quite interesting information
jkfloris
Level 12
Level 12
Posts: 3201
Joined: Thu Aug 14, 2014 10:10 am

Re: Configure fails: checking whether the C compiler works... no Ubuntu 22.04

Post by jkfloris »

For the end user, WineHQ creates ready-to-use packages. Compiling Wine is only necessary if you want to modify the code yourself.
Locked