Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

怎么编译tbox Android版本动态库 #8

Open
hcrow110 opened this issue Aug 9, 2017 · 1 comment
Open

怎么编译tbox Android版本动态库 #8

hcrow110 opened this issue Aug 9, 2017 · 1 comment
Labels

Comments

@hcrow110
Copy link

hcrow110 commented Aug 9, 2017

xmake f -p android --ndk=...--mode="debug" --kind="shared"
xmake
编译还是 .a的静态库。

修改 ./src/xmake.lua 文件 set_kind("shared")

xmake 出错:
[100%]: linking.debug libtbox.so
error: d:/android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/w
indows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-a
ndroideabi/bin/ld.exe: error: build\.objs\tbox\src\tbox\platform\android\
backtrace.c.o: multiple definition of 'tb_backtrace_frames'
d:/android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-
x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androide
abi/bin/ld.exe: build\.objs\tbox\src\tbox\platform\backtrace.c.o: previous
definition here
d:/android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-
x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androide
abi/bin/ld.exe: error: build\.objs\tbox\src\tbox\platform\android\backtra
ce.c.o: multiple definition of 'tb_backtrace_symbols_init'
d:/android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-
x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androide
abi/bin/ld.exe: build\.objs\tbox\src\tbox\platform\backtrace.c.o: previous
definition here
d:/android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-
x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androide
abi/bin/ld.exe: error: build\.objs\tbox\src\tbox\platform\android\backtra
ce.c.o: multiple definition of 'tb_backtrace_symbols_name'
d:/android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-
x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androide
abi/bin/ld.exe: build\.objs\tbox\src\tbox\platform\backtrace.c.o: previous
definition here
d:/android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-
x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androide
abi/bin/ld.exe: error: build\.objs\tbox\src\tbox\platform\android\backtra
ce.c.o: multiple definition of 'tb_backtrace_symbols_exit'
d:/android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-
.....

@waruqi
Copy link
Member

waruqi commented Aug 9, 2017

tbox由于提供的接口太多,暂时不提供动态库哦,你可以写个so,把libtbox.a链接进来后,自己封装下,导出自己需要的一些模块接口。。

而且编译android的so,也是需要导出jni接口的,一般我在android上用,也是自己写个jni的so库,在jni的导出接口里面使用tbox,然后静态链接libtbox.a到jni的so

@waruqi waruqi added the question label Aug 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants