I am converting a C++ Visual Studio 2005 project to Visual Studio 2010, and I have used this guide in the process. I have one issue left which is, that the linker does not link a native static library (it is not a .NET assembly bu开发者_开发问答t a third part library sqsapi32.lib). I have included the library sqsapi32.lib in the Properties->Configuration Properties->Linker->Input->Additional Dependencies, but the linker keep notifying the following warning:
warning LNK4248: unresolved typeref token (01000014) for 'SQLDA'; image may not run
running the .exe file produces the following error: "The program can't start because sqsapi32.dll is missing from your computer".
How can I fix this? It worked using Visual Studio 2005.
Since you are using C++/CLI, this warning is expected from linker. There are many structs which are just declared as:
struct ABC;
and ABC
is used by underlying library (you dont have source code), and ABC is presented by library to you in opaque manner. You can avoid this warning by declaring a fake structure in your source code:
struct ABC
{
};
So for your case:
struct SQLDA{};
will do the job.
This is just to satisy the C++/CLI linker and wont do any harm.
The warning and the error you've shown aren't necessarily linked (no pun intended!).
To get around the error, ensure the sqsapi32.dll is placed in the same location as the exe you're trying to run.
Good luck,
精彩评论