MeshBuilder.dll not found

Discuss and ask questions about CAD VCL (Delphi and C++ Builder).

Moderators: admin, support, SDS

Post Reply
uligerhardt
Posts: 2
Joined: 20 Jan 2015, 12:46

MeshBuilder.dll not found

Post by uligerhardt » 19 Sep 2018, 14:19

Hello all!

I'm trying to show *.stp files which apparently needs MeshBuilder.dll. But I can't make that work. Even the CAD3D demo throws a TsgCommonBrepImageError exception 'MeshBuilder.dll Cannot be loaded!'.
How can I make that work?

Best regards
Uli

support
Posts: 2824
Joined: 30 Mar 2005, 11:36
Contact:

Re: MeshBuilder.dll not found

Post by support » 19 Sep 2018, 18:50

Hello Uli,

CAD VCL requires MeshBuilder.dll and Open Cascade DLLs to load 3D file formats (STEP, IGES, etc.). These libraries come with CAD VCL and located in the following folders:

\Delphi\ExternalLib\OpenCascade\win32\vc9\bin\ - libraries for x32 platform,
\Delphi\ExternalLib\OpenCascade\win64\vc9\bin\ - libraries for x64 platform.

You may just copy the .dll files from one of these folders to the folder with the executable file (e.g. CAD3D.exe) or, if you want them to be located at some other path, call an sgFunction.InitDefMeshBuilderDllPath() method to define the MeshBuilder.dll path on the application startup. In the CAD3D demo project this path is defined as follows:

Code: Select all

InitDefMeshBuilderDllPath(ExtractFilePath(Application.ExeName), 'Demos\3D\Bin\');
Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

uligerhardt
Posts: 2
Joined: 20 Jan 2015, 12:46

Re: MeshBuilder.dll not found

Post by uligerhardt » 20 Sep 2018, 11:07

Thanks Mikhail,
I got it to work using

Code: Select all

 cnstMeshBuilderDllPath := TPath.Combine(ExtractFilePath(Application.ExeName), 'DLLS\');
instead of InitDefMeshBuilderDllPath. Am I missing something if I do this direct assignment?

Yesterday I only had copied MeshBuilder.dll instead of all the DLLs, so LoadLibrary failed despite MeshBuilder.dll was found. :oops:

support
Posts: 2824
Joined: 30 Mar 2005, 11:36
Contact:

Re: MeshBuilder.dll not found

Post by support » 20 Sep 2018, 18:45

Uli,

The InitDefMeshBuilderDllPath() method actually does the same, but also takes into account the conditional compilation symbol SG_CPUX64 which denotes the target platform (x64 or x32):

Code: Select all

{$IFDEF SG_CPUX64}
      cnstMeshBuilderDllPath := vExePath + 'ExternalLib\OpenCascade\win64\vc9\bin\';
{$ELSE}
      cnstMeshBuilderDllPath := vExePath + 'ExternalLib\OpenCascade\win32\vc9\bin\';
{$ENDIF}
If you compile an application for one target platform (e.g. x32), you may use the direct assignment from your post.

Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply