Jump to content

Compile Hdk With Another Sdk


Recommended Posts

So I am working on a exporter for Virtools filetype (*.nmo). For this I need to link both the HDK and the Virtools SDK.

Creating a *.C file and compile it with only HDK functions/code it works fine. When creating something for Virtools I use Visual Studio 2003.

So both of these SDK's works fine side by side. But now the problems begin; I need to use both of them at the same time.

To compile Virtools functions, I need to include some libs in VS (Additional dependencies and Additional Library Directories).

So I thought that I could work with both of these SDK's from within VS (since both are compiled with VS2003) and after linking libs and headers

from the HDK, it does compile, but if I try to set for example GU_Detail *gd = new GU_Detail(); ( or GU_Detail gd; )

then I get a linker error:

LINK : error LNK2020: unresolved token (0A00000B) GU_Detail.__dtor
LINK : fatal error LNK1120: 1 unresolved externals

And what I can understand is that it complaints about the destructor in GU_Detail.h (which is a virtual function).

I am linking to the "custom\houdini\dsolib" lib folder, I am using

#include <stdlib.h>

#include <fstream.h>

#include <UT/UT_Vector4.h>

#include <GU/GU_Detail.h>

to get the functions, but it doesnt want to compile.

So I thought that I have to do it from the HDK point of view. Writing in a *.C file and link the Virtools libs and functions to the file.

but working from that, I still get some errors:

error LNK2019: unresolved external symbol "__declspec(dllimport) pub
lic: __thiscall XString::~XString(void)" (__imp_??1XString@@QAE@XZ) referenced i
n function "public: void * __thiscall XString::`vector deleting destructor'(unsi
gned int)" (??_EXString@@QAEPAXI@Z)

nmosave.o : error LNK2019: unresolved external symbol "__declspec(dllimport) voi
d __cdecl VxDeleteAligned(void *)" (__imp_?VxDeleteAligned@@YAXPAX@Z) referenced
 in function "protected: void __thiscall XArray&lt;int,0&gt;::Free(void)" (?Free@?$XAr
ray@H$0A@@@IAEXXZ)
./nmosave.exe : fatal error LNK1120: 2 unresolved externals

So my questions are:

Can you link libs and headers in a way as you would setting it up it in VS (Additional dependencies and Additional Library Directories)

in a *.C file that HDK can compile?

Can you run the HDK from within VS at all, or must you run through the cmd (hcustom) to compile it?

At the moment, it seems that they dont want to work side by side, atleast in the way I have tried.

Unless there is a way, that I havent found, or are aware of.

And make a exporter that exports from Houdini and then a converter that converts it to a *.nmo file would work, but

then the whole point of using a exporter disappears, since I can then use the obj exporter instead.

Link to comment
Share on other sites

Offhand, if all your libs are compiled using the same compiler and -MD setting, then it should work fine. My guess is that you're missing some required compiler/linker setting. The easiest way to figure that out is by looking at $HFS/toolkit/makefiles/Makefile.nmake and Makefile.win. hcustom is no longer required for a while now.

Link to comment
Share on other sites

[My guess is that you're missing some required compiler/linker setting]

Yeah, it turns out you have to manually link all the needed libs in Visual Studio in the "Additional Dependencies" box (Properties->Linker->Input).

I was trying to use a Directory link, which obviously didnt work.

Yeah, good idea to update the wiki FAQ. There are probably alot more people wondering about this than just me.

Thanks for your input!

Edited by CodeMasterMike
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...