tboox / tbox

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

Hope tbox supports more compilation tools #265

Closed WangZhongDian closed 2 months ago

WangZhongDian commented 2 months 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 2 months ago

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

WangZhongDian commented 2 months ago

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

Issues-translate-bot commented 2 months ago

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


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

waruqi commented 2 months ago

-lm

WangZhongDian commented 2 months ago

Thank you very much, you can now work normally.