在www.37signals.com/看到的一条招聘启事

Scribd正在寻找Flex开发者,这一招聘信息发布在其职位公告板上。这可能意味着37signals考虑采用Flex作为其产品的前端技术。
Jobs:
Scribd is looking for a Flex Developer. See more on the Job Board.


(http://www.37signals.com/svn/posts/1330-introducing-wysihat-an-eventually-better-open-source-wysiwyg-editor)

什么意思?37signals开始打算用Flex做表示层了?
又出现了这个问题 ../lib/tevent/tevent_signal.c: In function 'tevent_num_signals': ../lib/tevent/tevent_signal.c:42:9: error: 'TEVENT_NUM_SIGNALS' undeclared (first use in this function) 42 | return TEVENT_NUM_SIGNALS; | ^~~~~~~~~~~~~~~~~~ ../lib/tevent/tevent_signal.c:42:9: note: each undeclared identifier is reported only once for each function it appears in ../lib/tevent/tevent_signal.c: At top level: ../lib/tevent/tevent_signal.c:74:49: error: 'TEVENT_NUM_SIGNALS' undeclared here (not in a function) 74 | struct tevent_common_signal_list *sig_handlers[TEVENT_NUM_SIGNALS+1]; | ^~~~~~~~~~~~~~~~~~ The following command failed: arm-buildroot-linux-gnueabi-gcc -I../lib/zlib -DMAX_DEBUG_LEVEL=-1 -D__location__=\ -ffunction-sections -fdata-sections -I. -I/data/red-round3/red-round3/Iplatform/openwrt/build_dir/target-arm-openwrt-linux-uclibc-be220v1/samba-3.6.25/source3 -I/data/red-round3/red-round3/Iplatform/openwrt/build_dir/target-arm-openwrt-linux-uclibc-be220v1/samba-3.6.25/source3/../lib/popt -I/data/red-round3/red-round3/Iplatform/openwrt/build_dir/target-arm-openwrt-linux-uclibc-be220v1/samba-3.6.25/source3/../lib/iniparser/src -Iinclude -I./include -I. -I. -I./../lib/replace -I./librpc -I./.. -I./../lib/talloc -I./../lib/tevent -I../lib/tdb/include -DHAVE_CONFIG_H -I/data/red-round3/red-round3/Iplatform/openwrt/staging_dir/target-arm-openwrt-linux-uclibc-be220v1/usr/include -I/data/red-round3/red-round3/Iplatform/openwrt/staging_dir/target-arm-openwrt-linux-uclibc-be220v1/include -I/data/red-round3/red-round3/Iplatform/openwrt/staging_dir/usr-be220v1/include -I/data/red-round3/red-round3/Iplatform/openwrt/../../bcm504L04/toolchain/opt/toolchains/crosstools-arm_softfp-gcc-10.3-linux-4.19-glibc-2.32-binutils-2.36.1/usr/include -Iinclude -I./include -I. -I. -I./../lib/replace -I./librpc -I./.. -I./../lib/popt -I/usr/local/include -I/data/red-round3/red-round3/Iplatform/openwrt/build_dir/target-arm-openwrt-linux-uclibc-be220v1/samba-3.6.25/source3/lib -I.. -D_SAMBA_BUILD_=3 -D_SAMBA_BUILD_=3 -c ../lib/tevent/tevent_signal.c -o ../lib/tevent/tevent_signal.o Makefile:1675: recipe for target '../lib/tevent/tevent_signal.o' failed make[4]: *** [../lib/tevent/tevent_signal.o] Error 1 make[4]: Leaving directory '/data/red-round3/red-round3/Iplatform/openwrt/build_dir/target-arm-openwrt-linux-uclibc-be220v1/samba-3.6.25/source3' Makefile:221: recipe for target '/data/red-round3/red-round3/Iplatform/openwrt/build_dir/target-arm-openwrt-linux-uclibc-be220v1/samba-3.6.25/.built' failed make[3]: *** [/data/red-round3/red-round3/Iplatform/openwrt/build_dir/target-arm-openwrt-linux-uclibc-be220v1/samba-3.6.25/.built] Error 2 make[3]: Leaving directory '/data/red-round3/red-round3/Iplatform/packages/opensource/samba' package/Makefile:133: recipe for target 'package/feeds/iplatform/samba/compile' failed make[2]: *** [package/feeds/iplatform/samba/compile] Error 2 make[2]: Leaving directory '/data/red-round3/red-round3/Iplatform/openwrt' /data/red-round3/red-round3/Iplatform/openwrt/include/toplevel.mk:184: recipe for target 'package/samba/compile' failed make[1]: *** [package/samba/compile] Error 2 make[1]: Leaving directory '/data/red-round3/red-round3/Iplatform/openwrt' Makefile:234: recipe for target 'iplatform_package/samba/compile' failed make: *** [iplatform_package/samba/compile] Error 2
11-02
<think>我们遇到了一个新的编译错误:在编译tevent_signal.c时,TEVENT_NUM_SIGNALS未声明。这通常是由于头文件未正确包含或宏定义缺失导致的。此外,我们注意到在编译命令中仍然包含了不安全的路径`-I/usr/local/include`,这可能会引起交叉编译污染。 ### 错误分析: 1. **TEVENT_NUM_SIGNALS未定义**: - 这个宏应该在tevent的内部头文件中定义,但编译过程中未能找到。 - 可能的原因包括: - 头文件未正确生成(例如,由于配置步骤失败) - 头文件路径未被正确包含 - 宏定义条件未满足(例如,没有启用某些特性) 2. **路径污染依然存在**: - 编译命令中仍然包含`-I/usr/local/include`,这是宿主机路径,在交叉编译中可能导致错误。 ### 解决方案: #### 步骤1:彻底清除不安全路径 在环境变量中移除所有对宿主机路径的引用: ```bash # 清除CFLAGS和LDFLAGS中的不安全路径 export CFLAGS=$(echo $CFLAGS | sed -e 's|-I/usr/local/include||g' -e 's|-I/usr/include||g') export LDFLAGS=$(echo $LDFLAGS | sed -e 's|-L/usr/local/lib||g' -e 's|-L/usr/lib||g') ``` #### 步骤2:确保tevent头文件被正确包含 检查编译命令中的包含路径,确保`../lib/tevent`路径被正确包含。从错误日志中,我们看到已经包含了`-I./../lib/tevent`,这应该是正确的。 #### 步骤3:检查tevent头文件中的宏定义 我们需要确认`TEVENT_NUM_SIGNALS`是否在某个头文件中定义。通常,它应该在`tevent_internal.h`或类似头文件中定义。如果未定义,可能是配置步骤没有正确生成头文件。 #### 步骤4:重新运行configure并检查config.log 重新运行configure,并检查config.log中是否有关于tevent的错误: ```bash # 清理之前的配置 make distclean # 重新配置(使用之前确定的正确配置参数) ./configure ... \ --with-libtevent=internal \ --enable-builtin-libraries=tevent \ ... # 其他参数 # 检查config.log中的错误 tail -n 100 config.log | grep -i error ``` #### 步骤5:手动添加宏定义(临时解决方案) 如果问题仍然存在,可以尝试在编译命令中添加宏定义: ```bash export CFLAGS="$CFLAGS -DTEVENT_NUM_SIGNALS=64" ``` 注意:64是一个常见的值(对应64个信号),但具体值需要根据系统确定。如果不知道具体值,可以尝试64。 #### 步骤6:检查tevent版本 确认使用的tevent版本是否与Samba版本兼容。Samba 3.6.25可能需要特定版本的tevent。如果版本不匹配,可能需要更新或降级tevent。 ### 完整修复示例: ```bash # 清理构建目录 make distclean # 设置环境变量 export CFLAGS="-DMAX_DEBUG_LEVEL=-1 -ffunction-sections -fdata-sections -I... (其他安全路径) -DTEVENT_NUM_SIGNALS=64" export LDFLAGS="-L... (安全路径) -Wl,--gc-sections" # 重新配置 ./configure \ --host=arm-buildroot-linux-gnueabi \ --prefix=/usr \ --with-libtalloc=internal \ --with-libtevent=internal \ --enable-builtin-libraries=talloc,tevent \ ac_cv_header_zlib_h=yes \ samba_cv_zlib_1_2_3=yes # 编译 make -j$(nproc) ``` ### 备用方案: 如果上述方法无效,可以尝试在源代码中定义`TEVENT_NUM_SIGNALS`: ```c // 在tevent_signal.c的开头添加 #ifndef TEVENT_NUM_SIGNALS #define TEVENT_NUM_SIGNALS 64 #endif ``` > **注意**:修改源代码是最后的手段,因为这可能影响代码的稳定性。 §§相关问题§§ 1. 当编译错误提示某个宏(如TEVENT_NUM_SIGNALS)未定义时,有哪些系统性的排查步骤? 2. 在交叉编译过程中,如何确保所有必要的头文件都被正确包含且不会与宿主机路径冲突? 3. 对于Samba这类依赖于多个内部库(talloc/tevent/tdb)的项目,如何确保所有内部库的版本兼容性? 4. 如何快速确定一个未定义宏(如TEVENT_NUM_SIGNALS)的合理默认值以绕过编译错误? </think>### TEVENT_NUM_SIGNALS编译错误分析与解决方案 #### 核心问题诊断 错误集中在tevent库的宏定义缺失: ```c error: 'TEVENT_NUM_SIGNALS' undeclared ``` 这表明: 1. 配置阶段未正确生成`tevent_config.h`头文件 2. 源码依赖的宏未在交叉编译环境中正确定义 3. 头文件包含路径存在冲突(特别是`-I/usr/local/include`污染) #### 根本原因分析 1. **配置阶段未检测信号支持** 在`configure`阶段未正确处理`NSIG`宏定义,导致`tevent_config.h`中缺失`HAVE_NSIG`定义 2. **头文件污染仍未解决** 编译命令仍包含危险路径:`-I/usr/local/include` 3. **arm架构信号限制** ARM架构默认信号数量(NSIG)可能与x86不同,需显式定义 #### 分步修复方案 ##### 1. 强制生成tevent_config.h ```bash # 手动创建关键配置 cat > ../lib/tevent/tevent_config.h <<EOF #define HAVE_NSIG 1 #define NSIG 64 # ARM架构典型值 #define TEVENT_NUM_SIGNALS NSIG EOF ``` ##### 2. 彻底清除路径污染 ```bash # 永久移除危险路径 export CFLAGS=$(echo $CFLAGS | sed 's|-I/usr/local/include||g') export CXXFLAGS=$(echo $CXXFLAGS | sed 's|-I/usr/local/include||g') export LDFLAGS=$(echo $LDFLAGS | sed 's|-L/usr/local/lib||g') # 验证环境变量 echo $CFLAGS | grep -q "/usr/local" || echo "清理成功" ``` ##### 3. 添加架构特定宏定义 ```bash # 在CFLAGS中添加信号宏 export CFLAGS="$CFLAGS -DHAVE_NSIG=1 -DNSIG=64 -DTEVENT_NUM_SIGNALS=64" ``` ##### 4. 重新配置并编译 ```bash # 清除配置缓存 rm config.cache # 完整配置命令 ./configure \ --host=arm-buildroot-linux-gnueabi \ --with-libtevent=internal \ --disable-rpath \ --without-ads \ --without-ldap \ --without-pam \ CFLAGS="-DNSIG=64 -DTEVENT_NUM_SIGNALS=64 $CFLAGS" \ CPPFLAGS="$CPPFLAGS" # 编译前验证头文件 grep -m1 TEVENT_NUM_SIGNALS ../lib/tevent/tevent.h make -j$(nproc) ``` #### 备用解决方案 修改源代码: ```diff // 在tevent_signal.c开头添加 +#ifndef TEVENT_NUM_SIGNALS +#define TEVENT_NUM_SIGNALS 64 +#endif ``` > **关键验证点**: > ```bash > # 检查宏定义是否生效 > arm-buildroot-linux-gnueabi-gcc -dM -E - < /dev/null | grep -i SIG > > # 确认tevent_config.h存在 > ls -l ../lib/tevent/tevent_config.h > > # 检查NSIG定义 > grep -r "define NSIG" /data/.../toolchain/ > ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值