作者knko ()
看板PttCurrent
标题Re: [问题] kubuntu x86_64编译错误 变数重复定义
时间Fri Dec 17 17:45:37 2021
我试过pmake clean install、bmake clean install,同时也加入选项 -fcommon,pmake -
fcommon clean install,我找到bmake的手册,bmake 的 -f 选项是用於makefile的选择,
而我最後试了 -i 参数成功,感谢帮忙
※ 引述《holishing ( )》之铭言
: 新版的 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: mu
: ltip
: : 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/576513c502a9bf5fcfa08ae52
: ee94
: : ed0c67be608
: :
: : ----
: : Sent from BePTT on my Samsung SM-M127F
----
Sent from
BePTT on my Samsung SM-M127F
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 150.117.157.24 (台湾)
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/PttCurrent/M.1639734340.A.012.html
※ 编辑: knko (150.117.157.24 台湾), 12/17/2021 17:48:14
1F:推 holishing: 编译参数不是这样加, 找出 Makefile 以及 include 内容 12/18 17:15
2F:→ holishing: 里面的 CFLAGS / CPPFLAGS 後,再加你要加的编译参数 12/18 17:16
4F:→ holishing: 例如在上面连结的第 33 行末加上参数 12/18 17:17