compile HDK under OSX

   3750   2   2
User Avatar
Member
288 posts
Joined: July 2005
Offline
I tried to compile standalone/geoisosurface.C under OSX, but failed.

hcustom -s geoisosurface.C
Making geoisosurface.o from geoisosurface.C
cc1plus: warning: command line option “-fobjc-gc-only” is valid for ObjC/ObjC++ but not for C++
In file included from geoisosurface.C:10:
geoisosurface.h: In function ‘int main(int, char**)’:
geoisosurface.h:25: error: ‘HDK_Sample’ has not been declared
geoisosurface.C: At global scope:
geoisosurface.C:13: error: ‘HDK_Sample’ is not a namespace-name
geoisosurface.C:13: error: expected namespace-name before ‘;’ token
geoisosurface.C: In function ‘float densityFunction(const UT_Vector3&)’:
geoisosurface.C:16: error: redefinition of ‘float densityFunction(const UT_Vector3&)’
geoisosurface.h:13: error: ‘float densityFunction(const UT_Vector3&)’ previously defined here
geoisosurface.C: In function ‘int main(int, char**)’:
geoisosurface.C:22: error: redefinition of ‘int main(int, char**)’
geoisosurface.h:19: error: ‘int main(int, char**)’ previously defined here
geoisosurface.C:28: error: ‘HDK_Sample’ has not been declared
geoisosurface.h: At global scope:
geoisosurface.h:13: warning: ‘float densityFunction(const UT_Vector3&)’ defined but not used
Compile failed


Also, I tried to use g++ to compile, still fail…

gcc -I$HT/include geoisosurface.C
In file included from /usr/include/c++/4.2.1/backward/iostream.h:31,
from /Library/Frameworks/Houdini.framework/Versions/10.0.401/Resources/toolkit/include/SYS/fpreal16.h:93,
from /Library/Frameworks/Houdini.framework/Versions/10.0.401/Resources/toolkit/include/SYS/SYS_Types.h:72,
from /Library/Frameworks/Houdini.framework/Versions/10.0.401/Resources/toolkit/include/UT/UT_PtrArrayRaw.h:27,
from /Library/Frameworks/Houdini.framework/Versions/10.0.401/Resources/toolkit/include/UT/UT_PtrArray.h:33,
from /Library/Frameworks/Houdini.framework/Versions/10.0.401/Resources/toolkit/include/GU/GU_Detail.h:25,
from geoisosurface.h:10,
from geoisosurface.C:10:
/usr/include/c++/4.2.1/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.
In file included from /Library/Frameworks/Houdini.framework/Versions/10.0.401/Resources/toolkit/include/UT/UT_Math.h:36,
from /Library/Frameworks/Houdini.framework/Versions/10.0.401/Resources/toolkit/include/UT/UT_Matrix3.h:22,
from /Library/Frameworks/Houdini.framework/Versions/10.0.401/Resources/toolkit/include/GU/GU_Detail.h:27,
from geoisosurface.h:10,
from geoisosurface.C:10:
/Library/Frameworks/Houdini.framework/Versions/10.0.401/Resources/toolkit/include/SYS/SYS_Math.h: In function ‘uint SYSpointerHash(const void*)’:
/Library/Frameworks/Houdini.framework/Versions/10.0.401/Resources/toolkit/include/SYS/SYS_Math.h:835: error: cast from ‘const void*’ to ‘uint’ loses precision
In file included from geoisosurface.C:10:
geoisosurface.h: In function ‘int main(int, char**)’:
geoisosurface.h:25: error: ‘HDK_Sample’ has not been declared
geoisosurface.C: At global scope:
geoisosurface.C:13: error: ‘HDK_Sample’ is not a namespace-name
geoisosurface.C:13: error: expected namespace-name before ‘;’ token
geoisosurface.C: In function ‘float densityFunction(const UT_Vector3&)’:
geoisosurface.C:16: error: redefinition of ‘float densityFunction(const UT_Vector3&)’
geoisosurface.h:13: error: ‘float densityFunction(const UT_Vector3&)’ previously defined here
geoisosurface.C: In function ‘int main(int, char**)’:
geoisosurface.C:22: error: redefinition of ‘int main(int, char**)’
geoisosurface.h:19: error: ‘int main(int, char**)’ previously defined here
geoisosurface.C:28: error: ‘HDK_Sample’ has not been declared
^_^
User Avatar
Member
288 posts
Joined: July 2005
Offline
nobody???………..-.-!
^_^
User Avatar
Member
1 posts
Joined: Oct. 2012
Offline
Digging out this old thread because I bumped into this problem too. The code in the documentation is not as complete as the code in the toolkit/samples/standalone directory of your Houdini install. You need to enclose the first function in a namespace block.

namespace HDK_Sample {
}

Also, in Houdini 12 and probably earlier, the ‘true’ statement should be omitted from this line:

gdp.save(“sphere.bgeo”, true, NULL);
  • Quick Links