阿波茨的鹅 2024-11-01 10:30 采纳率: 100%
浏览 47
已结题

Boost库编译出错。

问题遇到的现象和发生背景

Linux 安装Boost库,本地编译产生的问题;

username@TNV:boost_1_69_0$ ./bootstrap.sh 
Building Boost.Build engine with toolset gcc... 
Failed to build Boost.Build build engine
Consult 'bootstrap.log' for more details

bootstrap.log显示如下:


###
### Using 'gcc' toolset.
###
rm -rf bootstrap
mkdir bootstrap
gcc -o bootstrap/jam0 command.c compile.c constants.c debug.c execcmd.c frames.c function.c glob.c hash.c hdrmacro.c headers.c jam.c jambase.c jamgram.c lists.c make.c make1.c object.c option.c output.c parse.c pathsys.c regexp.c rules.c scan.c search.c subst.c timestamp.c variable.c modules.c strings.c filesys.c builtins.c class.c cwd.c native.c md5.c w32_getreg.c modules/set.c modules/path.c modules/regex.c modules/property-set.c modules/sequence.c modules/order.c execunix.c fileunix.c pathunix.c
function.c: In functionint expand_modifiers(STACK*, int)’:
function.c:837:30: error: invalid conversion from ‘void*’ to ‘LIST** {aka _list**}’ [-fpermissive]
     LIST * * args = stack_get( s );
                     ~~~~~~~~~^~~~~
function.c:843:41: error: invalid conversion from ‘void*’ to ‘VAR_EDITS*’ [-fpermissive]
         VAR_EDITS * out = stack_allocate( s, total * sizeof( VAR_EDITS ) );
                           ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function.c:844:41: error: invalid conversion from ‘void*’ to ‘OBJECT*** {aka _object***}’ [-fpermissive]
         LISTITER * iter = stack_allocate( s, n * sizeof( LIST * ) );
                           ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from jam.h:512:0,
                 from function.c:9:
function.c: In function ‘JAM_FUNCTION* compile_to_function(compiler*)’:
mem.h:69:36: error: invalid conversion from ‘void*’ to ‘JAM_FUNCTION* {aka _jam_function*}’ [-fpermissive]
     #define bjam_malloc_x(s) malloc(s)
                              ~~~~~~^~~
mem.h:116:28: note: in expansion of macro ‘bjam_malloc_x’
     #define BJAM_MALLOC(s) bjam_malloc_x(s)
                            ^~~~~~~~~~~~~
function.c:1526:35: note: in expansion of macro ‘BJAM_MALLOC’
     JAM_FUNCTION * const result = BJAM_MALLOC( sizeof( JAM_FUNCTION ) );
                                   ^~~~~~~~~~~
mem.h:69:36: error: invalid conversion from ‘void*’ to ‘instruction*’ [-fpermissive]
     #define bjam_malloc_x(s) malloc(s)
                              ~~~~~~^~~
mem.h:116:28: note: in expansion of macro ‘bjam_malloc_x’
     #define BJAM_MALLOC(s) bjam_malloc_x(s)
                            ^~~~~~~~~~~~~
function.c:1536:20: note: in expansion of macro ‘BJAM_MALLOC’
     result->code = BJAM_MALLOC( c->code->size * sizeof( instruction ) );
                    ^~~~~~~~~~~
mem.h:69:36: error: invalid conversion from ‘void*’ to ‘OBJECT** {aka _object**}’ [-fpermissive]
     #define bjam_malloc_x(s) malloc(s)
                              ~~~~~~^~~
mem.h:116:28: note: in expansion of macro ‘bjam_malloc_x’
     #define BJAM_MALLOC(s) bjam_malloc_x(s)
                            ^~~~~~~~~~~~~
function.c:1539:25: note: in expansion of macro ‘BJAM_MALLOC’
     result->constants = BJAM_MALLOC( c->constants->size * sizeof( OBJECT * ) );
                         ^~~~~~~~~~~
mem.h:69:36: error: invalid conversion from ‘void*’ to ‘SUBFUNCTION* {aka _subfunction*}’ [-fpermissive]
     #define bjam_malloc_x(s) malloc(s)
                              ~~~~~~^~~
