Compile and link 3rd party library in Visual Studio [duplicate]

≡放荡痞女 提交于 2019-11-30 07:21:32

To link against third party libraries you usually have to do 3 things:

1. You have to add the Include Directory.

In Project > Properties > C/C++->General > Additional Include Directories

Click Edit, and enter the path to the directory where the file "fmod.h" is located.

2. You have to link against the *.lib file.

In Project > Properties > Linker > General > Additional Library Directories, click Edit and enter the path to your library files.

In Project > Properties > Linker > Input > Additional Dependencies, click Edit, add the filename of the library you want to link against (in this case this would be most likely "fmodvc.lib")

3. You have to provide the *.dll in your project directory

That your programm will run successfully it has to find the *.dll file at runtime. You can either place it in a folder referenced by the PATH variable, or in the PWD of your process. This would be right beside your *.vcxproj files.

If you are linking statically you can skip step 3, if you are loading the dll file dynamically you can skip step 2.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!