Jump to content
Sign in to follow this  

Recommended Posts

Hello everybody,

 

i am currently in the process of trying to generate a Visual Studio project that successfully builds Houdini plugins and later on create a cmake file to regenerate it.

I looked at all tutorials i could find but am now stuck on a strange issue.

 

Problem:

The compilation process inside VS simply stops during the object creation stage for SOP_Star.C at this point:

................
1>..\..\source\SOP_Star.C(213): warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
1>..\..\source\SOP_Star.C(229): warning C4244: '=' : conversion from 'fpreal' to 'float', possible loss of data
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

No errors of any kind, just lots of warnings (which is more or less normal, right!?).

 

Setup:

OS: Win7x64

Houdini: 13.0.260 built with VC11

Test Plugin: SOP_Star.C

IDE: VS2013 with platform toolset set to VC110 (VS2012 which my H13 is built against)

Command Line options: I was messing with this all day. Basically i just copied and/or corrected the settings i determined by running hcustom -c SOP_Star.C and hcustom -m SOP_Star.C

into the Command Line options of Visual Studio. 

hcustom -e  SOP_Star.C successfully builds the project. It also shows that it runs hcompile which then start the VS compiler with an additional cmd line option called -DUT_DSO_TAGINFO that hcustom -c doesnt show!?

 

CL command line options:

All options (grey field in Visual Studio/Properties/C/C++/CommandLine):

/GS /GL /W3 /Gy /Zc:wchar_t /Zi /Gm- /O2 /sdl /Fd"x64\Release\vc110.pdb" /fp:precise /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "SOP_STAR_EXPORTS" /D "_WINDLL" /D "_UNICODE" /D "UNICODE" /errorReport:prompt /WX- /Zc:forScope /Gd /Oi /MD /Fa"x64\Release\" /EHsc /nologo /Fo"x64\Release\" /Fp"x64\Release\sop_star.pch"

Additional options (white field in Visual Studio/Properties/C/C++/CommandLine)....taken from hcustom -c:

-nologo -TP -Zc:forScope -DVERSION="13.0.260" -DI386 -DWIN32 -DSWAP_BITFIELDS -D_WIN32_WINNT=0x0501 -DWINVER=0x0501 -DNOMINMAX -DSTRICT -DWIN32_LEAN_AND_MEAN -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -DBOOST_ALL_NO_LIB -DSESI_LITTLE_ENDIAN -DAMD64 -DSIZEOF_VOID_P=8 -DFBX_ENABLED=1 -DOPENCL_ENABLED=1 -DOPENVDB_ENABLED=1 -I .  -I "D:/tools/SIDEEF~1/HOUDIN~1.260/toolkit/include" -I "C:/PROGRA~2/MICROS~3.0/VC/include" -I "C:/Program Files (x86)/Windows Kits/8.0/Include/um" -I "C:/Program Files (x86)/Windows Kits/8.0/Include/shared" -wd4355 -w14996 -O2 -DNDEBUG -MD -EHsc -GR -bigobj

Anybody any ideas? Has anybody built plugins with VC11 from a Visual Studio Project successfully?

Or does anybody even have a cmake file ready to generate VS2012 projects that successfully compile? 

 

Thanks in advance!

Timm

Edited by timmwagener

Share this post


Link to post
Share on other sites
Guest mantragora

One more tutorial: http://forums.odforce.net/topic/11635-inlinecpp/page-4

 

Upload you project and you flags like I specified here

 

Why do you bother with cmake file? Wouldn't it be easier to create script that just sends all your files to hcustom?

 

I use VisualStudio for development, but for compilation I do have powershell script in which I can filter what part of my library I want to compile - which just sends specified (or all) cpp files to hcustom one by one, and reports back was it successful, if yes, it also installs icons (if there are any) and *.shelf files (if there are any).

 

 

IDE: VS2013 with platform toolset set to VC110 (VS2012 which my H13 is built against)

 

Do you have vc11 compiler installed? Because vs2013 doesn't come with one, so just changing platform toolset doesn't solve the problem.

