How do I link SDL with Visual Studio 2019

a 夏天 提交于 2020-01-14 05:42:06

问题


I don't know how to link libraries with Visual Studio 2019 (I am using Windows 10), how do I link libraries?


回答1:


I assume is the same as in VS 2017.

Project / "your project name" Properties... /

At Configuration select All Configurations

Then

Project / "your project name" Properties... / Configuration Properties / VC++ Directories /

At Include Directories add path to your SDL include folder
At Library Directories add path to your SDL lib folder ( lib/x86 or lib/x64 )

Then

Project / "your project name" Properties... / Configuration Properties / Linker / Input /

At Additional Dependencies add ( in this order ):
SDL2.lib
SDL2main.lib

Then copy all the .dll files from "your SDL folder" / lib / ( x86 or x64 ) to your Visual Studio project debug folder ( the debug folder in the location where your .sln file is ).

Don't forget to use #include <SDL.h> in your code.
Also change int main() function in main.cpp with int main(int argc, char* args[]).



来源:https://stackoverflow.com/questions/57732058/how-do-i-link-sdl-with-visual-studio-2019

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