Ubuntu 22.04.2 LTS 上的 Meson 和 clang++

问题描述 投票:0回答:0

我一直能够通过运行使用 clang 和 clang++ 编译介子项目:

CC=clang CXX=clang++ meson setup clang-debug --buildtype=debug

我得到的输出是:

he Meson build system
Version: 1.1.0
Source dir: /home/maarten/github/psy-lib
Build dir: /home/maarten/github/psy-lib/clang-debug
Build type: native build
Project name: libpsy
Project version: 0.1
C compiler for the host machine: clang (clang 14.0.0-1ubuntu1 "Ubuntu clang version 14.0.0-1ubuntu1")
C linker for the host machine: clang ld.bfd 2.38

meson.build:1:0: ERROR: Compiler clang++ can not compile programs.

A full log can be found at /home/maarten/github/psy-lib/clang-debug/meson-logs/meson-log.txt

如果我跑:

meson setup debug --buildtype=debug

我得到了一个工作构建,它使用 cc 和 c++ 分别编译 C 和 C++。

来自介子日志的有关 clang(++) 构建的部分是:

-----
Detecting compiler via: clang++ --version
compiler returned <Popen: returncode: 0 args: ['clang++', '--version']>
compiler stdout:
Ubuntu clang version 14.0.0-1ubuntu1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

compiler stderr:

Running command: clang++ -E -dM -
-----
Detecting linker via: clang++ -Wl,--version
linker returned <Popen: returncode: 0 args: ['clang++', '-Wl,--version']>
linker stdout:
GNU ld (GNU Binutils for Ubuntu) 2.38
Copyright (C) 2022 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.

linker stderr:

Sanity testing C++ compiler: clang++
Is cross compiler: False.
Sanity check compiler command line: clang++ sanitycheckcpp.cc -o sanitycheckcpp.exe -D_FILE_OFFSET_BITS=64
Sanity check compile stdout:

-----
Sanity check compile stderr:
/usr/bin/ld: cannot find -lstdc++: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)

-----

meson.build:1:0: ERROR: Compiler clang++ can not compile programs.

我不知道出了什么问题。我将不胜感激任何帮助!

c++ c clang clang++ meson-build
© www.soinside.com 2019 - 2024. All rights reserved.