Has anybody built plugins with VC11 from a Visual Studio Project successfully?

I'm using features introduced with C++11 all the time now, so the only way to compile it on Windows is to use vc11 version. That means yes, I successfully compile plugins all the time from my VisualStudio project.

Edited by mantragora

Share this post


Link to post
Share on other sites

In Visual Studio projects, the full log is not shown in the Output window, you need to open up the log files found in the output directory.

Share this post


Link to post
Share on other sites
Why do you bother with cmake file? Wouldn't it be easier to create script that just sends all your files to hcustom?

 

I find it quite usefull to use cmake for plugin development. I use it as an easy way to switch between versions (build against different Maya versions, different QTs etc.) and regenerate/adjust visual studio projects on different computers. Sure it could be done with Env. Variables as mentioned here or differently, i just find the cmake GUI to be very convenient.

 

Do you have vc11 compiler installed? Because vs2013 doesn't come with one, so just changing platform toolset doesn't solve the problem.

 

Sure, i have VS2012 installed. One thing i noticed though while looking through the .log file is that hcustom starts a different cl than VS:

 

VS (from log): 

1>ClCompile:         C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\x86_amd64\CL.exe ................

hcustom:

Running: hcompile -e SOP_Star.C
"C:\PROGRA~2\MICROS~3.0\VC\bin\amd64\cl"  ...........................
I can't seem to find a way to start the same cl.exe from the vs settings. According to Google this should not be a problem, could it?
Apart from that the log file doesnt show any differences to the VS Output window!
 
Compile Settings:
Configuration: Release
Platform: x64
 
Here are my compile flags, taken from hcustom:
 
Compilation:
-nologo 
-TP 
-Zc:forScope 
-DVERSION="13.0.260" 
-DI386 
-DWIN32 
-DSWAP_BITFIELDS 
-D_WIN32_WINNT=0x0501 
-DWINVER=0x0501 
-DNOMINMAX 
-DSTRICT 
-DWIN32_LEAN_AND_MEAN 
-D_USE_MATH_DEFINES 
-D_CRT_SECURE_NO_DEPRECATE 
-D_CRT_NONSTDC_NO_DEPRECATE 
-D_SCL_SECURE_NO_WARNINGS 
-DBOOST_ALL_NO_LIB 
-DSESI_LITTLE_ENDIAN 
-DAMD64 
-DSIZEOF_VOID_P=8 
-DFBX_ENABLED=1 
-DOPENCL_ENABLED=1 
-DOPENVDB_ENABLED=1 
-I .  
-I "D:/tools/SIDEEF~1/HOUDIN~1.260/toolkit/include" 
-I "C:/PROGRA~2/MICROS~3.0/VC/include" 
-I "C:/Program Files (x86)/Windows Kits/8.0/Include/um" 
-I "C:/Program Files (x86)/Windows Kits/8.0/Include/shared" 
-wd4355 
-w14996 
-O2 
-DNDEBUG 
-MD 
-EHsc
-GR 
-bigobj 
-DMAKING_DSO

I'm trying to build in Release mode, so i'm assuming -O2 is correctly left in.

 
Linking:
-LIBPATH:"C:/PROGRA~2/MICROS~3.0/VC/lib/amd64" 
-LIBPATH:"C:/Program Files (x86)/Windows Kits/8.0/Lib/win8/um/x64"   
-LIBPATH:"D:/tools/SIDEEF~1/HOUDIN~1.260/custom/houdini/dsolib" 
"D:/tools/SIDEEF~1/HOUDIN~1.260/custom/houdini/dsolib/*.a" 
"D:/tools/SIDEEF~1/HOUDIN~1.260/custom/houdini/dsolib/*.lib"
Edited by timmwagener

Share this post


Link to post
Share on other sites

Ok, seems i have it compiling now. The issue was with a flag called "SDL checks", which was on by default but needs to be turned off.

Here is a screenshot:

houdini_compilation_settings_sdl_checks_

 

Thanks guys, your tutorials helped a lot!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×