AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题

问题[g++](ubuntu)

Martin Hope
CPLTarun
Asked: 2020-08-19 10:21:24 +0800 CST

新手:如何在Ubuntu Studio 20.04上使用QMAKE编译安装FaustLive?无法使用带有 linux-g++ 的 qmake 创建 Makefile

  • 1

FaustLive 是 Faust(开源、编译音频编程语言)的开源原型设计环境。这里是 FaustLive 的 GitHub:https ://github.com/grame-cncm/faustlive

通过终端成功编译和安装 Faust 后,我​​在 Ubuntu Studio 20.04 上使用 FaustLive 时遇到了麻烦。以下是他们的构建说明:https ://github.com/grame-cncm/faustlive/tree/master/Build

我已经安装了他们列出的所有必备软件包(据我所知,作为终端/linux 新手)。我被困在他们的“项目生成”步骤。在我将目录更改为 FaustLive 文件夹后,我按照说明在其中克隆了他们的 github,我正在尝试执行:

$ qmake -spec /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++/qmake.conf /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++/qplatformdefs.h

执行时,qmake 只是重复这个:

/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++/qplatformdefs.h:3: Extra characters after test expression. 它以 h:3 到 h:59 重复,中间跳过几行。它的最终输出是: Error processing project file: /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++/qplatformdefs.h

我从这里做什么?

software-installation compiling makefile g++ qmake
  • 1 个回答
  • 314 Views
Martin Hope
Spongman
Asked: 2020-07-31 12:21:45 +0800 CST

无法在 Ubuntu 20.04 上使用 log4cplus

  • 1

这是我的程序:

#include <string>
#include <log4cplus/logger.h>

int main()
{
    log4cplus::Logger::getInstance(std::string("main"));
}

建造:

$ g++ main.cpp -llog4cplus
/tmp/ccBqwrxF.o:main.cpp:function main: error: undefined reference to 'log4cplus::Logger::getInstance(std::string const&)'
collect2: error: ld returned 1 exit status
$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04 LTS"

$ dpkg -l g++ liblog4cplus-dev 
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name             Version          Architecture Description
+++-================-================-============-======================================================================
ii  g++              4:9.3.0-1ubuntu2 amd64        GNU C++ compiler
ii  liblog4cplus-dev 1.1.2-3.2build1  amd64        C++ logging API modeled after the Java log4j API - development library

详细:

$ g++ main.cpp -llog4cplus --verbose
Using built-in specs.
COLLECT_GCC=/usr/bin/g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-10ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 9.3.0 (Ubuntu 9.3.0-10ubuntu2)
COLLECT_GCC_OPTIONS='-D' '_GLIBCXX_USE_CXX11_ABI=0' '-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-linux-gnu/9/cc1plus -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE -D _GLIBCXX_USE_CXX11_ABI=0 main.cpp -quiet -dumpbase main.cpp -mtune=generic -march=x86-64 -auxbase main -version -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -fcf-protection -o /tmp/ccgtz74p.s
GNU C++14 (Ubuntu 9.3.0-10ubuntu2) version 9.3.0 (x86_64-linux-gnu)
        compiled by GNU C version 9.3.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/9"
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/include-fixed"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/9
 /usr/include/x86_64-linux-gnu/c++/9
 /usr/include/c++/9/backward
 /usr/lib/gcc/x86_64-linux-gnu/9/include
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
GNU C++14 (Ubuntu 9.3.0-10ubuntu2) version 9.3.0 (x86_64-linux-gnu)
        compiled by GNU C version 9.3.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: a3d04a02fbd98a786d710618ca593f02
COLLECT_GCC_OPTIONS='-D' '_GLIBCXX_USE_CXX11_ABI=0' '-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 as -v --64 -o /tmp/ccvqgN1o.o /tmp/ccgtz74p.s
GNU assembler version 2.34 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.34
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-D' '_GLIBCXX_USE_CXX11_ABI=0' '-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-linux-gnu/9/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/9/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper -plugin-opt=-fresolution=/tmp/ccna3Fgp.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/9/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/9 -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/9/../../.. /tmp/ccvqgN1o.o -llog4cplus -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/9/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crtn.o
/tmp/ccvqgN1o.o:main.cpp:function main: error: undefined reference to 'log4cplus::Logger::getInstance(std::string const&)'
collect2: error: ld returned 1 exit status
libraries g++ 20.04
  • 1 个回答
  • 540 Views
