The following uses adding the ws2_32.lib file as an example.
Method 1 (add Code directly ):
Directly in the. cpp file, add# Pragma comment (Lib, "ws2_32.lib. (Ws2_32.lib is the Lib file you want to add)
Method 2 (added in the vs toolbar ):
1. Project(Project)-> tcpsrv attributes(Tcpsrv properties) (where tcpsrv is the project name)
2. After the tcpsrv property page is opened, configure properties-> linker(Linker)-> Input(Input ).(Additional dependences), Enter ws2_32.lib.
PS: The English section in parentheses is vs2008
[Configuration properties]
General-> [output directory].../output/debug indicates the output path of the generated file
General-> [intermediate Directory]. wsiucsparser ___ win32_debug indicates the generated intermediate path.
Debugging-> [command].../../output/debug/tmplatformconsole.exe this project is dll. tmplatformconsole.exe calls this DLL and can add breakpoints in the DLL.
Debugging-> [working directory].../output/debug, set the working path
[C/C ++]
General-> [additonal include directories]./include/epan,./include/glib,./include,./include/decode indicates the path of the file on which the project depends
Precompiled headers-> [precompiled header file]. wsiucsparser ___ win32_debug/wsiucsparser. PCH
Precompiled header file
Output files-> [ASM list name]. wsiucsparser ___ win32_debug/
Output files-> [object file name]. wsiucsparser ___ win32_debug/
Output files-> [program database file name]. wsiucsparser ___ win32_debug/
[Linker]
General-> [output file].../../output/debug/wsiucsparser. dll, define the output file path and name
General-> [additional library directories]./lib depends on the Lib path
Input-> additional dependencies the Lib file on which the glib-2.0.lib gmodule. Lib depends
Input-> [module definition file]./ws_iucs.def, defines the file of the function to be exported. If you want to export the function, this must be defined.
Definition Format:
Library wsiucsparser
Description "wsiucsparser DLL"
Exports
Initwsparseriucs @ 1
Deinitwsparseriucs @ 2
Wsiucsparse @ 3
Debugging-> [generate program database file].../output/debug/wsiucsparser. PDB
Advanced-> [import library].../../output/debug/wsiucsparser. Lib