syntax error when compiling with UT_DSOVersion.h

   7690   6   0
User Avatar
Member
26 posts
Joined: March 2008
Offline
Hello!

I am trying to compile a DSO within VS, and when compiling I get a syntax error from the UT_DSOVersion.h file.


Houdini8.2\Houdini 8.2.238\toolkit\include\UT\UT_DSOVersion.h(26) : error C2144: syntax error : ‘void’ should be preceded by ‘;’

Houdini8.2\Houdini 8.2.238\toolkit\include\UT\UT_DSOVersion.h(26) : error C2501: ‘DLLEXPORT’ : missing storage-class or type specifiers

Houdini8.2\Houdini 8.2.238\toolkit\include\UT\UT_DSOVersion.h(27) : error C2144: syntax error : ‘void’ should be preceded by ‘;’

Houdini8.2\Houdini 8.2.238\toolkit\include\UT\UT_DSOVersion.h(27) : error C2086: ‘int DLLEXPORT’ : redefinition

Houdini8.2\Houdini 8.2.238\toolkit\include\UT\UT_DSOVersion.h(26) : see declaration of ‘DLLEXPORT’


If I check inside that specific header file, the errors points to:

extern “C” {
DLLEXPORT void HoudiniDSOVersion(char **version_string);
DLLEXPORT void HoudiniGetTagInfo(char **version_string);


I have added the libUT.a lib to the project, include paths and so, still this comes up. Do I need to declare something specific to get this to work?

I have been able to compile other projects using HDK (altough not SOP projects).


If I move all the includes from the header file to the cpp file, I get the same error messages, but in the VEX_VexOp.h file instead.

extern “C” {
DLLEXPORT extern void newVEXOp(void *);
}
You cant recycle wasted time
User Avatar
Member
85 posts
Joined: July 2005
Offline
Which version of Windows are you using?
Cause all my SOPs will compile fine with WinXP 32bits.
User Avatar
Member
26 posts
Joined: March 2008
Offline
Which version of Windows are you using?
Cause all my SOPs will compile fine with WinXP 32bits.

That is strange. I use WinXP 32-bits with Houdini 8.2 aswell.

Do you include any special libs, makefiles or anything in your VS?
You cant recycle wasted time
User Avatar
Staff
4456 posts
Joined: July 2005
Offline
Are you using hcustom to do your compiling? Or are you trying to do this within the visual studio environment with a build system set up from scratch? If the latter, make sure you are using the C++ compiler, not the C compiler.

Mark
User Avatar
Member
26 posts
Joined: March 2008
Offline
Are you using hcustom to do your compiling? Or are you trying to do this within the visual studio environment with a build system set up from scratch? If the latter, make sure you are using the C++ compiler, not the C compiler.

I am working from Visual Studio and trying to compile from there.
Hmmm. That could be a reason..

It works to compile from hcustom, but then my other libs doesnt compile.

I will check which compiler I use in VS.

Thanks!




I have checked my VS and it is set to “Compile as C++ Code (/TP)”, if that was what you meant.
You cant recycle wasted time
User Avatar
Staff
4456 posts
Joined: July 2005
Offline
Okay, as long as you can copmile with hcustom there is nothing _too_ serious going wrong It's now just a matter of making sure you've set up VS to have all the same settings that hcustom uses.

The most likely problem is that “DLLEXPORT” isn't defined. But there are a lot of symbols that hcustom defines on the command line to the compiler which you'll need to copy over to your VS setup to make sure everything compiles correctly. So I would suggest running:

hcustom -d $HT/samples/SOP/SOP_Star.C

This will have hcustom print out all the options it passes to the compiler. Make sure that in VS you set up all the defines set by hcustom (using the -D option). On my machine I see the following symbols:
-DVERSION=“9.5.50”
-DI386
-DWIN32
-DSWAP_BITFIELDS
-DDLLEXPORT=__declspec(dllexport)
-DSESI_LITTLE_ENDIAN
-DMAKING_DSO

Hope this helps,
Mark
User Avatar
Member
26 posts
Joined: March 2008
Offline
Ohyeah, adding “-DDLLEXPORT=__declspec(dllexport) ” to the commandline in VS sure did the trick! Thanks alot!

Its good to know this, incase any other issue comes along later.
thanks for the information, I really appreciate it!
You cant recycle wasted time
  • Quick Links