Using *.lib library file:
From C API Release version 3.8.0 (or higher), *.lib library file is included. Recommend to use this library for your VS tool.
To run an example using MS VS2017 or higher with the *.lib library provided in the C API, here are the settings needed:
- Open the Properties of the project in VS
+ Select General and set Platform Toolset to "Visual Studio 2017 (v141)" (the version # might be different).
- Under C/C++:
+ select General, and in Additional Include Directories, made sure you have added <your_dir_path_C-API>\include;
+ in Preprocessor, add to Preprocessor Definitions this _CRT_SECURE_NO_WARNINGS;
+ in Precompiled Header, set Precompiled Header to use Not Using Precompiled Headers
+ optional: to avoid getting LIBCMT conflict warning, in Code Generation, you might want to change Runtime Library to use /MT option
- Under Linker,
+ in Input, add to Additional Dependencies these: WS2_32.lib;<your_dir_path_C-
API>\libwsaXX.lib;
Replace XX with 32 or 64-bit file version.
---------------------------------------
Using *.a library file:
To run an example using MS VS2017 or higher with the *.a library provided in the C API, here are the settings needed:
- Open the Properties of the project in VS
+ Select General and set Platform Toolset to "Windows7.1SDK"
- Under C/C++, use the same steps as with the *.lib above.
- Under Linker,
+ in Input, add to Additional Dependencies these: WS2_32.lib;<your_dir_path_C-API>\libwsaXX.a;
Replace XX with 32 or 64-bit file version.
---------------------------------------
If other compiler tools are used, ensure your project is pointed to /include and *.a or *.lib files properly.