Jump to content

hcustom error with SIM_SolverBullet


Recommended Posts

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...