Link against a 3rd-party library with Visual Studio

前端 未结 3 1110
Happy的楠姐
Happy的楠姐 2020-12-12 02:57

I\'m trying to create a .dll with Visual Studios 2013. The project includes libpq functionality.

Per other stackoverflow posts, and other sources I\'ve found on the

3条回答
  •  春和景丽
    2020-12-12 03:20

    I've successfully compiled the sample program by setting these project properties:

    • Add \include and \lib to VC++ Directories->Include and ->Library, correspondingly
    • Add libpq.lib to Linker->Input->Additional dependencies

    This is the standard way to reference 3rd-party libs. It's just that they recommend using environment variables for their "base dirs" to avoid patching the project when it's under a VCS.

    • To be able to run the app from VS (both with and without debugging), I also specified PATH=%PATH%;\bin in Debugging->Environment since this dir isn't in PATH on my system.

提交回复
热议问题