Re: [问题] kubuntu x86_64编译错误 变量重复定义

楼主: holishing   2021-12-17 01:38:23
新版的 gcc 会严格限制 multiple definition
所以在 Ubuntu Focal 或 Debian Bullseye 会遇到编译错误 (以前只会警告)
两种解法:
第一种是在编译参数加上 -fcommon (让它允许重复定义)
第二种是把重复定义删掉,例如参考以下修改:
https://github.com/bbsdocker/imageptt/blob/87c0ec3c/multipledef.patch
应该就可以编译过了
※ 引述《knko ()》之铭言:
:
:
:
:
: 我在使用kubuntu(x86_64)编译此套软件时执行pmake all install时发现错误,原因是/u
: sr/bin/ld: /tmp/writemoney-42e226.o:/home/bbs/pttbbs/util/writemoney.c:5: multip
: le definition of `now'; util_var.o:/home/bbs/pttbbs/util/../mbbsd/var.c:374: fir
: st defined here,是于pttbbs.conf中有加入#define SHMALIGNEDSIZE (1048576*4)
: #define TIMET64,似乎是为重复定义但是我不确定是软件还是我设定的问题,我使用的版
: 本最后的编辑是https://github.com/ptt/pttbbs/commit/576513c502a9bf5fcfa08ae52ee94
: ed0c67be608
:
:

Links booklink

Contact Us: admin [ a t ] ucptt.com