dlib icon indicating copy to clipboard operation
dlib copied to clipboard

[Bug]: utIsInterruptPending NOT found

Open gmm76 opened this issue 7 months ago • 3 comments

What Operating System(s) are you seeing this problem on?

Windows

dlib version

20.0

Python version

none

Compiler

GCC 15.1

Expected Behavior

successfully copmile and build the example "dlib\matlab".

Current Behavior

When I copmile the example "dlib\matlab", the following error occurs:

C:/Program Files/w64devkit/bin/ld.exe: CMakeFiles/example_mex_function.dir/objects.a(example_mex_function.cpp.obj):example_mex_function.cpp:(.text+0x1585): undefined reference to `utIsInterruptPending'

My matlab version is 2025a, and I cannot find any infomation about "utIsInterruptPending" in matlab help. I have to comment the line 4697 and 4698 in "mex_wrapper.cpp" to make the build process pass.

Steps to Reproduce

following the guidance of "dlib-20.0\dlib\matlab\README.txt"

Anything else?

No response

gmm76 avatar Jun 04 '25 07:06 gmm76

Yeah some googling says the function is now called mexIsInterruptPending(). Does changing it to be mexIsInterruptPending() make it work? If so send me a PR :)

It sounds like mexIsInterruptPending() has been in matlab since 2019, so might as well switch to that if works.

davisking avatar Jun 05 '25 01:06 davisking

Yeah some googling says the function is now called mexIsInterruptPending(). Does changing it to be mexIsInterruptPending() make it work? If so send me a PR :)

It sounds like mexIsInterruptPending() has been in matlab since 2019, so might as well switch to that if works.

Thank you very much for answering my question. I can not find any function like xxInterruptPending() in matlab official help and forum. It seems that matlab uses the FutureResult class or some signal mechanism to deal with CTRL+C.

gmm76 avatar Jun 05 '25 03:06 gmm76

Yeah IDK. I don't have matlab to test this stuff with anymore. I'm sure there is some way to do it in your version of matlab. You should figure it out and send me a PR :)

davisking avatar Jun 05 '25 12:06 davisking

Yeah IDK. I don't have matlab to test this stuff with anymore. I'm sure there is some way to do it in your version of matlab. You should figure it out and send me a PR :)

I asked this question on Matlab Answers. A kind guy just gave me the answer: utIsInterruptPending is in the library '${MATLAB_HOME}/extern/lib/win64/microsoft/libut.lib'.

Then, I found that 'dlib-20.0\dlib\matlab\cmake_mex_wrapper' missed including the libraty. So, we should add 2 lines (line 41 & 46), and append ' ${MATLAB_UT_LIBRARY}' in line 48, as shown in the following figure.

Image

gmm76 avatar Jun 16 '25 08:06 gmm76

Yeah IDK. I don't have matlab to test this stuff with anymore. I'm sure there is some way to do it in your version of matlab. You should figure it out and send me a PR :)

I asked this question on Matlab Answers. A kind guy just gave me the answer: utIsInterruptPending is in the library '${MATLAB_HOME}/extern/lib/win64/microsoft/libut.lib'.

Then, I found that 'dlib-20.0\dlib\matlab\cmake_mex_wrapper' missed including the libraty. So, we should add 2 lines (line 41 & 46), and append ' ${MATLAB_UT_LIBRARY}' in line 48, as shown in the following figure.

Image

Awesome. Try that out and see if it fixes it for you and if so send me a PR with that change :)

davisking avatar Jun 16 '25 11:06 davisking

Awesome. Try that out and see if it fixes it for you and if so send me a PR with that change :)

I've send a PR. This is my first time of sending a PR in github, hope the process is correct.

gmm76 avatar Jun 16 '25 13:06 gmm76

Sweet, thanks for the PR. Merged it in just now.

davisking avatar Jun 17 '25 11:06 davisking