Posts

Showing posts with the label dll

Program can't find explicitly linked DLL

Program can't find explicitly linked DLL I am trying to modify a C program that explictly links to a DLL to connect to a Driver for an amplifier. It came with the DLL file, the C source code and a pre-compiled executable. The executable runs fine, but when I re-built it using the Developer Command Prompt for VS 2017, it can't find the library (errorcode 126). I verified that the path is correct, the DLL is where the program is looking for it. Here is the part of the program that loads the DLL: TCHAR Path[ MAX_PATH ]; ... TCHAR Hardcoded[255] = _T("C:WindowsSystem32TMSiSDK.dll"); Path[0] = 0 ; // When debugging, use the locally build lib lstrcat(Path, Hardcoded); ... LibHandle = LoadLibrary(Path); And here is the command I used to build it in Developer Command Prompt for VS 2017: cl sampler.c Any ideas about what I'm doing wrong? It's my first time using a program with DLL-s and I'm also not used to developing under Windows, so excuse my newbieness. ...