I am trying to add ANN(open source k-d tree for fast nearest neighbor searching) to my VC++ project. I followed the manual and completed every step:

include the .h files copy the .lib file, add its location to the linker additional directory copy the .dll file, set location to environmental variable PATH, and import it in my project

I still get 24 "unresolved external..." errors. The library seems to be widely used and not supposed to be wrong, wondering what else do I need to do to use it?

Thanks guys!

有帮助吗?

解决方案

The "unresolved external" error comes because the linker is not finding the "lib" files. The DLL files are only found during run time, not link time.

Do you set the names of the lib files in the project's Properties?

 Configuration Properties -> Linker -> Input -> Additional Dependencies

Enter the filenames of the all the lib files, separated by spaces. If they are in your Project folder, use something like

 $(ProjectDir)Foobar.lib

其他提示

have you set path of lib correctly?

you can use lib file along with its path in on Configuration Properties -> Linker -> Input -> Additional Dependencies

or

just give lib file name in Configuration Properties -> Linker -> Input -> Additional Dependencies

and lib path in Configuration Properties -> Linker -> General -> Additional library directories

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top