VS 2005 中使用 VC6.0中编写的Project 若干问题(08应该也可以)

来源:互联网 发布:混油皮水乳推荐知乎 编辑:程序博客网 时间:2024/04/29 05:31

1.如何在VS2005中加入编译好的库lib?

Re:在VC6.0中的Project settings的选项卡里面可以实现库的引用。在VS2005中也类似。

(1)Project -> Properties -> Configuration Properties -> Linker -> Genel 选项里面进行下列设置:

(2)Additional Library Directories 设置库文件所在路径;

(2)Link library Dependencies 设置为Yes;

(3)Use library Dependency Inputs 设置为Yes;

(4)在Project -> Properties -> Configuration Properties -> Linker -> Input -> Additional Dependencies中添加库的名称;

2.如何加入Include文件夹?

Re:在VC6.0中也是在Project Settings的C/C++的Include Derictory设置的。在VS2005中也类似。

(1)Project -> Properties -> Configuration Properties -> C/C++ -> Genel 选项的Additional Include directories 中加入要包含的头文件的目录即可。例如:添加C:/Programms/Microsoft Sdks/Windows/v6.0就是包含了Windows Vista Platform sdk的头文件夹。

3.Warning C4819:The file contains a character that can ot be represented in the current code page(936). save the file in unicode format to prevent data loss.

中文意思是:该文件包含不能在当前代码页中表示的字符,请将文件保存为Unicode格式,以防止数据丢失。

一般来说,这个警告没有什么影响。要想去掉这个警告的方法有:

(1)转换Code文件为Unicode格式;

(2)在Project -> Properties -> Configuration Properties -> C/C++ -> Advance 的 Disable Specific Warnings 中添加相应的警告编号:4819;

(3)或找出不符合Unicode格式的文件,然后在该文件的开始处加入下面的语句:

        # pragma warning (disable:4819)

4.warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

这个问题是C语言里面某些函数的安全性检查通不过。消除Warning信息方法:

(1)按照编译器推荐的把函数改为安全的。例如:strcpy改为strcpy_s;itoa改为_itoa_s等等;

(2)或设置Project -> Properties -> Configuration Properties -> c/c++ -> Preprocessor -> Preprocessor Definitons里面添加 _CRT_SUCURE_NO_WARNINGS / _CRT_SUCURE_NO_DEPRECATE

文章出处:http://www.diybl.com/course/3_program/vc/vc_js/2007114/83624.html


本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/LIUW_9/archive/2009/06/17/4275714.aspx

原创粉丝点击