Martin Hope
CiaranWelsh
Asked: 2020-07-03 00:54:09 +0800 CST

如何安装与 gcc 10.1 版兼容的 gcov?

  • 3

我正在尝试使用 CLions 接口,gcov但我没有使用默认的 g++ 编译器(适用于 Ubuntu 18.04)。因此我的gcov(7.5) 版本与我的编译器 (10.1) 不兼容。

如何安装gcov它与gcc/一起使用g++ 10.1?

我试过了:

  • sudo apt install gcov
  • sudo apt install gcov-10
  • sudo apt install gcov-dev
gcc compiler 18.04 g++
  • 2 个回答
  • 5094 Views
Martin Hope
Jonathan Fry
Asked: 2020-06-13 11:21:39 +0800 CST

在 X86-64 Ubuntu 20.04 上,为什么我的 32 位可执行文件不是?

  • 0

我正在尝试在 Windows 10 上的 WSL 上运行的 x86_64 Ubuntu 20.04 上构建一个 32 位可执行文件(以查看它是否运行得更快)。如果我在 g++ 中不使用 -m32 选项构建相同的代码,则结果会运行。如果我用 -m32 构建它,它不会。这是完整的序列:

jon@2014Laptop:~/projects/KSolve$ uname --m
x86_64
jon@2014Laptop:~/projects/KSolve$ g++ -m32 -g speeder.cpp Game.cpp KSolve.cpp -I. -o speeder
jon@2014Laptop:~/projects/KSolve$ file speeder
speeder: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV),
 dynamically linked, interpreter /lib/ld-linux.so.2, 
 BuildID[sha1]=3212c37b68b4eb6aec34e957739275dc272ecb86, for GNU/Linux 3.2.0,
 with debug_info, not stripped
jon@2014Laptop:~/projects/KSolve$ ./speeder
-bash: ./speeder: cannot execute binary file: Exec format error

jon@2014Laptop:~/projects/KSolve$
64-bit 32-bit g++ 20.04
  • 1 个回答
  • 1089 Views
Martin Hope
Turtle10000
Asked: 2020-04-30 07:11:50 +0800 CST

将 Ubuntu 升级到 20.04 后,QtCreator 无法识别链接库

  • 6

我已经从 Ubuntu 18.04 升级到 20.04,除了一些讨厌的grub问题之外,大多数东西都是开箱即用的。但是我的 QtCreator ( Qt Creator 4.11.0, Based on Qt 5.12.8 (GCC 9.3.0, 64 bit)) 在识别包含的库时遇到了问题。它在更新前运行良好的项目中显示了数千条错误消息。错误消息看起来都像链接器错误消息。一些例子:

 error: 'std::string' (aka 'int') is not a class, namespace, or enumeration
 error: no matching function for call to 'getline'
 error: member reference base type 'std::ifstream' (aka 'int') is not a structure or union
 error: no template named 'vector' in namespace 'std'
 error: unknown type name 'SystemCallFactory' //this class is from the same  project

甚至 qt 和 std 库中的一些错误:

/usr/include/x86_64-linux-gnu/qt5/QtCore/qstring.h:1374: passing argument to parameter 's' here 
/usr/include/c++/8/ostream:41: candidate found by name lookup is 'std'
  • 问题出现在 cmake 和 qmake 项目中
  • 我确实(并且需要)安装了不同的 gcc 和 g++ 版本(9 和 8)(在更新后重新安装,因为 update-alternatives 设置被破坏并且一个依赖项从 6 升级到 8)

当我在 QtCreator 中创建一个新项目而不更改默认代码的任何内容时,它是相同的:

