-
November 10th, 2019, 12:58 PM
#1
[RESOLVED] Issue with the Dll
Hi ,
I have created the Dll for my functionality.
Now the client given me the test harness and i added my dll into that . But there is no luck, it says that the
fatal error LNK1107: invalid or corrupt file: cannot read at
But then i added the visual studio project created within the Dll into the test harness solution and also copied my files in the same folder. Then compiled the test harness soliution. Then I could see the dlll getting loaded properly.
There is a call within the test harness like dll->GetPropModel(). I can see the My dll is getting called when i put the breakpoint at this point.
It is frustrating. That now all the functionality is tested with this method. And finally i cannot deliver my code to client as it is not recognising my Dll individually.
My code has some has some lib and tlb files. Does it package under the same dll or is it because of this i cannot packahge my code under one dll.
Thanks
Pdk
-
November 10th, 2019, 01:55 PM
#2
Re: Issue with the Dll
Well, you are alone with this error: https://www.google.com/search?q=LNK1...hrome&ie=UTF-8
Did you read how the others tried to solve this problem?
Victor Nijegorodov
-
November 11th, 2019, 04:28 AM
#3
Re: Issue with the Dll
LNK1107 usually means that you are trying to link to a .dll file instead of a .lib file. When a .dll file is compiled the .lib file will also be generated. This is the file that is used to link - not the .dll file.
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
November 11th, 2019, 06:50 AM
#4
Re: Issue with the Dll
Originally Posted by 2kaud
LNK1107 usually means that you are trying to link to a .dll file instead of a .lib file. When a .dll file is compiled the .lib file will also be generated. This is the file that is used to link - not the .dll file.
Thanks a lot kaud. I was adding the .dll under Project->Configuration Properties->Linker->Input->Additional Dependencies.
Now changed to .lib and everything works like magic. My big big headache is gone.
Thanks a lot kaud. Much appreciated.
-
November 11th, 2019, 02:32 PM
#5
Re: [RESOLVED] Issue with the Dll
Say, as an aside, do you realize you can debug the dll by setting the path to the exe that loads your dll?
In VC 2019 (previous versions are similar):
Right click on the dll project and choose properties.
Click on the Debugging node under Configuration Properties.
Change the Command property to point to the exe that loads the dll.
When you debug, the exe will start which loads your dll.
-
November 12th, 2019, 02:58 AM
#6
Re: [RESOLVED] Issue with the Dll
Thanks a lot Arjay, will try this
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|