You had a bad fully qualified path set in the x64 linker property for Additional Library Directories.
Change the path to -
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am currently still using VS 2017.
It has been man years since I have created a native DLL and now when I try to I was getting a linker error I cannot figure out. So I tried to follow the instructions in Walkthrough: Create and use your own Dynamic Link Library (C++) and I am getting the same problems. The following are the linker errors from the walkthrough.
1>MathClient.obj : error LNK2019: unresolved external symbol __imp__fibonacci_init referenced in function _main
1>MathClient.obj : error LNK2019: unresolved external symbol __imp__fibonacci_next referenced in function _main
1>MathClient.obj : error LNK2019: unresolved external symbol __imp__fibonacci_current referenced in function _main
1>MathClient.obj : error LNK2019: unresolved external symbol __imp__fibonacci_index referenced in function _main
1>G:\Documents\Samples\Microsoft\Walkthroughs\MathClient\Debug\MathClient.exe : fatal error LNK1120: 4 unresolved externals
So let me back up a bit. For the header MathLibrary.h
the following works:
#include "..\..\MathLibrary\MathLibrary\MathLibrary.h"
However when I cut the path out and put that path in the Additional Include Directories it does not find the #include. I had the same problem with my initial project of a DLL and a console driver for executing the DLL.
I have followed the instructions in the walkthrough and added the MathLibrary.lib to the Additional Dependencies and the path for the library to the Additional Library Directories. When I use that path for dumpbin it shows the following symbols.
_fibonacci_current
_fibonacci_index
_fibonacci_init
_fibonacci_next
The following is the project properties for the DLL.
The following is the Configuration Manager for it.
Can anyone explain why I am getting the unresolved external symbols? If the malfunction is me then I sure do not see it. What can I do to diagnose it?
My system is due for a major rebuild. I should go for VS 2022 and perhaps I will give up on this problem until I do.
I have put my projects into GitHub.
https://github.com/SimpleSamples/MathLibrary
https://github.com/SimpleSamples/MathClient
You had a bad fully qualified path set in the x64 linker property for Additional Library Directories.
Change the path to -
I have build the both two projects successfully except modifying the MathClient
Additional Include Directories, Additional Library Directories, Post-Build Event because my folder name is MathLibrary-master.