小编bjo*_*ude的帖子

ARM 交叉编译 boost 1.69.0

尝试在 WSL Debian 中交叉编译 boost 1.69.0 我在没有 icu 或 python 支持的情况下运行 bootstrap.sh 。添加后

使用 gcc:arm:arm-linux-gnueabihf-g++;

运行时出现project-config.jam以下错误./b2 install

Performing configuration checks

- default address-model    : 32-bit
- default architecture     : arm
error: No best alternative for libs/context/build/asm_sources
next alternative: required properties: <abi>aapcs <address-model>32 <architecture>arm <binary-format>elf <threading>multi <toolset>clang
    not matched
Run Code Online (Sandbox Code Playgroud)

它持续了好几行。

  1. 那里出了什么问题?
  2. 由于我无法直接在目标系统上构建,因为它没有足够的硬盘,您建议如何解决此错误?
  3. 是否有我不知道的预编译 libboost 1.69?

boost arm cross-compiling beagleboneblack

6
推荐指数
1
解决办法
6133
查看次数

在派生类中添加虚拟说明符

考虑以下代码:

struct virtualfoo 
{
    virtualfoo{};
    virtual ~virtualfoo{};

    virtual double doStuff() = 0
};


struct realbar :  virtualfoo   
{
     realbar{};
     virtual ~realbar{};

     virtual double doStuff();
};
Run Code Online (Sandbox Code Playgroud)

因为我想实现doStuff()realbar,虚拟的是不是强制性的.但如果我做对了,那么将虚拟说明符放在旁边也不会有害realbar::doStuff(),是吗?使用/不使用虚拟可以获得哪些副作用?

c++ virtual inheritance class

3
推荐指数
1
解决办法
243
查看次数

getopt 中的 opterr 声明

以下是来自http://www.gnu.org的示例代码。大多数人肯定会看到,它是 getopt,我对变量声明有疑问。为什么前面没有写任何类型或任何东西

opterr = 0;
Run Code Online (Sandbox Code Playgroud)

我以前从未见过这样的情况。

#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

int
main (int argc, char **argv)
{
  int aflag = 0;
  int bflag = 0;
  char *cvalue = NULL;
  int index;
  int c;

  opterr = 0;


  while ((c = getopt (argc, argv, "abc:")) != -1)
    switch (c)
      {
      case 'a':
        aflag = 1;
        break;
      case 'b':
        bflag = 1;
        break;
      case 'c':
        cvalue = optarg;
        break;
      case '?':
        if (optopt == 'c')
          fprintf (stderr, …
Run Code Online (Sandbox Code Playgroud)

c getopt

3
推荐指数
1
解决办法
2829
查看次数

标签 统计

arm ×1

beagleboneblack ×1

boost ×1

c ×1

c++ ×1

class ×1

cross-compiling ×1

getopt ×1

inheritance ×1

virtual ×1