/home/$me/src/untitled/main.cpp:7: error: variable has incomplete type 'QApplication'`
/home/$me/src/untitled/main.cpp:8: error: unknown type name 'MainWindow'

安装的编译器:

update-alternatives --display gcc
gcc - 自动模式链接最佳版本是 /usr/bin/gcc-8 链接当前指向 /usr/bin/gcc-8 链接 gcc 是 /usr/bin/gcc /usr/bin/gcc -8 - 优先级 30 /usr/bin/gcc-9 - 优先级 20

update-alternatives --display g++ g++ - 自动模式链接最佳版本是 /usr/bin/g++-8 链接当前指向 /usr/bin/g++-8 链接 g++ 是 /usr/bin/g++ /usr/bin/g++ -8 - 优先级 30 /usr/bin/g++-9 - 优先级 20

我仍然可以手动构建所有项目,cmake 和 qmake 都在这里工作。此外,当我在 QtCreator 中设置的构建目录中完成构建时,即使我更改了某些内容,QtCreator 也会构建我的项目。它仍然会在我的代码和该issues部分中显示错误,但无论如何都会构建和运行,所以构建命令应该没问题。但是当构建目录为空时,它会失败。
我该如何进一步解决这个问题?

gcc qt c++ g++ qt-creator
  • 3 个回答
  • 5688 Views
Martin Hope
user122049
Asked: 2019-12-02 05:41:39 +0800 CST

如何在 Ubuntu 18.04 上安装 g++ 10?

  • 47

我想探索由 g++ 10 提供的 C++20 中的概念和其他新功能。但是,我似乎找不到任何资源可以让我在线轻松获得 g++ 10?

我安装 g++10 的最简单方法是什么?

g++
  • 1 个回答
  • 49046 Views
Martin Hope
gator
Asked: 2019-11-13 19:29:18 +0800 CST

如果我有新版本,如何强制使用旧版本的 g++?

  • 4

g++ --version在我的家用机器上读取7.4.0,但我经常在服务器上工作4.8.5。他们的服务器不支持-std=c++11编译器标志,但我的家用机器却支持。它支持的最新标志是-std=c++0x.

但是,有时当我在我的家用机器上编写代码时,使用-std=c++0xflag 编译没有错误,如果我将它带到服务器的本地计算机上,我会得到错误。有趣的是,通过 SSH 连接到他们的服务器并没有出现问题。

我不完全确定该怎么做,我想我的本地机器可能会忽略这个-std=c++0x标志,因为我有一个更新的版本。有没有办法强制一个特定的版本?

如果有什么不同,我使用的是带有 LXSS(Ubuntu)的 Windows 10,而我连接的服务器使用的是 Redhat。

compiling gcc g++
  • 1 个回答
  • 7300 Views
Martin Hope
LvnTrvr
Asked: 2019-10-16 01:46:57 +0800 CST

配置错误“无法确定g++版本”

  • 2

我对使用 Ubuntu(18.04 版)比较陌生,并且正在尝试安装一个软件包以进行研究工作。该包可以从https://github.com/chetzer-ncpa/ncpaprop获得当我尝试运行 ./configure 时,我得到这个作为响应:

checking for bash... /bin/bash
checking for perl... /usr/bin/perl
checking for ranlib... ranlib
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for apt-get... apt-get
configure: enable-auto-dependencies =
configure: enable-library-guess =
checking for g++-4... no
checking for g++... g++
checking for gfortran... gfortran
checking for g++-4... no
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
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 g++ accepts -g... yes
checking for gcc-4... no
checking for gcc... gcc
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 for gfortran... gfortran
checking whether we are using the GNU Fortran compiler... yes
checking whether gfortran accepts -g... yes
checking how to run the C preprocessor... gcc -E
configure: error: in `/home/trevor/Desktop/plz':
configure: error: g++ version cannot be determined
See `config.log' for more details

config.log 文件是:

    This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by NCPA Propagation Modeling Suite configure 1.3.20, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ ./configure 

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

hostname = trevor-VirtualBox
uname -m = x86_64
uname -r = 5.0.0-31-generic
uname -s = Linux
uname -v = #33~18.04.1-Ubuntu SMP Tue Oct 1 10:20:39 UTC 2019

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

/bin/arch              = unknown
/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


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

configure:2288: checking for bash
configure:2306: found /bin/bash
configure:2318: result: /bin/bash
configure:2336: checking for perl
configure:2354: found /usr/bin/perl
configure:2366: result: /usr/bin/perl
configure:2438: checking for ranlib
configure:2454: found /usr/bin/ranlib
configure:2465: result: ranlib
configure:2521: checking build system type
configure:2535: result: x86_64-unknown-linux-gnu
configure:2555: checking host system type
configure:2568: result: x86_64-unknown-linux-gnu
configure:2650: checking for apt-get
configure:2666: found /usr/bin/apt-get
configure:2677: result: apt-get
configure:2698: enable-auto-dependencies = 
configure:2700: enable-library-guess = 
configure:2732: checking for g++-4
configure:2762: result: no
configure:2732: checking for g++
configure:2748: found /usr/bin/g++
configure:2759: result: g++
configure:2885: checking for gfortran
configure:2901: found /usr/bin/gfortran
configure:2912: result: gfortran
configure:3098: checking for g++-4
configure:3128: result: no
configure:3098: checking for g++
configure:3114: found /usr/bin/g++
configure:3125: result: g++
configure:3152: checking for C++ compiler version
configure:3161: g++ --version >&5
g++ (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
Copyright (C) 2017 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:3172: $? = 0
configure:3161: g++ -v >&5
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.4.0-1ubuntu1~18.04.1' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1) 
configure:3172: $? = 0
configure:3161: g++ -V >&5
g++: error: unrecognized command line option '-V'
g++: fatal error: no input files
compilation terminated.
configure:3172: $? = 1
configure:3161: g++ -qversion >&5
g++: error: unrecognized command line option '-qversion'; did you mean '--version'?
g++: fatal error: no input files
compilation terminated.
configure:3172: $? = 1
configure:3192: checking whether the C++ compiler works
configure:3214: g++    conftest.cpp  >&5
configure:3218: $? = 0
configure:3266: result: yes
configure:3269: checking for C++ compiler default output file name
configure:3271: result: a.out
configure:3277: checking for suffix of executables
configure:3284: g++ -o conftest    conftest.cpp  >&5
configure:3288: $? = 0
configure:3310: result: 
configure:3332: checking whether we are cross compiling
configure:3340: g++ -o conftest    conftest.cpp  >&5
configure:3344: $? = 0
configure:3351: ./conftest
configure:3355: $? = 0
configure:3370: result: no
configure:3375: checking for suffix of object files
configure:3397: g++ -c   conftest.cpp >&5
configure:3401: $? = 0
configure:3422: result: o
configure:3426: checking whether we are using the GNU C++ compiler
configure:3445: g++ -c   conftest.cpp >&5
configure:3445: $? = 0
configure:3454: result: yes
configure:3463: checking whether g++ accepts -g
configure:3483: g++ -c -g  conftest.cpp >&5
configure:3483: $? = 0
configure:3524: result: yes
configure:3601: checking for gcc-4
configure:3631: result: no
configure:3601: checking for gcc
configure:3617: found /usr/bin/gcc
configure:3628: result: gcc
configure:3659: checking for C compiler version
configure:3668: gcc --version >&5
gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
Copyright (C) 2017 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:3679: $? = 0
configure:3668: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.4.0-1ubuntu1~18.04.1' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1) 
configure:3679: $? = 0
configure:3668: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:3679: $? = 1
configure:3668: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'; did you mean '--version'?
gcc: fatal error: no input files
compilation terminated.
configure:3679: $? = 1
configure:3683: checking whether we are using the GNU C compiler
configure:3702: gcc -c   conftest.c >&5
configure:3702: $? = 0
configure:3711: result: yes
configure:3720: checking whether gcc accepts -g
configure:3740: gcc -c -g  conftest.c >&5
configure:3740: $? = 0
configure:3781: result: yes
configure:3798: checking for gcc option to accept ISO C89
configure:3861: gcc  -c -g -O2  conftest.c >&5
configure:3861: $? = 0
configure:3874: result: none needed
configure:3947: checking for gfortran
configure:3963: found /usr/bin/gfortran
configure:3974: result: gfortran
configure:4000: checking for Fortran compiler version
configure:4009: gfortran --version >&5
GNU Fortran (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
Copyright (C) 2017 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:4020: $? = 0
configure:4009: gfortran -v >&5
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.4.0-1ubuntu1~18.04.1' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1) 
configure:4020: $? = 0
configure:4009: gfortran -V >&5
gfortran: error: unrecognized command line option '-V'
gfortran: fatal error: no input files
compilation terminated.
configure:4020: $? = 1
configure:4009: gfortran -qversion >&5
gfortran: error: unrecognized command line option '-qversion'; did you mean '--version'?
gfortran: fatal error: no input files
compilation terminated.
configure:4020: $? = 1
configure:4029: checking whether we are using the GNU Fortran compiler
configure:4042: gfortran -c   conftest.F >&5
configure:4042: $? = 0
configure:4051: result: yes
configure:4057: checking whether gfortran accepts -g
configure:4068: gfortran -c -g  conftest.f >&5
configure:4068: $? = 0
configure:4076: result: yes
configure:4110: checking how to run the C preprocessor
configure:4141: gcc -E  conftest.c
configure:4141: $? = 0
configure:4155: gcc -E  conftest.c
conftest.c:9:10: fatal error: ac_nonexistent.h: No such file or directory
 #include <ac_nonexistent.h>
          ^~~~~~~~~~~~~~~~~~
compilation terminated.
configure:4155: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "NCPA Propagation Modeling Suite"
| #define PACKAGE_TARNAME "ncpaprop"
| #define PACKAGE_VERSION "1.3.20"
| #define PACKAGE_STRING "NCPA Propagation Modeling Suite 1.3.20"
| #define PACKAGE_BUGREPORT "claus@olemiss.edu"
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
| #include <ac_nonexistent.h>
configure:4180: result: gcc -E
configure:4200: gcc -E  conftest.c
configure:4200: $? = 0
configure:4214: gcc -E  conftest.c
conftest.c:9:10: fatal error: ac_nonexistent.h: No such file or directory
 #include <ac_nonexistent.h>
          ^~~~~~~~~~~~~~~~~~
compilation terminated.
configure:4214: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "NCPA Propagation Modeling Suite"
| #define PACKAGE_TARNAME "ncpaprop"
| #define PACKAGE_VERSION "1.3.20"
| #define PACKAGE_STRING "NCPA Propagation Modeling Suite 1.3.20"
| #define PACKAGE_BUGREPORT "claus@olemiss.edu"
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
| #include <ac_nonexistent.h>
configure:4248: error: in `/home/trevor/Downloads/ncpaprop-master':
configure:4250: error: g++ version cannot be determined
See `config.log' for more details

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=x86_64-unknown-linux-gnu
ac_cv_c_compiler_gnu=yes
ac_cv_cxx_compiler_gnu=yes
ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_CXXFLAGS_set=
ac_cv_env_CXXFLAGS_value=
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_FCFLAGS_set=
ac_cv_env_FCFLAGS_value=
ac_cv_env_FC_set=
ac_cv_env_FC_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_fc_compiler_gnu=yes
ac_cv_host=x86_64-unknown-linux-gnu
ac_cv_objext=o
ac_cv_path_BASHPATH=/bin/bash
ac_cv_path_PERLPATH=/usr/bin/perl
ac_cv_prog_CPP='gcc -E'
ac_cv_prog_CXX_TEST=g++
ac_cv_prog_FC_TEST=gfortran
ac_cv_prog_PACKMAN=apt-get
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_ac_ct_CXX=g++
ac_cv_prog_ac_ct_FC=gfortran
ac_cv_prog_ac_ct_RANLIB=ranlib
ac_cv_prog_cc_c89=
ac_cv_prog_cc_g=yes
ac_cv_prog_cxx_g=yes
ac_cv_prog_fc_g=yes

## ----------------- ##
## Output variables. ##
## ----------------- ##

AWK=''
BASHPATH='/bin/bash'
CC='gcc'
CFLAGS='-g -O2'
CPP='gcc -E'
CPPFLAGS=''
CXX='g++'
CXXFLAGS='-g -O2'
CXX_TEST='g++'
DEFS=''
DORUFLAGS=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EXEEXT=''
FC='gfortran'
FCFLAGS='-g -O2'
FC_TEST='gfortran'
GREP=''
INCLUDEFLAGS=''
LDFLAGS=''
LIBOBJS=''
LIBS=''
LTLIBOBJS=''
MPICXX=''
OBJEXT='o'
PACKAGE_BUGREPORT='claus@olemiss.edu'
PACKAGE_NAME='NCPA Propagation Modeling Suite'
PACKAGE_STRING='NCPA Propagation Modeling Suite 1.3.20'
PACKAGE_TARNAME='ncpaprop'
PACKAGE_URL=''
PACKAGE_VERSION='1.3.20'
PACKMAN='apt-get'
PATH_SEPARATOR=':'
PERLPATH='/usr/bin/perl'
PETSC_ARCH_COMPLEX=''
PETSC_ARCH_REAL=''
PETSC_DIR=''
PETSC_OS=''
PETSC_USE_MPI=''
PETSC_USE_SHARED_LIBRARIES='--with-shared-libraries'
PETSC_VERSION=''
POW_LIB=''
RANLIB='ranlib'
SHELL='/bin/bash'
SLEPC_DIR=''
SLEPC_USE_MPI=''
SLEPC_VERSION=''
STATICLIBS=''
ac_ct_CC='gcc'
ac_ct_CXX='g++'
ac_ct_FC='gfortran'
bindir='${exec_prefix}/bin'
build='x86_64-unknown-linux-gnu'
build_alias=''
build_cpu='x86_64'
build_os='linux-gnu'
build_vendor='unknown'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host='x86_64-unknown-linux-gnu'
host_alias=''
host_cpu='x86_64'
host_os='linux-gnu'
host_vendor='unknown'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='NONE'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME "NCPA Propagation Modeling Suite"
#define PACKAGE_TARNAME "ncpaprop"
#define PACKAGE_VERSION "1.3.20"
#define PACKAGE_STRING "NCPA Propagation Modeling Suite 1.3.20"
#define PACKAGE_BUGREPORT "claus@olemiss.edu"
#define PACKAGE_URL ""

configure: exit 1

对此的任何见解都将非常有帮助。

gcc configure g++
  • 1 个回答
  • 2294 Views
Martin Hope
Vale
Asked: 2019-10-11 04:55:46 +0800 CST

g++ 无法编译

  • 2
make[2]: /usr/bin/g++-5: Command not found
CMakeFiles/uwlib.dir/build.make:62: recipe for target 'CMakeFiles/uwlib.dir/src/EvoLogics/command.cpp.o' failed
make[2]: *** [CMakeFiles/uwlib.dir/src/EvoLogics/command.cpp.o] Error 127
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/uwlib.dir/all' failed
make[1]: *** [CMakeFiles/uwlib.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

我无法解决这个问题。我试图删除g++并重新安装它,但它不起作用。

g++
  • 1 个回答
  • 219 Views
Martin Hope
Alexander Stohr
Asked: 2019-07-26 07:33:49 +0800 CST

如何使用 apt 和 gpg 从防火墙后面将 gcc/gpp 6 到 9 安装到 Xenial 系统上?

  • 1

我尝试让 Ubuntu 16.04 (xenial) 的编译器高于 gcc/gpp-5。

我将这些行添加到 /etc/apt/sources.list

deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial main
deb-src http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial main

deb http://ppa.launchpad.net/jonathonf/gcc/ubuntu xenial main
deb-src http://ppa.launchpad.net/jonathonf/gcc/ubuntu xenial main

之后运行“apt update”时,我得到了这个:

Err:9 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial InRelease
 The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 1E9377A2BA9EF27F
Err:16 http://ppa.launchpad.net/jonathonf/gcc/ubuntu xenial InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 8CF63AD3F06FC659

然后我尝试添加键:

# apt-key adv --keyserver keyserver.ubuntu.com --recv-key 1E9377A2BA9EF27F
Executing: /tmp/tmp.hQqulW3vSQ/gpg.1.sh --keyserver
keyserver.ubuntu.com
--recv-key
1E9377A2BA9EF27F
> gpg: requesting key BA9EF27F from hkp server keyserver.ubuntu.com
gpgkeys: key 1E9377A2BA9EF27F not found on keyserver
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0
gpg: keyserver communications error: key not found
gpg: keyserver communications error: bad public key
gpg: keyserver receive failed: bad public key

# apt-key adv --keyserver keyserver.ubuntu.com --recv-key 8CF63AD3F06FC659
Executing: /tmp/tmp.9sbMVJgRDb/gpg.1.sh --keyserver
keyserver.ubuntu.com
--recv-key
8CF63AD3F06FC659
gpg: requesting key F06FC659 from hkp server keyserver.ubuntu.com
gpgkeys: key 8CF63AD3F06FC659 not found on keyserver
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0
gpg: keyserver communications error: key not found
gpg: keyserver communications error: bad public key
gpg: keyserver receive failed: bad public key

如何简单地为该平台获取一组更新的编译器?

我发现在防火墙后面很难实现这样的目标。标准食谱不起作用,甚至“sudo -E”对我来说都失败了。而且我目前不知道如何改进 apt-* 工具集的调试打印。

gnupg proxy gcc 16.04 g++
  • 1 个回答
  • 735 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve