首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >编译器错误报告对./配置过于苛刻

编译器错误报告对./配置过于苛刻
EN

Stack Overflow用户
提问于 2017-08-02 12:55:30
回答 1查看 2.9K关注 0票数 1

因此,我正试图为CFW任天堂3DS编写一个家用应用程序。我是在Linux 18.2上做的。编译器无法编译某些必需的依赖项。

下面是编译器的代码:

代码语言:javascript
复制
#!/bin/sh
set -ex

mkdir -p build

# Install libarchive and libmpg123 for host
apt-get update
apt-get -y install libarchive-dev libmpg123-dev

# Install libarchive for 3ds
git clone https://github.com/Cruel/3ds_portlibs.git
cd 3ds_portlibs
make zlib
make install-zlib
make libarchive
make install

# Install libmpg123 for 3ds
wget -O libmpg123-dev.tar.gz  https://notabug.org/attachments/216a6d61-f167-4f65-84dc-fa98c2247fc1
tar -xaf libmpg123-dev.tar.gz -C $DEVKITPRO/portlibs/3ds

cd ../build
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_EMULATOR=ON -DBUILD_TESTS=ON ..
make -j4

下面是我得到的输出错误:

代码语言:javascript
复制
+ mkdir -p build
+ apt-get update
Ign:1 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:2 http://dl.google.com/linux/chrome/deb stable Release
Hit:3 http://archive.ubuntu.com/ubuntu xenial InRelease
Hit:4 http://deb.torproject.org/torproject.org xenial InRelease
Hit:7 http://ppa.launchpad.net/alessandro-strada/ppa/ubuntu xenial InRelease
Get:8 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Hit:9 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:10 http://ppa.launchpad.net/jonathonf/ffmpeg-3/ubuntu xenial InRelease
Hit:6 http://screenshots.getdeb.net xenial-getdeb InRelease
Get:11 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]
Ign:12 http://packages.linuxmint.com sonya InRelease
Hit:13 http://packages.linuxmint.com sonya Release
Hit:15 http://archive.canonical.com/ubuntu xenial InRelease
Fetched 204 kB in 5s (38.6 kB/s)
Reading package lists...
+ apt-get -y install libarchive-dev libmpg123-dev
Reading package lists...
Building dependency tree...
Reading state information...
libmpg123-dev is already the newest version (1.22.4-1).
libarchive-dev is already the newest version (3.2.1-2~ubuntu16.04.1).
0 upgraded, 0 newly installed, 0 to remove and 100 not upgraded.
+ git clone https://github.com/Cruel/3ds_portlibs.git
Cloning into '3ds_portlibs'...
+ cd 3ds_portlibs
+ CFLAGS=-m64
+ make zlib
wget -O zlib-1.2.8.tar.gz "http://prdownloads.sourceforge.net/libpng/zlib-1.2.8.tar.gz"
--2017-08-02 08:47:03--  http://prdownloads.sourceforge.net/libpng/zlib-1.2.8.tar.gz
Resolving prdownloads.sourceforge.net (prdownloads.sourceforge.net)... 216.34.181.59
Connecting to prdownloads.sourceforge.net (prdownloads.sourceforge.net)|216.34.181.59|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://downloads.sourceforge.net/project/libpng/zlib/1.2.8/zlib-1.2.8.tar.gz [following]
--2017-08-02 08:47:03--  http://downloads.sourceforge.net/project/libpng/zlib/1.2.8/zlib-1.2.8.tar.gz
Resolving downloads.sourceforge.net (downloads.sourceforge.net)... 216.34.181.59
Connecting to downloads.sourceforge.net (downloads.sourceforge.net)|216.34.181.59|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://versaweb.dl.sourceforge.net/project/libpng/zlib/1.2.8/zlib-1.2.8.tar.gz [following]
--2017-08-02 08:47:04--  https://versaweb.dl.sourceforge.net/project/libpng/zlib/1.2.8/zlib-1.2.8.tar.gz
Resolving versaweb.dl.sourceforge.net (versaweb.dl.sourceforge.net)... 104.238.205.251
Connecting to versaweb.dl.sourceforge.net (versaweb.dl.sourceforge.net)|104.238.205.251|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 571091 (558K) [application/x-gzip]
Saving to: ‘zlib-1.2.8.tar.gz’

2017-08-02 08:47:04 (1.95 MB/s) - ‘zlib-1.2.8.tar.gz’ saved [571091/571091]

Using ar
Checking for arm-none-eabi-gcc...
Compiler error reporting is too harsh for ./configure (perhaps remove -Werror).
** ./configure aborting.
Makefile:195: recipe for target 'zlib' failed
make: *** [zlib] Error 1

我还注意到,如果删除关于zlib的行,则会得到一个不同的错误:

