• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    DWF

    Reply
    Active Contributor
    Posts: 27
    Registered: ‎11-27-2009

    DWF Toolkit with Managed C++

    1073 Views, 4 Replies
    09-16-2010 03:48 PM

    Hello,

     

    Has you managed to use DWF Toolkit in a managed C++ project? If so, can you reveal your project settings?

    I am getting loads of LINK errors related to the DWFToolkit header files, similar to the one below:

     

    Error    1    error LNK2022: metadata operation failed (8013118D) : Inconsistent layout information in duplicated types (std.logic_error): (0x02000019).    MSVCMRT.lib  

     

    I am using Visual Studio 2008.

     

    Thanks

     

    Gabriel

    Please use plain text.
    Active Member
    Posts: 10
    Registered: ‎06-09-2004

    Re: DWF Toolkit with Managed C++

    09-22-2010 07:29 AM in reply to: GBGB1360

    Hello,

     

    I have a C++/CLI project in Visual Studio 2005 including Revit API (.net) and DWF Api (native)

     

    Be sure to set in the project properties at Linker/Input section the required libs for your DWF project. I have: dwfcore.1.6.0.lib dwfcore_wt.1.6.0.lib dwftk.7.6.0.lib dwftk_ro.7.6.0.lib dwftk_wt.7.6.0.lib w3dtk.1.6.1555.lib w3dtk_ro.1.6.1555.lib w3dtk_wt.1.6.1555.lib whiptk.7.12.601.lib whiptk_ro.7.12.601.lib whiptk_wt.7.12.601.lib xaml_wt.7.6.0.lib 

     

    Also check if you are including the correct header files for your platform (32 or 64 bits) and if the path to the lib files is correct.

     

    Bogdan

    Please use plain text.
    Active Contributor
    Posts: 27
    Registered: ‎11-27-2009

    Re: DWF Toolkit with Managed C++

    09-22-2010 07:40 AM in reply to: bbarlea

    Hi Bodgan,

     

    I can use VS 2005 too, if it will work.

    Do you mind sharing your compiler and linker command line options? Below are mine.

     

    Thanks

     

    CL:

    /Od /I "..\..\..\..\Installs\DWFTookit\DWFToolkit-7.6\DWFToolkit-7.6\develop\global\src" /I "..\..\..\..\Installs\DWFTookit\DWFToolkit-7.6\DWFToolkit-7.6\develop\global\src\dwf" /D "WIN32" /D "_DEBUG" /D "_CRT_SECURE_NO_DEPRECATE" /D "_CRT_NON_CONFORMING_SWPRINTFS" /D "DWFCORE_BUILD_ZLIB" /D "DWFCORE_BUILD_EXPAT" /D "WHIP_USE_WCHAR_STRINGS" /D "_WINDLL" /D "_UNICODE" /D "UNICODE" /FD /EHa /MD /Fo"Debug\\" /Fd"Debug\vc90.pdb" /W2 /nologo /c /Zi /clr /TP /errorReport:smileytongue:rompt /FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll" /FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll" /FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.XML.dll" /FU "c:\Projects\Ehouse\PDFWriter\itextSharp\obj\Debug\itextsharp.dll"

     

    Linker:

    /VERBOSE /OUT:"C:\Test Pad\DWFToolkitPDF\Debug\DWFToolkitPDF.dll" /INCREMENTAL:NO /NOLOGO /DLL /MANIFEST:NO /DEBUG /ASSEMBLYDEBUG /PDB:"C:\Test Pad\DWFToolkitPDF\Debug\DWFToolkitPDF.pdb" /DYNAMICBASE /FIXED:No /NXCOMPAT /MACHINE:X86 /ERRORREPORT:smileytongue:ROMPT dwfcore.1.6.0.lib dwftk.7.6.0.lib whiptk_wt.7.12.601.lib dwfcore_wt.1.6.0.lib dwftk_ro.7.6.0.lib dwftk_wt.7.6.0.lib  kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

    Please use plain text.
    Active Member
    Posts: 10
    Registered: ‎06-09-2004

    Re: DWF Toolkit with Managed C++

    09-22-2010 08:03 AM in reply to: GBGB1360

    C/C++

     

    /Od /I "." /I "C:\Develop\APIs\DWFToolkit-7.6\develop\global\src" /AI "C:\Program Files\Autodesk\Revit Architecture 2011\Program" /D "WIN32" /D "_DEBUG" /D "REVIT2011" /D "_WINDLL" /D "_AFXDLL" /D "_UNICODE" /D "UNICODE" /FD /EHa /MDd /Yu"stdafx.h" /Fp"Debug\RrxBase.pch" /Fo"Debug\\" /Fd"Debug\vc80.pdb" /W3 /nologo /c /Zi /clr /TP /errorReport:smileytongue:rompt /FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll" /FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll" /FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.XML.dll" /FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll" /FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll" /FU "c:\WINDOWS\assembly\GAC_32\PresentationCore\3.0.0.0__31bf3856ad364e35\PresentationCore.dll" /FU "c:\WINDOWS\assembly\GAC_MSIL\WindowsBase\3.0.0.0__31bf3856ad364e35\WindowsBase.dll"

     

    Linker

     

    /OUT:"C:\Develop\Projects\Test2011\Sources\..\Bin\Base.dll" /INCREMENTAL /NOLOGO /LIBPATH:"C:\Develop\APIs\DWFToolkit-7.6\develop\global\lib\shared\debug\vc8.0\\" /DLL /MANIFEST /MANIFESTFILE:"Debug\RrxBase.dll.intermediate.manifest" /DEBUG /PDB:"C:\Develop\Projects\Test2011\Sources\..\Bin\Base.pdb" /MACHINE:X86 /FIXED:No /ERRORREPORT:smileytongue:ROMPT dwfcore.1.6.0.lib dwfcore_wt.1.6.0.lib dwftk.7.6.0.lib dwftk_ro.7.6.0.lib dwftk_wt.7.6.0.lib w3dtk.1.6.1555.lib w3dtk_ro.1.6.1555.lib w3dtk_wt.1.6.1555.lib whiptk.7.12.601.lib whiptk_ro.7.12.601.lib whiptk_wt.7.12.601.lib xaml_wt.7.6.0.lib

     

    It looks like i don't have this defines /D "_CRT_SECURE_NO_DEPRECATE" /D "_CRT_NON_CONFORMING_SWPRINTFS" /D "DWFCORE_BUILD_ZLIB" /D "DWFCORE_BUILD_EXPAT" /D "WHIP_USE_WCHAR_STRINGS"

     

    It works with 2008 too but you have to link with the libs for vc.90. I see you have no LIBPATH in your settings.

    Mine is LIBPATH:"C:\Develop\APIs\DWFToolkit-7.6\develop\global\lib\shared\debug\vc8.0\\ for VS2005

     

    Good luck,

    Bogdan

     

    Please use plain text.
    Active Contributor
    Posts: 27
    Registered: ‎11-27-2009

    Re: DWF Toolkit with Managed C++

    09-22-2010 09:52 AM in reply to: bbarlea

    Hi Bogdan,

     

    I changed my settings to match yours and was able to build the project. I think the critical one was /MDd (instead of /MD which I was using before).

     

    Once again, many thanks

     

    Gabriel

    Please use plain text.