Build error on Macos: C compiler cannot create executables
Hi,
Installing stuff
brew install automake libwebsockets asciidoctor pkg-config openssl@3
brew install qt5
brew install qt
brew install npm
npm install electron -g
brew install rust jq
Prepare Build
git clone https://github.com/PerBothner/DomTerm
cd DomTerm
autoreconf -i
which gcc-10
/usr/local/bin/gcc-10
gcc-10 -v
Using built-in specs.
COLLECT_GCC=gcc-10
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc@10/10.5.0/libexec/gcc/x86_64-apple-darwin22/10.5.0/lto-wrapper
Target: x86_64-apple-darwin22
Configured with: ../configure --prefix=/usr/local/Cellar/gcc@10/10.5.0 --libdir=/usr/local/Cellar/gcc@10/10.5.0/lib/gcc/10 --disable-nls --enable-checking=release --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-10 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-isl=/usr/local/opt/isl --with-pkgversion='Homebrew GCC 10.5.0' --with-bugurl=https://github.com/Homebrew/homebrew-core/issues --build=x86_64-apple-darwin22 --with-system-zlib --disable-multilib --with-native-system-header-dir=/usr/include --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.5.0 (Homebrew GCC 10.5.0)
Error log from configure
CXX="g++-10 -std=c++11" CC='gcc-10' ./configure
checking whether to enable maintainer-specific portions of Makefiles... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... mkdir -p
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking build system type... x86_64-apple-darwin23.5.0
checking host system type... x86_64-apple-darwin23.5.0
checking for gcc... gcc-10
checking whether the C compiler works... no
configure: error: in '/Users/ben/build/domterm/domterm.git':
configure: error: C compiler cannot create executables
See 'config.log' for more details
This doesn't look like a DomTerm problem, but a gcc or installation problem.
First of all, gcc 10.* is quite old and no longer supported. I would try to update your gcc version.
If that doesn't work, I'd look at the last part of config.log and see if that gives you clues.
Thank you for taking the time to have a look into it and sorry for my delayed response
Using system clang
I refer to this as sysclang
export CC=/usr/bin/clang
$CC -v Apple clang version 15.0.0 (clang-1500.3.9.4) Target: x86_64-apple-darwin23.6.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
configure with sysclang
./configure: every thing looks fine here please have a look at the attached confout-sysclang.log file
make error at dt-wry
Every things compiles until dt-wry:
I'm using rust rustc 1.80.1 (3f5fd8dd4 2024-08-06) (Homebrew)
Compiling dt-wry v3.2.0 (domterm.git/dt-wry)
error[E0277]: the trait bound `Window: wry::raw_window_handle::HasRawWindowHandle` is not satisfied
--> src/main.rs:289:37
|
289 | let builder = WebViewBuilder::new(&window);
| ------------------- ^^^^^^^ the trait `wry::raw_window_handle::HasRawWindowHandle` is not implemented for `Window`
| |
| required by a bound introduced by this call
|
= help: the following other types implement trait `wry::raw_window_handle::HasRawWindowHandle`:
&'a T
Arc<T>
Rc<T>
wry::raw_window_handle::WindowHandle<'_>
note: required by a bound in `WebViewBuilder::<'a>::new`
--> /Users/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wry-0.35.2/src/lib.rs:570:31
|
570 | pub fn new(window: &'a impl HasRawWindowHandle) -> Self {
| ^^^^^^^^^^^^^^^^^^ required by this bound in `WebViewBuilder::<'a>::new`
For more information about this error, try `rustc --explain E0277`.
Cannot run ./bin/qtdomterm
But also when I try to run an other backend domterm fails to create a new window
./bin/qtdomterm -Bqt
Path override failed for key base::DIR_APP_DICTIONARIES and path '/domterm.git/bin/qtwebengine_dictionaries'
Path override failed for key base::DIR_APP_DICTIONARIES and path '/usr/local/Cellar/qt/6.7.0_1/lib/QtWebEngineCore.framework/Versions/A/Helpers/QtWebEngineProcess.app/Contents/MacOS/qtwebengine_dictionaries'
I was finally able to start looking at this. I was able to reproduce your problem building dt-wry on MacOS, though it builds fine on Linux.
However, if I configure --with-\out-wry, it builds, and I'm able to run both bin/domterm -Bqt and bin/domterm -Belectron.
I'll look into thedt-wry issue - though first I want to update to the latest version of Wry (which failed on Linux also).
I can build (and run) dt-wry on MacOS now. Possibly because I updated DomTerm to use the latest Wry releae.
I can confirm, that I was able to compile it and run with bin/domterm -Bqt
Thanks for the feedback!