小编Kai*_*igi的帖子

使用OpenCV库编译代码时链接错误

我正在尝试使用以下命令安装Opencv后编译示例程序:

g++ hello-world.cpp -o hello-world -I /usr/local/include/opencv -L /usr/local/lib -lm -lcv -lhighgui -lcvaux
Run Code Online (Sandbox Code Playgroud)

但是,我收到的错误是:

/usr/bin/ld: cannot find -lcv  
/usr/bin/ld: cannot find -lhighgui  
/uer/bin/ld: cannot find -lcvaux
collect2: ld returned 1 exit status
Run Code Online (Sandbox Code Playgroud)

我需要做些什么来纠正这个?我通过下载最新的稳定版本并使用cmake创建构建文件来安装opencv,然后从命令行运行make install.

有什么我可能错过的吗?

c++ opencv compilation

15
推荐指数
3
解决办法
5万
查看次数

从128位SSE向量加载和提取32位整数值的最有效方法是什么?

我正在尝试使用SSE内在函数来优化我的代码但是我遇到了一个问题,在我完成SSE内在函数操作以获得我想要的东西后,我不知道从向量中提取整数值的好方法.

有谁知道这样做的好方法?我用C编程,我的编译器是gcc版本4.3.2.

感谢你的帮助.

c gcc sse simd

7
推荐指数
2
解决办法
4698
查看次数

构建可执行文件时找不到pthread库?

我正在尝试为我创建的ThreadManager类构建一个简单的测试程序.正如您在下面的输出中看到的,我的ThreadManager和主代码似乎很好地编译成目标文件,但是当创建可执行文件时,它似乎无法找到对pthread类中任何函数的正确引用.我错过了什么?

g++    -c -o ThreadManager.o ThreadManager.cpp  
g++    -c -o main.o main.cpp  
g++ -o tm_test ThreadManager.o main.o -g    -lm  

ThreadManager.o: In function `ThreadManager::Create(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, void* (*)(void*))':  
ThreadManager.cpp:(.text+0x276): undefined reference to `pthread_create'  
ThreadManager.o: In function `ThreadManager::Create(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, void* (*)(void*), void*)':  
ThreadManager.cpp:(.text+0x4a3): undefined reference to `pthread_create'  
ThreadManager.o: In function `ThreadManager::Create(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, void* (*)(void*), void*, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':  
ThreadManager.cpp:(.text+0x70b): undefined reference to `pthread_create'  
ThreadManager.o: In function `ThreadManager::Cleanup(int)':  
ThreadManager.cpp:(.text+0x8d4): undefined reference to `pthread_join'  
ThreadManager.cpp:(.text+0xa5f): undefined reference to `pthread_join' …
Run Code Online (Sandbox Code Playgroud)

c++ makefile pthreads

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

在MFMailComposeViewController中修改UINavigationBar中的tintColor

我正在尝试修改MFMailComposeViewController的UINavigationBar中的tintColor,但这似乎不起作用.

   [[UINavigationBar appearanceWhenContainedIn:[MFMailComposeViewController class], nil] setTintColor:[UIColor whiteColor]];
   [[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], [MFMailComposeViewController class], nil] setTintColor:[UIColor blackColor]];
Run Code Online (Sandbox Code Playgroud)

在任何人引用Apple称"邮件组合界面本身不可自定义且不得被您的应用程序修改"之前,我之前已经提交了一个应用程序,该应用程序在App Store中以类似的方式修改了UINavigationBar,在审核过程中没有任何问题.

当我在整个应用程序中设置这些类的外观时,它会起作用,如下所示:

   [[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];
   [[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], nil] setTintColor:[UIColor blackColor];
Run Code Online (Sandbox Code Playgroud)

问题是我不希望这些外观设置应用于所有UINavigationBar/UIBarButtonItem实例.

我的理解是如何使用appearanceWhenContainedIn:不正确?或者是别的什么?

谢谢你的帮助一如既往:)

uinavigationbar ios

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

标签 统计

c++ ×2

c ×1

compilation ×1

gcc ×1

ios ×1

makefile ×1

opencv ×1

pthreads ×1

simd ×1

sse ×1

uinavigationbar ×1