Community
DWF
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DWF Toolkit with Managed C++

4 REPLIES 4
Reply
Message 1 of 5
GBGB1360
1992 Views, 4 Replies

DWF Toolkit with Managed C++

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

4 REPLIES 4
Message 2 of 5
Anonymous
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

Message 3 of 5
GBGB1360
in reply to: Anonymous

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:prompt /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:PROMPT 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

Message 4 of 5
Anonymous
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:prompt /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:PROMPT 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

 

Message 5 of 5
GBGB1360
in reply to: Anonymous

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

”Boost

 

”Tips

 

”Services