tboox / tbox

🎁 A glib-like multi-platform c library
https://docs.tboox.org
Apache License 2.0
4.84k stars 719 forks source link

在Gitee Go的linux平台上构建链接出错,缺少add_syslinks("m") #231

Closed da-liii closed 1 year ago

da-liii commented 1 year ago

注:提问题时若使用不能用/没效果/有问题/报错此类模糊表达,但又没有根据下面的模板给出任何相关辅助信息的,将绝对不会有任何反馈。

描述问题

xmake config失败,安装tbox dev在链接demo的阶段失败

期待的结果

xmake config成功

错误信息

[2023-08-30 23:05:22] > /usr/bin/g++ -o /tmp/.xmake0/230830/_46243D59621B4F108FA2943ED05E8440.b /tmp/.xmake0/230830/_46243D59621B4F108FA2943ED05E8440.o -m64 -L/root/.xmake/packages/t/tbox/dev/7120a2256037488eba888d3e75fde43f/lib -ltbox -lpthread
[2023-08-30 23:05:22] /usr/bin/ld: /root/.xmake/packages/t/tbox/dev/7120a2256037488eba888d3e75fde43f/lib/libtbox.a(sqrtf.c.o): in function `tb_sqrtf':
[2023-08-30 23:05:22] sqrtf.c:(.text+0x5): undefined reference to `sqrtf'
[2023-08-30 23:05:22] collect2: error: ld returned 1 exit status

相关环境

其他信息

https://gitee.com/XmacsLabs/lolly/gitee_go/pipelines/builds/1232020/stages/2255972/jobs/2901053/view

Issues-translate-bot commented 1 year ago

Bot detected the issue body's language is not English, translate it automatically.


Title: Error building link on Gitee Go's linux platform, missing add_syslinks("m")

Note: If you use vague expressions such as unable/no effect/problem/error when asking a question, but do not give any relevant auxiliary information according to the template below, there will be absolutely no feedback.

Describe the problem

Please describe the problem you are encountering as clearly and precisely as possible.

Expected results

Please describe your desired outcome as clearly and precisely as possible.

Error message

If possible, please try to attach the error output information during the running of the program.

Related environment

Please provide compilation and runtime environment information.

other information

Please provide any additional information to help us diagnose the problem.

waruqi commented 1 year ago

你这个错误跟 tbox 没啥关系,是安装 tbox 包的配置里面 on_test 检测 tb_exit 尝试编译时候,缺 -lm

包的配置问题,得改包 而不是改 tbox/demo

Issues-translate-bot commented 1 year ago

Bot detected the issue body's language is not English, translate it automatically.


Your error has nothing to do with tbox. It is because the on_test detection tb_exit in the configuration of the tbox package is missing -lm when trying to compile.

Package configuration problem, you have to change the package instead of tbox/demo

waruqi commented 1 year ago

https://github.com/xmake-io/xmake-repo/pull/2540

waruqi commented 1 year ago

再试试

xrepo update-repo

Issues-translate-bot commented 1 year ago

Bot detected the issue body's language is not English, translate it automatically.


try again

xrepo update-repo

da-liii commented 1 year ago

https://gitee.com/XmacsLabs/lolly/gitee_go/pipelines?tab=history&uuid=292650&displayName=ci-linux&queryType=BRANCH&filterType=triggerUserId

Still error

waruqi commented 1 year ago

linux 上我试了,可以的,-lm 也加上了。

仓库更新了么。

hecking for gcc ... /usr/bin/gcc
checking for the c compiler (cc) ... gcc
checking for flags (-fPIC) ... ok
> gcc "-fPIC" "-m64"
> /usr/bin/gcc -c -m64 -std=c99 -isystem /home/ruki/.xmake/packages/t/tbox/dev/7120a2256037488eba888d3e75fde43f/include -o /tmp/.xmake999/230831/_DCE8E5567C6A4B10875B0EAE2CE91540.o /tmp/.xmake999/230831/_302B6C47B7E64FF98E0D0C7234CBD3B7.c
checking for flags (-fdiagnostics-color=always) ... ok
> gcc "-fdiagnostics-color=always" "-m64"
checking for g++ ... /usr/bin/g++
checking for the linker (ld) ... g++
checking for /usr/bin/g++ ... ok
checking for flags (-fPIC) ... ok
> g++ "-fPIC" "-m64" "-m64"
> /usr/bin/g++ -o /tmp/.xmake999/230831/_DCE8E5567C6A4B10875B0EAE2CE91540.b /tmp/.xmake999/230831/_DCE8E5567C6A4B10875B0EAE2CE91540.o -m64 -L/home/ruki/.xmake/packages/t/tbox/dev/7120a2256037488eba888d3e75fde43f/lib -ltbox -lpthread -lm -ldl
> checking for c includes(tbox/tbox.h)
> checking for c funcs(tb_exit)
> checking for c links(tbox, pthread, m, dl)
> checking for c snippet(has_cfuncs)
  => install tbox dev .. ok
da-liii commented 1 year ago

可以了,之前我用了自定义的XMAKE_REPO,所以还是出错

Issues-translate-bot commented 1 year ago

Bot detected the issue body's language is not English, translate it automatically.


It's ok, I used a custom XMAKE_REPO before, so I still got an error