我试图在项目中使用Bullet Physics引擎,并且在链接过程中遇到问题。
该符号不可用(链接器错误):
“” void * __cdecl btAlignedAllocInternal(unsigned __int64,int)“(?btAlignedAllocInternal @@ YAPEAX_KH @ Z)” in Funktion“” public:静态void * __cdecl btCollisionObject :: operator new(unsigned __int64)“(?? 2btCollisionObject @@ SAPEAX_ @Z)”
我用了
E:\ SDKs \ bullet-2.82-r2704 \ lib> dumpbin / symbols BulletDynamics.lib | findstr / R /
C:“ btAlignedAllocInternal”
检查符号是否可用,结果:
17F 00000000 UNDEF notype()外部|
?btAlignedAllocInternal @@ YAPAXIH @Z(无效* __cdecl
btAlignedAllocInternal(unsigned int,int))121 00000000 UNDEF notype
()外部| ?btAlignedAllocInternal @@ YAPAXIH @Z(无效*
__cdecl btAlignedAllocInternal(unsigned int,int))07A 00000000 UNDEF notype()外部| ?btAlignedAllocInternal @@ YAPAXIH @Z(无效
* __cdecl btAlignedAllocInternal(unsigned int,int))0AF 00000000 UNDEF notype()外部| ?btAlignedAllocInternal @@ YAPAXIH @Z(无效
* __cdecl btAlignedAllocInternal(unsigned int,int))0B6 00000000 UNDEF notype()外部| ?btAlignedAllocInternal @@ YAPAXIH @Z(无效
* __cdecl btAlignedAllocInternal(unsigned int,int))07F 00000000 UNDEF notype()外部| ?btAlignedAllocInternal @@ YAPAXIH @Z(无效
* __cdecl btAlignedAllocInternal(unsigned int,int))308 00000000 UNDEF notype()外部| ?btAlignedAllocInternal @@ YAPAXIH @Z(无效
* __cdecl btAlignedAllocInternal(unsigned int,int))16B 00000000 UNDEF notype()外部| ?btAlignedAllocInternal @@ YAPAXIH @Z(无效
* __cdecl btAlignedAllocInternal(unsigned int,int))279 00000000 UNDEF notype()外部| ?btAlignedAllocInternal @@ YAPAXIH @Z(无效
* __cdecl btAlignedAllocInternal(unsigned int,int))2C7 00000000 UNDEF notype()外部| ?btAlignedAllocInternal @@ YAPAXIH @Z(无效
* __cdecl btAlignedAllocInternal(unsigned int,int))3C6 00000000 UNDEF notype()外部| ?btAlignedAllocInternal @@ YAPAXIH @Z(无效
* __cdecl btAlignedAllocInternal(unsigned int,int))249 00000000 UNDEF notype()外部| ?btAlignedAllocInternal @@ YAPAXIH @Z(无效
* __cdecl btAlignedAllocInternal(unsigned int,int))675 00000000 UNDEF notype()外部| ?btAlignedAllocInternal @@ YAPAXIH @Z(无效
* __cdecl btAlignedAllocInternal(unsigned int,int))39E 00000000 UNDEF notype()外部| ?btAlignedAllocInternal @@ YAPAXIH @Z(无效
* __cdecl btAlignedAllocInternal(unsigned int,int))24D 00000000 UNDEF notype()外部| ?btAlignedAllocInternal @@ YAPAXIH @Z(无效
* __cdecl btAlignedAllocInternal(unsigned int,int))
对我来说,该符号似乎不可用(不匹配变形的名称),但是我不得不承认,我实际上不知道如何创建变形的符号名称。
您能解释一下YAPAXIH和YAPEAX_KH之间的区别吗?
还是有人有其他建议可能出什么问题?
最佳答案
名称修饰对于MSVC而言似乎相当晦涩。我使用demangler.com并得到以下信息:
为?btAlignedAllocInternal @@ YAPEAX_KH @ Z
无效* __ptr64 __cdecl btAlignedAllocInternal(unsigned __int64,int)
为?btAlignedAllocInternal @@ YAPAXIH @ Z
无效* __cdecl btAlignedAllocInternal(unsigned int,int)
函数定义是
void* btAlignedAllocInternal(size_t size, int alignment);
这清楚地表明存在x64 / x86问题。实际上,bullet是使用x86构建的。