-3

I'm working a on project to use the SDK from https://github.com/hypersen/HPS3D_SDK
but I'm having troubles loading the DLL file, it returns me an error 126 for "libhps3d32.dll" and error 193 while using "libhps3d64.dll". I've seen many posts regarding these 2 errors but none of the solution so far works for me. Please help!

The dll file is the same location as the exe file. I've tried disabling my anti virus too, didn't help.

printf("Hello world!\n");

/*LoadLibrary */
HMODULE module = LoadLibraryA((LPCSTR)"C:\\Users\\xx\\Desktop\\xx\\libhps3d32.dll");
//printf("module loaded %d)",module);
if (module == NULL)
{
    DWORD error_id = GetLastError();
    printf("error load %d\n",error_id);
    return;
}
Jerru
  • 99
  • 1
  • 9
  • 1
    Errors 126 and 193 can be incorrect after printf. Store errors codes right after LoadLibrary call. – 273K May 29 '21 at 07:01
  • 1
    Look at the debug output of visual studio debugger. You would see there what dll can't be loaded. – 273K May 29 '21 at 07:04
  • @S.M. i changed for comment 1. Looking at the debugger in vscode, it still returns the error 126 – Jerru May 29 '21 at 07:32
  • Which solutions have you tried that didn't work for you? Also, try not to ask two questions in one. Also, just one thing, using unnecessary casts and `%d` for a `HMODULE` isn't good, that just asks for trouble. Make sure your code compiles without warnings! – Ulrich Eckhardt May 29 '21 at 07:51

1 Answers1

0

EDIT: I was able to solve this by using dependency walker to trace the DLL file and its path. Found out that i was missing a few key dlls. Fixed after put them in place. Hope this works for everyone facing the same problems.

Jerru
  • 99
  • 1
  • 9