vs2008工程配置

一、添加H文件目录

依次点击“项目——配置属性——C/C++——常规”,

在“附加包含目录”中加入H文件所在的文件夹。(即项目所要用到的所有.h文件目录都要加进去)
 

二、添加LIB目录 

1)依次点击“项目——配置属性——链接器——常规”,在“附加库目录”中加入LIB所在目录
 
2)还没完,在“链接器”中找到“输入”,在“附加依赖项”中加入具体的lib库名字     或用#pragma comment(lib,"lua51.lib")
 

三、不是用预编译头

在编译时时候报错   在查找预编译头使用时跳过
环境:VS2008

微软官方解释:
Visual C++ Concepts: Building a C/C++ ProgramCompiler Warning (level 1) C4627Error Message
”: skipped when looking for precompiled header use
While searching for the location where a precompiled header is used, the compiler encountered an #include directive for the include file. The compiler ignores the #include directive, but issues warning C4627 if the precompiled header does not already contain the include file.
解决方案:
1、去掉预编译头
项目->属性->配置属性->c/c++->预编译头->创建使用预编译头->不使用预编译头  (为了跨平台不适用预编译)
2、将包含文件加到预编译头stdafx.h文件中
3、在每个.cpp中包含预编译头stdafx.h文件

  
 
原文地址:https://www.cnblogs.com/ztteng/p/3421394.html