Error 126 loading external when building with external library

meta's icon

I'm in the process of making an external on Windows 10 with Max 7 and the SDK. In the visual studio project I have the main max project and a secondary project that I include in the main project. This secondary project uses an external library (arrayfire).

I have two different computers that I've been developing on (both Windows 10, 64-bit). Both compile, and on one machine everything works. However, on the other machine I am getting an "error126 loading external" when I try to open it in Max. As far as I can tell everything (software versions, settings, etc.) is the same across both machines, and when I removed the max project's ability to call arrayfire in the offending machine, it builds and loads without error.

I found<a href="https://cycling74.com/forums/error-126-loading-external"> this thread where a similar issue was discussed, but any changes to visual studio settings suggested there do not get rid of the error.

Any help/suggestions would be appreciated!

StuartM's icon

It seems like this error occurs when there are inconsistencies or a missing .dll file. Max doesn't reallllllly do that well at detecting missing .dll files everytime, or in this case potential different versions of a .dll file.

It may be the case that the installation on one machine may have differed to the other, or you've forgotten to copy the necessary .dll files to the support folder (located within 'C:\Program Files\Cycling '74\Max 7\resources\').

If that doesn't solve it, it might be worth re-downloading and building arrayfire on the offending machine. Rebuild the external with the new library and place the .dll files in a folder with the externals, this way you'll always have them available and create a readme for the version of arrayfire used in your external. This way, if you ever run into any problems porting or moving it to a different pc, you can easily rectify the problem. Then move the .dll files to either your syswow64 folder (or system32 if the library requires), or your max installation support folder, as normal.

Rajan Craveri - micron's icon

It may be the case that the installation on one machine may have differed to the other, or you've forgotten to copy the necessary .dll files to the support folder (located within 'C:\Program Files\Cycling '74\Max 7\resources\').

This solved my 126 error, thanks