在vs2008中添加lib文件以及一些常用项目设置选项

下面以添加ws2_32.lib文件为例

方法一(直接添加代码):

直接在.cpp文件中,添加#pragma comment(lib, "ws2_32.lib");即可。(ws2_32.lib即为你要添加的lib文件)

 

方法二(在vs工具栏中添加):

1.项目(project) -> TcpSrv属性(TcpSrv properties) (其中TcpSrv为工程名)

属性

 

 

2.打开TcpSrv属性页后,配置属性 -> 链接器(linker) -> 输入(Input) ,在附加依赖项 (AddITional dependences)中输入ws2_32.lib即可。

属性页

 

PS:括号内英文部分为英文版vs2008

 

 

 

 

【Configuration Properties】

  General-> 【Output Directory】  .../../output/debug 表示生成文件的输出路径

  General->【Intermediate Directory】.WsIuCsParser___Win32_Debug表示生成的中间路径

 Debugging->【Command】../../output/debug/TMPlatformConsole.exe表示此工程为Dll,TMPlatformConsole.exe会调用这个dll,并且可以在Dll中添加断点

Debugging->【Working Directory】../../output/debug,设置工作的路径

【c/c++】

General-> 【Additonal Include Directories】./include/epan,./include/glib,./include,./include/decode表示此工程所依赖的文件所在路径

Precompiled headers->【Precompiled Header File】.WsIuCsParser___Win32_Debug/WsIuCsParser.pch

预编译头文件

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,定义输出文件路径及名称

General->【Additional Library Directories】./lib 依赖lib路径

Input->【Additional Dependencies】 glib-2.0.lib gmodule.lib  依赖的lib文件

Input->【Module Definition File】./ws_IuCs.def,定义要导出函数的文件,如果要导出函数,这是必须定义的

定义格式:

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

 

转载于:https://www.cnblogs.com/For-her/p/3899534.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值