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:
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.
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.