mem.h:116:28: note: in expansion of macro ‘bjam_malloc_x’
     #define BJAM_MALLOC(s) bjam_malloc_x(s)
                            ^~~~~~~~~~~~~
function.c:1545:25: note: in expansion of macro ‘BJAM_MALLOC’
     result->functions = BJAM_MALLOC( c->rules->size * sizeof( SUBFUNCTION ) );
                         ^~~~~~~~~~~
mem.h:69:36: error: invalid conversion from ‘void*’ to ‘SUBACTION* {aka _subaction*}’ [-fpermissive]
     #define bjam_malloc_x(s) malloc(s)
                              ~~~~~~^~~
mem.h:116:28: note: in expansion of macro ‘bjam_malloc_x’
     #define BJAM_MALLOC(s) bjam_malloc_x(s)
                            ^~~~~~~~~~~~~
function.c:1557:23: note: in expansion of macro ‘BJAM_MALLOC’
     result->actions = BJAM_MALLOC( c->actions->size * sizeof( SUBACTION ) );
                       ^~~~~~~~~~~
function.c: In function ‘VAR_PARSE_GROUP* var_parse_group_new()’:
mem.h:69:36: error: invalid conversion from ‘void*’ to ‘VAR_PARSE_GROUP*’ [-fpermissive]
     #define bjam_malloc_x(s) malloc(s)
                              ~~~~~~^~~
mem.h:116:28: note: in expansion of macro ‘bjam_malloc_x’
     #define BJAM_MALLOC(s) bjam_malloc_x(s)
                            ^~~~~~~~~~~~~
function.c:1624:38: note: in expansion of macro ‘BJAM_MALLOC’
     VAR_PARSE_GROUP * const result = BJAM_MALLOC( sizeof( VAR_PARSE_GROUP ) );
                                      ^~~~~~~~~~~
function.c: In function ‘VAR_PARSE_VAR* var_parse_var_new()’:
mem.h:69:36: error: invalid conversion from ‘void*’ to ‘VAR_PARSE_VAR*’ [-fpermissive]
     #define bjam_malloc_x(s) malloc(s)
                              ~~~~~~^~~
mem.h:116:28: note: in expansion of macro ‘bjam_malloc_x’
     #define BJAM_MALLOC(s) bjam_malloc_x(s)
                            ^~~~~~~~~~~~~
function.c:1701:30: note: in expansion of macro ‘BJAM_MALLOC’
     VAR_PARSE_VAR * result = BJAM_MALLOC( sizeof( VAR_PARSE_VAR ) );
                              ^~~~~~~~~~~
function.c: In function ‘FUNCTION* function_builtin(LIST* (*)(FRAME*, int), int, const char**)’:
mem.h:69:36: error: invalid conversion from ‘void*’ to ‘BUILTIN_FUNCTION* {aka _builtin_function*}’ [-fpermissive]
     #define bjam_malloc_x(s) malloc(s)
                              ~~~~~~^~~
mem.h:116:28: note: in expansion of macro ‘bjam_malloc_x’
     #define BJAM_MALLOC(s) bjam_malloc_x(s)
                            ^~~~~~~~~~~~~
function.c:2991:33: note: in expansion of macro ‘BJAM_MALLOC’
     BUILTIN_FUNCTION * result = BJAM_MALLOC( sizeof( BUILTIN_FUNCTION ) );
                                 ^~~~~~~~~~~
function.c: In function ‘arg_list arg_compile_impl(argument_compiler*, OBJECT*, int)’:
mem.h:69:36: error: invalid conversion from ‘void*’ to ‘argument*’ [-fpermissive]
     #define bjam_malloc_x(s) malloc(s)
                              ~~~~~~^~~
mem.h:116:28: note: in expansion of macro ‘bjam_malloc_x’
     #define BJAM_MALLOC(s) bjam_malloc_x(s)
                            ^~~~~~~~~~~~~
function.c:3419:19: note: in expansion of macro ‘BJAM_MALLOC’
     result.args = BJAM_MALLOC( c->args->size * sizeof( struct argument ) );
                   ^~~~~~~~~~~
function.c: In function ‘arg_list* arg_list_compile(PARSE*, int*)’:
mem.h:69:36: error: invalid conversion from ‘void*’ to ‘arg_list*’ [-fpermissive]
     #define bjam_malloc_x(s) malloc(s)
                              ~~~~~~^~~
mem.h:116:28: note: in expansion of macro ‘bjam_malloc_x’
     #define BJAM_MALLOC(s) bjam_malloc_x(s)
                            ^~~~~~~~~~~~~
function.c:3477:18: note: in expansion of macro ‘BJAM_MALLOC’
         result = BJAM_MALLOC( c->args->size * sizeof( struct arg_list ) );
                  ^~~~~~~~~~~
function.c: In function ‘arg_list* arg_list_compile_builtin(const char**, int*)’:
mem.h:69:36: error: invalid conversion from ‘void*’ to ‘arg_list*’ [-fpermissive]
     #define bjam_malloc_x(s) malloc(s)
                              ~~~~~~^~~
mem.h:116:28: note: in expansion of macro ‘bjam_malloc_x’
     #define BJAM_MALLOC(s) bjam_malloc_x(s)
                            ^~~~~~~~~~~~~
function.c:3517:18: note: in expansion of macro ‘BJAM_MALLOC’
         result = BJAM_MALLOC( c->args->size * sizeof( struct arg_list ) );
                  ^~~~~~~~~~~
function.c: In function ‘FUNCTION* function_bind_variables(FUNCTION*, module_t*, int*)’:
mem.h:69:36: error: invalid conversion from ‘void*’ to ‘JAM_FUNCTION* {aka _jam_function*}’ [-fpermissive]
     #define bjam_malloc_x(s) malloc(s)
                              ~~~~~~^~~
mem.h:116:28: note: in expansion of macro ‘bjam_malloc_x’
     #define BJAM_MALLOC(s) bjam_malloc_x(s)
                            ^~~~~~~~~~~~~
function.c:3633:35: note: in expansion of macro ‘BJAM_MALLOC’
         JAM_FUNCTION * new_func = BJAM_MALLOC( sizeof( JAM_FUNCTION ) );
                                   ^~~~~~~~~~~
mem.h:69:36: error: invalid conversion from ‘void*’ to ‘instruction*’ [-fpermissive]
     #define bjam_malloc_x(s) malloc(s)
                              ~~~~~~^~~
mem.h:116:28: note: in expansion of macro ‘bjam_malloc_x’
     #define BJAM_MALLOC(s) bjam_malloc_x(s)
                            ^~~~~~~~~~~~~
function.c:3641:26: note: in expansion of macro ‘BJAM_MALLOC’
         new_func->code = BJAM_MALLOC( func->code_size * sizeof( instruction ) );
                          ^~~~~~~~~~~
function.c: In function ‘LIST* function_run(FUNCTION*, FRAME*, STACK*)’:
function.c:4784:49: error: invalid conversion from ‘void*’ to ‘LIST** {aka _list**}’ [-fpermissive]
             LIST * * const stack_pos = stack_get( s );
                                        ~~~~~~~~~^~~~~
function.c:4785:52: error: invalid conversion from ‘void*’ to ‘expansion_item*’ [-fpermissive]
             expansion_item * items = stack_allocate( s, buffer_size );
操作环境、软件版本等信息

- root@TNV:/usr/bin# cat /proc/version
Linux version 4.15.18 (root@ubuntu) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.11)) #12 SMP Sun Apr 28 16:32:48 CST 2019

尝试过的解决方法
  • 下载的安装包没有问题,用过其他版本的依然会出现此问题;
  • gcc版本 gcc-7
我想要达到的结果

完成boost库的编译安装。恳请了解情况的兄弟给予帮助。

  • 写回答

9条回答 默认 最新

  • churuxu 2024-11-01 10:51
    关注

    试一下

    1. 不要编译boost,直接安装boost,例如 sudo apt-get install libboost-all-dev
    2. 安装个最新的ubuntu操作系统
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(8条)

报告相同问题?

问题事件

  • 系统已结题 11月9日
  • 已采纳回答 11月1日
  • 创建了问题 11月1日