Compilation issue: Unable to find "freetype.dll".

jianbaoxia

CAD master
Hi Bro, I'm JianBaoxia.
I ran into a problem while compiling, but actually I had successfully compiled the OCCT environment following Quaoar's lessons 0, 1, and 5, and learned how to configure the relevant header files and libraries, which allowed me to successfully get started with OCCT. However, these past couple of days, I attempted to configure my familiar OCCT 7.6 environment on a new computer using the same steps. When I tried to run the visualization code in lesson 4, I encountered an issue: 'Unable to find "freetype.dll".'
I actually encountered the same issue when trying to reconfigure the OCCT 7.6 environment on two new computers and running the lesson 4 code. I checked the 'Debug' -> 'Environment' settings and found that PATH=C:/dev/OCCT/OCCT_7.6.0/opencascade-7.6.0_install/win64/vc14/bind;%PATH%, which looked normal, but it still couldn't find 'freetype.dll' during runtime. I had already included third-party libraries, such as freeimage-3.17.0-vc14-64, freetype-2.5.5-vc14-64, and tcltk-86-64, during the environment compilation. I compiled the 64-bit environment on vs2019, with cmake version 3.19.1."
I know this issue can be tedious and frustrating, so I carefully repeated the compilation process based on lesson 0 and 1 several times, but still encountered the same result. Therefore, I have to seek help from you all.
 

jianbaoxia

CAD master
I temporarily solved the problem by copying the 'freetype.dll' file from the 'freetype-2.5.5-vc14-64\bin' folder to 'opencascade-7.6.0_install\win64\vc14\bind', which is strange because I didn't need to do this in my previously configured environment.o_O
 

Quaoar

Administrator
Staff member
Well, basically, this Freetype library should be present in the same PATH variable as all other third-party libraries. What you did by copying the DLL manually to the destination folder is a completely legal trick (I do the same oftentimes), but it also indicates that something is missing in the configuration process, likely, in the CMake files of either your project or OpenCascade itself.

I tried to run Lesson_17 just for a quick test, and here's my freetype, which happened to be located right in OpenCascade's INSTALL directory:

1678715026096.png

Don't remember putting it there manually, but it could have happened. Alternatively, it might be that the INSTALL_FREETYPE cmake variable was On when I configured OpenCascade, see here:

1678715142825.png
You may try enabling this variable and check what would happen.
 

JSlyadne

Administrator
Staff member
Hi JianBaoxia.

Could you please specify what tool you use to configure OCCT? CMake? If yes, there should a variable named like 3RDPARTY_FREETYPE_DIR pointing to freetype location. So just check that it's initialized properly.
 

jianbaoxia

CAD master
@JSlyadne Thank you for your response. Yes, I am using Cmake as my compiling tool. I tried to compile the OCCT project on my new computer as usual, but encountered some differences, so I have some doubts.😃
 
Top