小编Éti*_*nne的帖子

你什么时候为一个类定义ostream运算符<<?

问题可能是主观的,所以语法是

std::ostream& operator << (std::ostream & o, const SomeClass &a) {
    return o << a.accessor().. ; 
}
Run Code Online (Sandbox Code Playgroud)

你通常什么时候为你编写的类定义它,什么时候避免为你的类编写这个友元函数.

c++

2
推荐指数
1
解决办法
3908
查看次数

Linux CC编译错误

我正在尝试使用CC编译器编译程序,但在终端中运行命令时:

cc –o sm hw33.c random.c stopwatch.c –lm
Run Code Online (Sandbox Code Playgroud)

我收到此错误:

cc: error: –o: No such file or directory
cc: error: sm: No such file or directory
cc: error: –lm: No such file or directory
Run Code Online (Sandbox Code Playgroud)

存在所有文件,名称确实正确.

什么似乎是问题?谢谢.

cc

2
推荐指数
1
解决办法
883
查看次数

ARM 汇编中的语法

我一直在做更多的阅读并找到了这个链接。在这里,实现互斥锁的大部分步骤都非常直接且易于理解……但是在此代码段中有一些我不明白的事情:

    BEQ     %b1           ; Failed - retry from 1  
    ; Lock acquired  
    DMB                   ; Required before accessing protected resource  
    BX      lr  2         ; Take appropriate action while waiting for mutex to become unlocked  
    WAIT_FOR_UPDATE  
    B       %b1           ; Retry from 1  
Run Code Online (Sandbox Code Playgroud)

存在于lock_mutex过程中。%b1%f2是什么??它们与什么有关?

谢谢,维杰

arm

1
推荐指数
1
解决办法
1782
查看次数

USART接收中断stm32

我在地图上开发我正在研究STM32和USART中断.配置USART1并使能接收中断后.接收中断没有检测到的问题????

c stm32 interruption usart

1
推荐指数
1
解决办法
4万
查看次数

了解ARM汇编代码

任何人都可以向我解释这个短程序的作用吗?

ORIGIN 0x1000
one DEFW 13
two DEFW 29
three DEFW 0
ORIGIN 0x1010
ENTRY
ADR R0, one
LDR R1, [R0]
LDR R2, [R0, #4]
ADD R1, R2, R1
STR R1, [R0, #8]
SWI 2
Run Code Online (Sandbox Code Playgroud)

如果我正确思考,它会将'one'添加到'two'并将结果放在'three'中.我对么?

assembly arm

1
推荐指数
1
解决办法
1972
查看次数

如何在yocto中本地安装内核补丁?

我想如何在yocto中安装内核补丁.请指导我

我在calibrate.c文件中包含了几个printk语句,该文件位于/home/host/poky/build/tmp/work/armv7a-vfp-neon-poky-linux-gnueabi/linux-libc-headers/3.8-r0 /linux-3.8/init/calibrate.c

然后我用diff -uar创建了一个补丁文件〜/ calibrate.c /home/host/poky/build/tmp/work/armv7a-vfp-neon-poky-linux-gnueabi/linux-libc-headers/3.8-r0 /linux-3.8/init/calibrate.c> calibrate.patch

然后将calibrat.patch文件放在poky/meta/recipies-kernel/linux-libc-headers/linux-libc-headers /目录中

然后我编辑了位于/ poky/meta/recipies-kernel/linux-libc-headers /中的linux-libc-headers_3.8.bb文件,其中包含以下SCR_URI = file://calibrate.patch

然后执行bitbake -k core-image-minimal后,我收到以下错误.

ERROR: Command Error: exit status: 1  Output: Applying patch calibrate.patch can't find file to patch at input line 3 Perhaps you used the wrong -p or --strip option? The text leading up to this was:
-------------------------- |--- calibrate.c 2015-12-09 15:00:11.547924616 +0530 |+++ a/calibrate.c  2015-12-09 14:59:31.387923200 +0530
-------------------------- No file to patch.  Skipping patch. 1 …
Run Code Online (Sandbox Code Playgroud)

yocto

1
推荐指数
1
解决办法
7024
查看次数

无法在 opencv 中使用命令行解析器

我有以下代码:

int main(int argc, char** argv)
{
    cv::CommandLineParser parser(argc, argv,
            "{eyes||}{nose||}{mouth||}{help h||}");
    if (parser.has("help"))
    {
        help();
        return 0;
    }
    input_image_path = parser.get<string>(0);
    face_cascade_path = parser.get<string>(1);
    eye_cascade_path = parser.has("eyes") ? parser.get<string>("eyes") : "";
    nose_cascade_path = parser.has("nose") ? parser.get<string>("nose") : "";
    mouth_cascade_path = parser.has("mouth") ? parser.get<string>("mouth") : "";
    if (input_image_path.empty() || face_cascade_path.empty())
    {
        cout << "IMAGE or FACE_CASCADE are not specified\n";
        return 1;
    }
    // Load image and cascade classifier files
    Mat image;
    image = imread(input_image_path);
Run Code Online (Sandbox Code Playgroud)

当我按如下方式运行代码时: ./code help

或者作为,

./code eyes: …
Run Code Online (Sandbox Code Playgroud)

c++ opencv

1
推荐指数
1
解决办法
5057
查看次数

标签 统计

arm ×2

c++ ×2

assembly ×1

c ×1

cc ×1

interruption ×1

opencv ×1

stm32 ×1

usart ×1

yocto ×1