How do I use a third-party DLL file in Visual Studio C++?

前端 未结 6 1486
北恋
北恋 2020-11-28 02:01

I understand that I need to use LoadLibrary(). But what other steps do I need to take in order to use a third-party DLL file?

I simply jumped into C++ and this is th

6条回答
  •  遥遥无期
    2020-11-28 02:29

    As everyone else says, LoadLibrary is the hard way to do it, and is hardly ever necessary.

    The DLL should have come with a .lib file for linking, and one or more header files to #include into your sources. The header files will define the classes and function prototypes that you can use from the DLL. You will need this even if you use LoadLibrary.

    To link with the library, you might have to add the .lib file to the project configuration under Linker/Input/Additional Dependencies.

提交回复
热议问题