编译PWlib时搜索路径的配置

本文解决PWLib或OpenH323在Windows环境下配置过程中选择错误库版本的问题。介绍如何通过设置特定环境变量来排除某些目录,确保正确版本的库文件被使用。
The Windows configure process for PWLib or OpenH323 is finding the wrong version of a library - how do I stop this?

The configure program for Windows will search all directories looking for installed versions of libraries such as as expat.lib and openldap.lib. If other programs have versions of these libraries installed, then it is likely that configure will pick the wrong file. This is particularly likely if you have two development environments installed, such as VS.net and MSVC. 

To fix this, it is necessary to tell configure not to search in certain directories for files. This can be done by changing the configure command line in the project file, but there are also several predefined environment variables which, if set, will be used by configure to determine which directories to ignore. These variables are set to a list of directories seperated by semicolons (";") :

PWLIB_CONFIGURE_EXCLUDE_DIRSignore these directories always
MSVC_PWLIB_CONFIGURE_EXCLUDE_DIRSignore these directories when compiling using MSVC 6
VSNET_PWLIB_CONFIGURE_EXCLUDE_DIRSignore these directories when compiling using VS.net 2003
### 如何在编译配置中添加头文件路径 #### 编译配置概述 在编译C/C++程序编译器需要知道去哪里查找头文件。通常可以通过命令行参数、IDE设置或构建工具配置文件来指定头文件的路径。 #### 具体方法 ##### 1. 命令行编译 如果你使用命令行编译工具(如`gcc`或`clang`),可以使用`-I`选项来指定头文件的路径。语法如下: ```bash gcc -I/path/to/include -o output_file source_file.c ``` 例如,如果你的`SpiUart.h`文件位于`/home/user/project/include`目录下,你可以这样做: ```bash gcc -I/home/user/project/include -o my_program TskDataRx.c ``` ##### 2. IDE 设置(以Eclipse为例) 如果你使用Eclipse IDE进行开发,可以通过以下步骤添加头文件路径: 1. **打开项目属性** - 右键点击项目 -> `Properties`。 2. **进入C/C++ General设置** - 在左侧列表中选择`C/C++ General` -> `Paths and Symbols`。 3. **添加包含路径** - 选择`Includes`标签页。 - 点击`Add...`按钮,然后输入或浏览到包含`SpiUart.h`文件的目录路径。 - 确保选择正确的语言(如GNU C或GNU C++)。 - 点击`OK`保存设置。 4. **应用更改** - 点击`Apply and Close`以保存并应用更改。 ##### 3. 构建工具配置(如CMake) 如果你使用CMake作为构建工具,可以在`CMakeLists.txt`文件中添加包含路径: ```cmake include_directories(/path/to/include) ``` 例如: ```cmake include_directories(/home/user/project/include) ``` #### 知识点 1. **编译器选项配置** - 使用命令行参数或IDE设置配置头文件搜索路径- 确保编译器能找到所有依赖的头文件。 2. **路径管理** - 正确管理项目中的头文件路径,避免编译错误。 - 使用相对路径或环境变量可提高项目移植性。 3. **IDE集成开发** - 熟悉IDE中的项目属性设置,特别是包含路径和符号设置。 - 确保IDE中的配置与实际文件结构一致。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值