Can you run this quick test app in the simulator?

I’m trying to isolate an issue with Xojo-OpenCVC.

I’ve uploaded a simple test project DropBox. It includes the OpenCV-C dylib for mac, and DLLs for Windows. Opening the app simply runs System.isfunctionavailable on an OpenCVC function and updates the text on the main window to report if it worked. It also reports your OS version.

I’m hoping some folks here would be willing to run this on your machine in the debugger, copy the result, and post it here. Also let me know if you’re on Intel, ARM, or AMD. The app currently only builds for intel, but should run on a mac in emulation.

The reason I’m doing this is that two people have reported to me that they’re unable to get the latest version of Xojo-OpenCVC to run, with FunctionNotFound errors when they do. I am particularly interested in Windows, but I’d like to know if it works on other macs too.

I’m running Xojo-OpenCVC on both Mac and Windows here, but I am starting to suspect that there’s something about how the library is built that’s preventing it from running on machines other than the one it was built on. I only have Xojo set up on one Windows PC and one Mac.

Thanks!

Here are my results.

OpenCVC Library Not Found
OS: Windows 10.0.22631 (22631)

Device name MyTablet
Processor Intel(R) Core™ Ultra 7 165U 2.10 GHz
Installed RAM 16.0 GB (15.6 GB usable)
Device ID CCE65F62-AD9C-4F45-B674-5C4C3267CDC8
Product ID 00330-66927-73190-AAOEM
System type 64-bit operating system, x64-based processor
Pen and touch Pen and touch support with 10 touch points

Running it here under the debugger gives this output (2018 Mini):

OpenCVC Library is Present
OS: macOS 14.7.2 (23H311)

Win-11 running in a VirtualBox VM gives:

OpenCVC Library Not Found
OS: Windows 10.0.26100 (26100)

hmm. So it doesn’t seem to matter if it’s Windows 11 or 10. I am simply building the DLL in Visual Studio 2019 Community Edition. Like, I open the project file and build it. Is there something I need to do on the C side to make the resulting DLL compatible on other machines? Some kind of signing or something maybe? I’m really a bit ignorant on how all that stuff works, having only ever compiled software for internal use, usually on the machine it’s going to run on.

I once had an issue where a DLL would load on some systems but not others. It turned out that the DLL was built as a “debug” build and not a “release” build, and it would fail to load on systems that don’t have Visual Studio installed.

2 Likes

oooh. You may have nailed it. I am doing debug builds. I had no idea they required VS locally. Now I need to figure out how to make a release build! I just tried it and I get a bunch of errors related to linking to OpenCV itself.

I think I have figured this out. I was able to reproduce the problem on a windows laptop, and have rebuilt the DLL in a release version. This also requires updating the opencv_world452d.dll file to the non-debug version (same name minus the d at the end). The new files are:

OpenCVC.dll
opencv_world452.zip <--this needs to be unzipped first

I’ve updated the github repo for Xojo-OpenCVC to include these two files.

@Wayne_Golding & @TimStreater - If you don’t mind another (hopefully final) test, downloading those two files from that repo and replacing the ones in my little test app, that will confirm that this works. The Build copy operation in the test app will need to be updated as well since opencv_world452.dll has a slightly different name and it won’t be able to find the old debug version of that file.

Alternatively, downloading the xojo opencvc project should also just work now, and you should be able to load an image if it is.

Thanks!

New result:
OpenCVC Library is Present
OS: Windows 10.0.22631 (22631)

1 Like

Hmmm, no improvement in my W-11 VM.

Once I’d unzipped this → opencv_world452.zip , I tried it both as the unzipped file I got and also as opencv_world452d.dll, but it didn’t change anything.

The opencv_world452.dll file needs to be in the “External” folder at the top level of that folder. If the unzip in Windows puts it into a subfolder it probably won’t find it. The other thing to check is that the path to the file in the build copy operation is valid. When I tried running the app before unzipping it couldn’t find the DLL and then I had to re-drop the DLLs onto the build copy operation to get it to work.

So far it’s been working on my end, as well as for a couple other people who have tested the main Xojo-OpenCVC project. So my bet is that it’s just not getting copied into the project somehow.

Think you must be right because now its OK. I had to remove and re-add that line in the copy step.

1 Like

I think what happened is that I moved the original “d” version out onto the Desktop, and then put the new one, but renamed to have the trailing “d”, in. But the IDE noticed my original move, and edited the file location in the copy step. So even though I’d replaced the dll in the Externals folder, at build time the IDE kept right on copying your original which was still on the Desktop.

1 Like