Tag: raspbian

无法在内联汇编中声明.data

你好,我有一个问题,我似乎无法声明.data。 我用我的代码尝试了各种不同的东西,它似乎总是打破这一部分 asm( “.data\n” “.file: .ascii \”/dev/mem\\000\”\n” ); 我也可以删除.data之后的任何信息,它仍会在’.data’处中断。 这是在带有内联汇编的树莓派2上完成的。如果其余的代码是相关的,请告诉我,但我很确定它不是。 谢谢你的帮助! 编辑:道歉我忘了包含错误消息 “错误:’此处’方法名称’的.size表达式不会计算为常量

使用g_object_set / strchr进行分段错误

这行给我一个分段错误 : g_object_set(G_OBJECT(data.udpsrc), “port”, 5000, “caps”, caps, NULL); 哪里 data.udpsrc = gst_element_factory_make(“udpsrc”, “source”); caps = gst_caps_new_empty_simple(“application/x-rtp”); 这是gdb的输出: Program received signal SIGSEGV, Segmentation fault. strchr () at ../ports/sysdeps/arm/armv6/strchr.S:28 28 ../ports/sysdeps/arm/armv6/strchr.S: No such file or directory. (gdb) bt #0 strchr () at ../ports/sysdeps/arm/armv6/strchr.S:28 #1 0x76e618d8 in g_param_spec_pool_lookup () from /usr/lib/arm-linux-gnueabihf/libgobject-2.0.so.0 #2 0x76e5c6a4 in g_object_set_valist () from /usr/lib/arm-linux-gnueabihf/libgobject-2.0.so.0 […]

在Raspbian中创建一个Makefile

我正在尝试在Raspbian(Raspberry Pi)中为我的C程序创建一个Makefile。 我的程序包含一堆.c和.h文件。 我看过无数的Makefiles,但我不会解释它如何与多个文件一起工作。 Makefile中总有.o文件,但据我所知,目标文件是编译的结果,所以我没有任何o。 文件,因为我正在尝试编译我的.c文件。 请向我解释这是如何工作的。 编辑: 谢谢。 所以我尝试了这个,它开始编译,但有错误’多重定义’。 例: 这些是我的文件: main.c main.h calibration.c calibration.h file.c file.h frame.c frame.h gamepad.c gamepad.h gpio.c gpio.h uart.c uart.h types.h 这是我的makefile: all: main main: main.o calibration.o file.o frame.o gamepad.o gpio.o uart.o %.o: %.c gcc -c -std=c99 -Wall $< -o $@ -lncurses 我在哪里可以放’types.h’? 对于每个文件,我都会收到错误“多个定义”

Linux上的这个GCC错误是什么,我该如何解决? gcc:内部编译器错误:非法指令(程序为)

我输入gcc hello.c ,这会出现: gcc: internal compiler error: Illegal instruction (program as) Please submit a full bug report, with preprocessed source if appropriate. See for instructions. hello.c只是: int main() { return 0; } 我想不出有什么方法可以让它更简单! (那里的printf也是如此。) 那么:你如何解决这个问题? 我在Raspberry Pi上的Raspian上。 编辑 gcc -v给出 Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.6/lto-wrapper Target: arm-linux-gnueabihf Configured with: ../src/configure -v –with-pkgversion=’Debian 4.6.3-14+rpi1′ –with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs –enable-languages=c,c++,fortran,objc,obj-c++ […]