not-fl3 / bulletrs

Bullet Physics wrapper for the Rust language.
MIT License
49 stars 2 forks source link

unresolved external symbol where running lastest version with nightly rust toolchain #12

Closed jice-nospam closed 6 years ago

jice-nospam commented 6 years ago

The project compiles fine, but when trying to run tests or the sphere example, I've got those messages :

= note: sphere-e1f2b5e66f36c57a.sphere11.rcgu.o : error LNK2019: unresolved external symbol _ZN23btDiscreteDynamicsWorld10setGravityERK9btVector3 referenced in function _ZN8bulletrs8dynamics14dynamics_wor
ld13DynamicsWorld11set_gravity17h6dfe9011ff49dbd9E
          sphere-e1f2b5e66f36c57a.sphere7.rcgu.o : error LNK2019: unresolved external symbol _ZN11btRigidBodyC1ERKNS_27btRigidBodyConstructionInfoE referenced in function _ZN12bulletrs_sys25bt_bullet_dynami
cs_common11btRigidBody3new17h73dc4f8ea432745eE
          sphere-e1f2b5e66f36c57a.sphere7.rcgu.o : error LNK2019: unresolved external symbol _ZN11btTransform11getIdentityEv referenced in function _ZN12bulletrs_sys25bt_bullet_dynamics_common11btTransform1
1getIdentity17h19dcbfb13d508ed8E
          sphere-e1f2b5e66f36c57a.sphere7.rcgu.o : error LNK2019: unresolved external symbol _ZN11btTransformC1ERK12btQuaternionRK9btVector3 referenced in function _ZN12bulletrs_sys25bt_bullet_dynamics_comm
on11btTransform4new117h3750f03df7fecd87E
          sphere-e1f2b5e66f36c57a.sphere7.rcgu.o : error LNK2019: unresolved external symbol _ZN18btStaticPlaneShapeC1ERK9btVector3d referenced in function _ZN12bulletrs_sys25bt_bullet_dynamics_common18btSt
aticPlaneShape3new17had7d48954551de4aE
          sphere-e1f2b5e66f36c57a.sphere7.rcgu.o : error LNK2019: unresolved external symbol _ZN20btDefaultMotionStateC1ERK11btTransformS2_ referenced in function _ZN12bulletrs_sys25bt_bullet_dynamics_commo
n20btDefaultMotionState3new17hada6c57be2ab72c8E
          sphere-e1f2b5e66f36c57a.sphere7.rcgu.o : error LNK2019: unresolved external symbol _ZN11btRigidBody27btRigidBodyConstructionInfoC1EdP13btMotionStateP16btCollisionShapeRK9btVector3 referenced in fu
nction _ZN12bulletrs_sys25bt_bullet_dynamics_common39btRigidBody_btRigidBodyConstructionInfo3new17hfe8288feb2624be6E

Might this be an issue with the version of Visual Studio I'm using ? I'm using nightly-x86_64-pc-windows-msvc rust toolchain.

vitvakatu commented 6 years ago

AFAIK mvsc uses different ABI, so it's probably the reason. I'm not sure though

not-fl3 commented 6 years ago

@vitvakatu exactly.

According to this: https://github.com/rust-lang-nursery/rust-bindgen/issues/849, thiscall calling convention, used by msvc, is not yet implemented in rust.

So bindgen could generate bindings with --target=i686-pc-windows-msvc, but you will need some very nightly rust(not sure that it even exist) to use it. And anyway it will require a lot of work on rust side.

I decided to focus on gcc version and wait for bindgen and rustc improvements.

For now, I see only 2 options for you:

I really like the new c++ version, it's so much powerful and controllable, so I am into the second option :)

jice-nospam commented 6 years ago

yeah, I really like the new version too. I have a few pull requests in the pipe. You can check them here. Only can't test them right now :) Ok, trying to switch to gnu toolchain

jice-nospam commented 6 years ago

yeah, works fine with x86_64-pc-windows-gnu! closing this issue