[Sidefx-houdini-list] HDK --- Splitting Into Classes

Rob Pieké rob-p at moving-picture.com
Fri Feb 22 04:44:25 EST 2008


Unless something has changed recently, hcustom is only useful for 
compiling plugins where there's a one-to-one match between the number of 
source files and target DSOs.

In particular, it contains:

foreach file ( $* )
     set ONAME  = ${file:r}.o
     if ( "$STANDALONE" == "" ) then
	set SONAME = ${INSTDIR}/${file:r}.so
	setenv CFLAGS "$BASE_CFLAGS -DMAKING_DSO -o $ONAME"
	if ( "$ECHOCOMMANDS" == "" ) then
	    echo Making $ONAME and $SONAME from $file
	endif
	hcompile $HCOMPILEOPTIONS $HC_OPT $file
	if ($status == 1) then
	    echo Compile failed
	    exit 1
	endif
	if ( "$ECHOCOMMANDS" != "" ) then
	    echo
	    echo $CC $SHARED $ONAME $LFLAGS -o $SONAME
	endif
	$CC $SHARED $ONAME $LFLAGS -o $SONAME
     else
	...
end

You can see how, for each source file, it compiles the object file and 
then immediately the DSO. It is, however, quite easy to restructure this 
to create all the object files and, outside of the loop, link them all 
into a single DSO.

If you need more information on this, just shout :)

But, yeah, I think this is something everyone using the HDK goes through 
sooner or later ... making a myHCustom copy of hcustom and modifying it 
to support multi-source DSOs.

Cheers!

- Rob


> I am creating an HDK Sop. First I wrote it in a single class. But as the code is growing, I want to split it in multiple logical classes.
> While compiling I am giving all class cpp file against hcustom command.
> They get compiled  properly and generate different object files.
> But how to link them in a single so file ??? Because, when I try to use the  node, Houdini crashes saying , undefined symbol : XYZ(My Helper class Name).
> So my main class gets compiled and embedded properly, but not other classes. I coudn't find option in hcustom command for the same.




More information about the Sidefx-houdini-list mailing list