1. How to configure header files, library files and dynamic library files in vs
Header file: project--attributes--vc ++ directory--include directory
Library file (lib): project-properties-linker-input-additional dependencies
Dynamic library file (dll): project--properties--vc ++ directory--library directory
In addition, when running exe, the dynamic library needs to be copied to the current folder or added to the environment variable
The above is a personal summary. If you find that it is wrong or unavailable, you can refer to: Thanks to the original author
Personally used is the above several plus the second in the context.
1 Add compile the required (dependent on) the lib file. In the "Project -> Properties -> Configuration Properties -> Connectors -> Input -> Additional Dependencies" in fill "winsock.lib", separated by a space more lib . Equivalent to the " #pragma comment (lib," * .lib ")" statement. 2. Add library (libs) file directory Method 1 : Project- > Properties-> Configuration Properties-> Connector-> General-> Additional Library Directory " Method 2 : [Menu]" Tools-> Options-> Projects and Solutions -> c ++ directory ", select the corresponding platform, and then add the required" library file "directory This setting is similar to setting environment variables, mainly to set the searched library directory for the program, and the first setting is required for the real library loading! 3 . Add include file directory Method 1 : "Project-> Properties-> Configuration Properties-> c / c ++-> General-> Additional Include Directory" Method 2 : [Menu] "Tools-> Options-> Project and Solution Scheme-> C ++ directory ", add the required" include files "directory Method 2 is similar to setting environment variables. 4 . -> Properties-> Configuration properties-> Connector-> Advanced-> Import library "Fill in the import library to be generated
2,解决'sprintf': This function or variable may be unsafe问题
Solution ( thanks to the original author ):
Engineering-> Properties-> Configuration Properties-> C / C ++-> Preprocessor-> Preprocessor Definition
Add the following definition to solve:
_CRT_SECURE_NO_DEPRECATE
Remarks: I have tried it with vs2015, I have not tried anything else.