seth_ro18 Posted July 22, 2009 Share Posted July 22, 2009 I am trying to compile the SIM_SolverBullet dll with hcustom, but I get the following error: Creating library SIM_SolverBullet.lib and object SIM_SolverBullet.exp SIM_SolverBullet.o : error LNK2019: unresolved external symbol "__declspec(dllim port) public: float __thiscall SIM_BulletData::getCollisionMargin(void)const " ( __imp_?getCollisionMargin@SIM_BulletData@@QBEMXZ) referenced in function "protec ted: virtual class std::_Tree<class std::_Tmap_traits<int,struct bulletBodystr,s truct std::less<int>,class std::allocator<struct std::pair<int const ,struct bul letBodystr> >,0> >::iterator __thiscall SIM_SolverBullet::addBulletBody(class SI M_Object *)" It created the .o and .lib files, but somewhere it's adding a __declspec(dllimport) call to the .o file that apparently I do not want. I compiled Bullet with Visual Studio 8 and hcustom is pointing to all the proper libraries. Any ideas where the problem might lie? Thanks! Quote Link to comment Share on other sites More sharing options...
seth_ro18 Posted July 27, 2009 Author Share Posted July 27, 2009 Looks like in SIM_API.h (within the Houdini toolkit), I had to comment out the __declspec lines, since hcustom did not seem to like them. #if defined(WIN32) && !defined(MAKING_STATIC) #ifdef EXPORT_SIM #define SIM_API //__declspec(dllexport) #else #define SIM_API //__declspec(dllimport) #endif Now it compiles the dll. Quote Link to comment Share on other sites More sharing options...
Jason Posted July 27, 2009 Share Posted July 27, 2009 Well done on solving the problem. I wonder why this is a problem? Looks like in SIM_API.h (within the Houdini toolkit), I had to comment out the __declspec lines, since hcustom did not seem to like them. #if defined(WIN32) && !defined(MAKING_STATIC) #ifdef EXPORT_SIM #define SIM_API //__declspec(dllexport) #else #define SIM_API //__declspec(dllimport) #endif Now it compiles the dll. Quote Link to comment Share on other sites More sharing options...
malexander Posted July 28, 2009 Share Posted July 28, 2009 Classes within external HDK libraries shouldn't have the *_API macro applied to them. This macro is only for internal Houdini libraries. ie, the correct code is: class SIM_SolverBullet : public ... (and not) class SIM_API SIM_SolverBullet : public ... You should revert the SIM_API.h changes after the above change. Quote Link to comment Share on other sites More sharing options...
seth_ro18 Posted July 28, 2009 Author Share Posted July 28, 2009 Thanks, that clears things up. My fix did feel a bit too hacky. Classes within external HDK libraries shouldn't have the *_API macro applied to them. This macro is only for internal Houdini libraries. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.