- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
在我正在处理的 openwrt 包中,我通过将以下 bloc 添加到 Config.in 文件来定义一个新的配置标志:
config VENDOR_PREFIX
string "Vendor Prefix"
default "X_Custom_SE_"
在 menuconfig 中很好地添加了标志:
我希望这个配置标志的值在我的 C 代码中被视为一个宏。因此,我在包的 Makefile 中定义了一个宏 CUSTOM_PREFIX,并通过这种方式为其分配了已定义标志的值:
TARGET_CFLAGS += -DCUSTOM_PREFIX=\"$(CONFIG_VENDOR_PREFIX)\"
然后我尝试在我的 C 代码中使用我的宏,方法是在这样的结构变量初始化中调用它:
struct parameter_struct param1= {CUSTOM_PREFIX"param1", 4};
之后我尝试编译它。但是我得到了这个编译错误:
/home/user/openwrt//staging_dir/toolchain-mips_mips32_gcc-5.5.0_musl/usr/include -I/home/user/openwrt/staging_dir/toolchain-mips_mips32_gcc-5.5.0_musl/include/fortify -I/home/user/openwrt/staging_dir/toolchain-mips_mips32_gcc-5.5.0_musl/include -I/home/user/openwrt/staging_dir/target-mips_mips32_musl/usr/include -I/home/user/openwrt/staging_dir/target-mips_mips32_musl/usr/include -I/home/user/openwrt/staging_dir/target-mips_mips32_musl/usr/include -DCWMP_VERSION=\"3.0.0\" -I../inc/ -I../dm/ -I../dm/dmtree/ -I../dm/dmtree/common -I../dm/dmtree/tr098 -I../dm/dmtree/tr181 -I../dm/dmtree/upnp -Os -pipe -mips32 -mtune=mips32 -fno-caller-saves -DCONFIG_TARGET_iopsys_brcm63xx_mips -g3 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -iremap/home/user/openwrt/build_dir/target-mips_mips32_musl/icwmp-curl/icwmp-4.0-2018-03-21:icwmp-4.0-2018-03-21 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -DCUSTOM_PREFIX=X_CUSTOM1_SE_ -D_GNU_SOURCE -D_AADJ -MT ../dm/dmtree/common/libdatamodel_la-deviceinfo.lo -MD -MP -MF ../dm/dmtree/common/.deps/libdatamodel_la-deviceinfo.Tpo -c ../dm/dmtree/common/deviceinfo.c -fPIC -DPIC -o ../dm/dmtree/common/.libs/libdatamodel_la-deviceinfo.o
^
../dm/dmtree/common/deviceinfo.c: At top level:
<command-line>:0:15: error: 'X_CUSTOM1_SE_' undeclared here (not in a function)
../dm/dmtree/common/deviceinfo.c:28:2: note: in expansion of macro 'CUSTOM_PREFIX'
{CUSTOM_PREFIX"param1", 4}
struct parameter_struct param1= {CUSTOM_PREFIX"param1", 4};似乎 c 程序不接受它作为字符串。我的宏定义有问题吗?
最佳答案
正如我所预料的那样,我在帖子标题中指出错误出在 Makefile 中宏的定义中。在 Openwrt Makefile 中,宏的定义应该是这样的:
TARGET_CFLAGS += -DCUSTOM_PREFIX=\\\"$(CONFIG_VENDOR_PREFIX)\\\"
关于c - Openwrt包的Makefile中错误定义宏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50953309/
我已经从 subversion 存储库成功克隆了 OpenWRT buildroot,并且我一直在使用它来构建在 Qemu 上运行的镜像。我可以在 Qemu 中运行图像。 现在我尝试为路由器(Link
我在 OpenWRT 下构建了许多自定义软件包,我想将它们添加到自定义源中,这样我就可以让 IoT 设备提取这些自定义软件包的更新。 我浏览了所有 OpenWRT 文档并进行了多次谷歌搜索,但没有找到
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 7年前关闭。 Improve thi
最近,我在很多设备上配置了 OpenWrt,它是一个很好的无线路由器固件。我阅读了很多关于 OpenWISP 的内容: OpenWISP is a software platform designed
我将在 OpenWRT 镜像中包含 pip3 模块,因此在安装 OpenWRT 镜像后不需要其他依赖项。 例如,我将在 OpenWRT 镜像中包含 argparse 模块。该模块可以通过以下命令在初始
我正在尝试使用 OpenWRT 工具链为 OpenWRT Linux 环境交叉编译 POCO 源包。我已经下载了 POCO 源码包并尝试交叉编译它,但是我得到如下错误日志 src/Error.cpp:
我正在运行 dd-wrt 或 OpenWRT 的 Linksys WRT54G-V4 上运行 Hello World 程序。 现在这个路由器正在运行 dd-wrt,原因我将在下面解释。我想将此路由
我想重启我的设备,它有 Openwrt 操作系统。我希望命令使用 crontab 运行并且只执行一次。 最佳答案 如果您只想运行一次,那么最好通过 ssh openwrt 并进入终端并键入 reboo
最近买了个N1盒子,从源系统刷到OpenWrt,总结一下整体过程,大部分都来源于网络教程和自己实践,如有错误欢迎指出! N1盒子刷机 固件准备 最著名的应该是F大的吧,原贴地址:
我正在寻找在 openwrt 上运行的 tcpdump 二进制文件。该网站仅显示必须构建的源代码。有人指向我包含预构建二进制文件的位置吗?谢谢。 最佳答案 我建议建立一个工作存储库,即: https:
uci文档说: All "uci set", "uci add", "uci rename" and "uci delete" commands are staged into a temporary
如果有人能帮助我解决这个问题,我会非常感激,因为它让我发疯。 当我从头开始编译 OpenWRT 镜像(包括我的包)时,通常一切正常。 否则,当我尝试重新编译时,我不断收到缺少依赖项的错误。 我发现唯一
我正在尝试使用我在其中制作的自定义包来编译 OpenWRT。这是我的包的 OpenWRT Makefile: # # Copyright (C) 2008 OpenWrt.org # # This i
OpenWRT使用opkg来管理包。默认情况下,运行 opkg update 时会下载 Packages 和 Packages.sig 文件,然后根据 Packages 文件验证签名文件 Packag
我正在尝试将软件包安装到我的 OpenWrt SDK 中。为此,您必须通过键入以下内容来使用 OPKG 包管理器: opkg update opkg install 但是,就我而言,未安装 OPKG
我为 OpenWrt 路由器编译了一个简单的 C UDP 服务器和客户端。当代码都在我的电脑上时,代码可以按预期工作。客户端(如果在路由器上)似乎成功发送了数据包(端口 6115),因为如果我将它们发
我正在尝试为 VoCore v1.0 构建内核镜像。我从 github 获取了 sdk 文件。这样做时我遇到了如下错误 /build_root/openwrt/staging_dir/host/bin
我想在 OpenWRT 中执行 GMOCK 和 GTEST 测试。我有 x86_64 机器。我的包裹适用于 x32 设备。我尝试手动复制 header ,但是,当然,它不起作用。在设备内部运行测试很重
我正在为 Arduino Yun 板构建 openWrt,我正在按照 this link 中描述的步骤进行操作,但是我遇到了构建错误:svn: E160013: 无法连接到 URL 'http://o
我是 OpenWrt 的新手,我正在尝试交叉编译一个新内核。为了找到线索,我检查了/source/package/kernel/linux/modules 中一个名为 video.mk 的文件 我可以
我是一名优秀的程序员,十分优秀!