代码语言:javascript
复制
+ export CPP3DS=/home/eddy/Documents/FreeShop/cpp3ds
+ for dev in ''\''arc13'\'''
+ cd /home/eddy/Documents/FreeShop/arc13/freeshop
+ for dx in '"3ds_portlibs"' '"build"'
+ '[' -d 3ds_portlibs ']'
+ rm -r 3ds_portlibs
+ for dx in '"3ds_portlibs"' '"build"'
+ '[' -d build ']'
+ rm -r build
+ mkdir -p build
+ export CC=arm-none-eabi-gcc
+ CC=arm-none-eabi-gcc
+ export CXX=arm-none-eabi-g++
+ CXX=arm-none-eabi-g++
+ apt-get update
Ign:1 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:2 http://deb.torproject.org/torproject.org xenial InRelease
Hit:3 http://dl.google.com/linux/chrome/deb stable Release
Ign:4 http://packages.linuxmint.com sonya InRelease
Hit:5 http://packages.linuxmint.com sonya Release
Hit:6 http://ppa.launchpad.net/alessandro-strada/ppa/ubuntu xenial InRelease
Hit:7 http://archive.ubuntu.com/ubuntu xenial InRelease
Hit:8 http://security.ubuntu.com/ubuntu xenial-security InRelease
Hit:12 http://archive.canonical.com/ubuntu xenial InRelease
Hit:13 http://ppa.launchpad.net/jonathonf/ffmpeg-3/ubuntu xenial InRelease
Hit:14 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:10 http://screenshots.getdeb.net xenial-getdeb InRelease
Hit:15 http://archive.ubuntu.com/ubuntu xenial-backports InRelease
Reading package lists...
+ apt-get -y install libarchive-dev libmpg123-dev
Reading package lists...
Building dependency tree...
Reading state information...
libmpg123-dev is already the newest version (1.22.4-1).
libarchive-dev is already the newest version (3.2.1-2~ubuntu16.04.1).
0 upgraded, 0 newly installed, 0 to remove and 103 not upgraded.
+ git clone https://github.com/Cruel/3ds_portlibs.git
Cloning into '3ds_portlibs'...
+ cd 3ds_portlibs
+ make CC=DEVKITPRO
Please choose one of the following targets:
  freetype (requires zlib to be installed)
  libexif
  libjpeg-turbo
  libpng (requires zlib to be installed)
  sqlite
  zlib
  mxml
  expat
  libxml2
  jansson
  physfs (requires zlib to be installed)
  libmad
  libogg
  libvorbis (requires libogg to be installed)
  giflib
  libconfig
  bzip2
  xz
  libarchive
  nettle
  wslay
+ make libarchive
wget -O libarchive-3.1.2.tar.gz "http://www.libarchive.org/downloads/libarchive-3.1.2.tar.gz"
--2017-08-02 16:36:34--  http://www.libarchive.org/downloads/libarchive-3.1.2.tar.gz
Resolving www.libarchive.org (www.libarchive.org)... 2600:9000:2025:5a00:16:e6b0:f440:93a1, 2600:9000:2025:fe00:16:e6b0:f440:93a1, 2600:9000:2025:2600:16:e6b0:f440:93a1, ...
Connecting to www.libarchive.org (www.libarchive.org)|2600:9000:2025:5a00:16:e6b0:f440:93a1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4527540 (4.3M) [application/x-gzip]
Saving to: ‘libarchive-3.1.2.tar.gz’

2017-08-02 16:36:40 (54.6 MB/s) - ‘libarchive-3.1.2.tar.gz’ saved [4527540/4527540]

patching file libarchive/archive_ppmd7.c
patching file libarchive/archive_read_disk_posix.c
patching file libarchive/archive_write_disk_posix.c
patching file libarchive/archive_write_set_format_iso9660.c
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-none-eabi-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... arm-none-eabi
checking for arm-none-eabi-gcc... arm-none-eabi-gcc
checking whether the C compiler works... no
configure: error: in `/home/eddy/Documents/FreeShop/arc13/freeshop/3ds_portlibs/libarchive-3.1.2':
configure: error: C compiler cannot create executables
See `config.log' for more details
Makefile:274: recipe for target 'libarchive' failed
make: *** [libarchive] Error 77

从错误判断,我似乎正在编译一个64位系统上的ARM应用程序,由于这个原因,它失败了。但是,我需要编译ARM的源代码,因为它应该安装在任天堂3DS上。为了编译应用程序,我如何修复这个错误?

编辑:我尝试为root设置编译器,得到了以下错误:

代码语言:javascript
复制
-- Check for working C compiler: /opt/devkitPro/devkitARM/bin/arm-none-eabi-gcc -- broken
CMake Error at /usr/share/cmake-3.5/Modules/CMakeTestCCompiler.cmake:61 (message):
  The C compiler "/opt/devkitPro/devkitARM/bin/arm-none-eabi-gcc" is not able
  to compile a simple test program.

  It fails with the following output:

   Change Dir: /home/eddy/Documents/FreeShop/arc13/freeshop/build/CMakeFiles/CMakeTmp



  Run Build Command:"/usr/bin/make" "cmTC_ef3eb/fast"

  /usr/bin/make -f CMakeFiles/cmTC_ef3eb.dir/build.make
  CMakeFiles/cmTC_ef3eb.dir/build

  make[1]: Entering directory
  '/home/eddy/Documents/FreeShop/arc13/freeshop/build/CMakeFiles/CMakeTmp'

  Building C object CMakeFiles/cmTC_ef3eb.dir/testCCompiler.c.o

  /opt/devkitPro/devkitARM/bin/arm-none-eabi-gcc -o
  CMakeFiles/cmTC_ef3eb.dir/testCCompiler.c.o -c
  /home/eddy/Documents/FreeShop/arc13/freeshop/build/CMakeFiles/CMakeTmp/testCCompiler.c


  Linking C executable cmTC_ef3eb

  /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_ef3eb.dir/link.txt
  --verbose=1

  /opt/devkitPro/devkitARM/bin/arm-none-eabi-gcc
  CMakeFiles/cmTC_ef3eb.dir/testCCompiler.c.o -o cmTC_ef3eb -rdynamic

  arm-none-eabi-gcc: error: unrecognized command line option '-rdynamic'

  CMakeFiles/cmTC_ef3eb.dir/build.make:97: recipe for target 'cmTC_ef3eb'
  failed

  make[1]: *** [cmTC_ef3eb] Error 1

  make[1]: Leaving directory
  '/home/eddy/Documents/FreeShop/arc13/freeshop/build/CMakeFiles/CMakeTmp'

  Makefile:126: recipe for target 'cmTC_ef3eb/fast' failed

  make: *** [cmTC_ef3eb/fast] Error 2





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:7 (project)


-- Configuring incomplete, errors occurred!
See also "/home/eddy/Documents/FreeShop/arc13/freeshop/build/CMakeFiles/CMakeOutput.log".
See also "/home/eddy/Documents/FreeShop/arc13/freeshop/build/CMakeFiles/CMakeError.log".

我也得到了这个错误:

代码语言:javascript
复制
-- strip: /opt/devkitPro/devkitARM/bin/arm-none-eabi-strip - found
-- 3dslink: /opt/devkitPro/devkitARM/bin/3dslink - found
-- Looking for Picasso...
-- Picasso: /opt/devkitPro/devkitARM/bin/picasso - found
-- Looking for nihstro...
-- nihstro - not found
CMake Error at /home/eddy/Documents/FreeShop/cpp3ds/cmake/template_emu/CMakeLists.txt:1 (find_package):
  By not providing "FindQt5Widgets.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "Qt5Widgets", but CMake did not find one.

  Could not find a package configuration file provided by "Qt5Widgets" with
  any of the following names:

    Qt5WidgetsConfig.cmake
    qt5widgets-config.cmake

  Add the installation prefix of "Qt5Widgets" to CMAKE_PREFIX_PATH or set
  "Qt5Widgets_DIR" to a directory containing one of the above files.  If
  "Qt5Widgets" provides a separate development package or SDK, be sure it has
  been installed.


-- Configuring incomplete, errors occurred!
See also "/home/eddy/Documents/FreeShop/arc13/freeshop/build/CMakeFiles/CMakeOutput.log".
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-08-02 13:01:24

这个问题看来,它似乎失败了,因为它找不到一个有效的编译器。

您需要下载一个交叉编译器,以便在另一个体系结构上编译代码。您可以按照问题中的步骤获得ARM编译器,然后./configure脚本可以自己工作(看起来它正在寻找交叉编译器),或者您可以使用例如:

代码语言:javascript
复制
export CC=arm-linux-gnueabi-gcc
export CXX=arm-linux-gnueabi-g++

...before运行./configure来设置构建系统的编译器(假设它遵守CC约定)。

如果这不起作用,您可能需要特定的DS交叉编译器,而不仅仅是泛型ARM编译器。如果您还没有看到本站,那么可能值得一看,看看它们的devkitARM是否提供了您需要的交叉编译器。

编辑:如果仔细查看新输出,您将看到make CC=DEVKITPRO。这是直接以make集作为编译器调用DEVKITPRO,在此之前重写任何更改编译器的尝试。

您应该确保DEVKITPRO二进制文件可以从您的PATH中访问--打开一个终端并键入DEVKITPRO,看看是否可以执行它,或者没有找到它。如果找不到,请检查上面提到的devkitARM页面上的说明,以确保您按照他们的预期安装了它,特别是Linux安装说明中的echo "export DEVKITPRO=/opt/devkitPro" >> ~/.bashrc行。

编辑编辑:有一个库和工具包的列表这里。查看项目的安装页面,查找任何依赖项,并跟踪它们并安装它们。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45461498

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档