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.





After over five years as a member, it's really time to read the help pages, take the SO tour, read about how to ask good questions, and learn how to create a Minimal, Complete, and Verifiable Example. I also recommend this question checklist, and that you read all of idownvotedbecau.se to learn some reasons for possible down-votes of your question.
– Some programmer dude
Jun 29 at 9:24









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Comments

Popular posts from this blog

paramiko-expect timeout is happening after executing the command

Opening a url is failing in Swift

Possible Unhandled Promise Rejection (id: 0): ReferenceError: user is not defined ReferenceError: user is not defined