tboox / tbox

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

Hope tbox supports more compilation tools #265

Closed WangZhongDian closed 1 month ago

WangZhongDian commented 1 month ago

Current situation

I'm not sure if tbox can only be integrated through xmake, but when I installed it using xmake source code and tried to compile a demo using gcc, I got the following error

/bin/ld: /tmp/ccgXEPCN.o: in function `main':
main.c:(.text+0x28): undefined reference to `tb_init_'
/bin/ld: main.c:(.text+0x51): undefined reference to `tb_trace_done'
/bin/ld: main.c:(.text+0x56): undefined reference to `tb_exit'
collect2: error: ld returned 1 exit status

However, the installation documentation was compiled and used with xmake to obtain the correct results

platform

Installation command

xmake
xmake install

hope

Finally, thank you very much for your efforts and dedication

waruqi commented 1 month ago

you need add -ltbox flags to linker. I don't know how do you use it in your project.

WangZhongDian commented 1 month ago

@waruqi 截图 2024-09-15 20-44-42

Issues-translate-bot commented 1 month ago

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


@waruqi 截图 2024-09-15 20-44-42

waruqi commented 1 month ago

-lm

WangZhongDian commented 1 month ago

Thank you very much, you can now work normally.