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

hookzz编译成静态库,但是和源码链接时错误 #58

Closed
WalkingAlone-David opened this issue Jul 10, 2019 · 3 comments
Closed

Comments

@WalkingAlone-David
Copy link

平台 Android
NDK Version: ndkr16b

描述

使用cmkae正常编译出32bit静态库libhookzz.a。但链接静态库时,编译器显示错误。

错误日志:

\HookZz-dev\srcxx\InterceptRoutingPlugin\FunctionInlineReplace/FunctionInlineReplaceExport.cc:0: error: undefined reference to 'LOGFUNC'
\HookZz-dev\.\OneLib\stdcxx\stdcxx/LiteMutableArray.h:20: error: undefined reference to 'LiteMutableArray::initWithCapacity(unsigned int)'
\HookZz-dev\srcxx/Interceptor.cpp:0: error: undefined reference to 'vtable for LiteMutableArray'

arm-linux-androideabi/bin\ld: the vtable symbol may be undefined because the class is missing its key function

\HookZz-dev\srcxx/Interceptor.cpp:20: error: undefined reference to 'LiteCollectionIterator::withCollection(LiteCollection const*)'
\HookZz-dev\srcxx\InterceptRouting/InterceptRouting.cpp:31: error: undefined reference to '_memcpy(void*, void const*, int)'
\HookZz-dev\.\OneLib\stdcxx\stdcxx/LiteMutableBuffer.h:26: error: undefined reference to 'LiteMutableBuffer::initWithCapacity(int)'
\HookZz-dev\.\srcxx\core/modules/assembler/assembler-arm.h:0: error: undefined reference to 'vtable for LiteMutableBuffer'

ld: the vtable symbol may be undefined because the class is missing its key function

trampoline-arm.cc:vtable for CodeBuffer: error: undefined reference to 'LiteObject::init()'
trampoline-arm.cc:vtable for CodeBuffer: error: undefined reference to 'LiteObject::free()'
trampoline-arm.cc:vtable for CodeBuffer: error: undefined reference to 'LiteObject::release()'
trampoline-arm.cc:vtable for CodeBuffer: error: undefined reference to 'LiteMutableBuffer::ensureCapacity(int)'
trampoline-arm.cc:vtable for CodeBuffer: error: undefined reference to 'LiteMutableBuffer::initWithCapacity(int)'
trampoline-arm.cc:typeinfo for CodeBufferBase: error: undefined reference to 'typeinfo for LiteMutableBuffer'

\srcxx\core/modules/assembler/assembler-arm.h:0: error: undefined reference to 'LOGFUNC'
libhookzz.a(AssemblyCode.cc.o):AssemblyCode.cc:vtable for zz::AssemblyCode: error: undefined reference to 'LiteObject::init()'
libhookzz.a(AssemblyCode.cc.o):AssemblyCode.cc:vtable for zz::AssemblyCode: error: undefined reference to 'LiteObject::free()'
libhookzz.a(AssemblyCode.cc.o):AssemblyCode.cc:vtable for zz::AssemblyCode: error: undefined reference to 'LiteObject::release()'
libhookzz.a(AssemblyCode.cc.o):AssemblyCode.cc:typeinfo for zz::AssemblyCode: error: undefined reference to 'typeinfo for LiteObject'

.\OneLib\stdcxx\stdcxx/LiteMutableArray.h:16: error: undefined reference to 'LiteMutableArray::initWithCapacity(unsigned int)'

srcxx\ExecMemory/ExecutableMemoryArena.cc:26: error: undefined reference to 'LiteCollectionIterator::withCollection(LiteCollection const*)'
.\OneLib\stdcxx\stdcxx/LiteMutableArray.h:20: error: undefined reference to 'LiteMutableArray::initWithCapacity(unsigned int)'
srcxx\ExecMemory/ExecutableMemoryArena.cc:0: error: undefined reference to 'vtable for LiteMutableArray'

arm-linux-androideabi/bin\ld: the vtable symbol may be undefined because the class is missing its key function

srcxx\ExecMemory/ExecutableMemoryArena.cc:0: error: undefined reference to 'LOGFUNC'
srcxx\ExecMemory/ExecutableMemoryArena.cc:0: error: undefined reference to 'vtable for LiteMutableArray'
arm-linux-androideabi/bin\ld: the vtable symbol may be undefined because the class is missing its key function

\HookZz-dev\srcxx\ExecMemory\CodeBuffer/CodeBufferBase.cc:40: error: undefined reference to '_memcpy(void*, void const*, int)'
\HookZz-dev\srcxx\InstructionRelocation\arm/ARMInstructionRelocation.cc:0: error: undefined reference to 'LOGFUNC'
\HookZz-dev\srcxx\InstructionRelocation\arm/ARMInstructionRelocation.cc:529: error: undefined reference to 'LiteCollectionIterator::withCollection(LiteCollection const*)'
\HookZz-dev\srcxx\InstructionRelocation\arm/ARMInstructionRelocation.cc:597: error: undefined reference to 'LiteCollectionIterator::withCollection(LiteCollection const*)'


clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)
@Pancts
Copy link

Pancts commented Oct 18, 2019

需要把logging和stdcxx也加上

@jmpews
Copy link
Owner

jmpews commented Oct 20, 2019

是的. 请把 logging + stdcxx 也加上.

@jmpews jmpews closed this as completed Oct 20, 2019
@zhangxy123666
Copy link

我也遇到这个问题了 但是提示是 error: undefined reference to 'ZzReplace'
logging stdcxx都加了

@Lamfi Lamfi mentioned this issue Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants