Ubuntu OpenCV 2.4.2 findContours抛出错误(带有CV示例程序)

Ubuntu OpenCV 2.4.2 findContours抛出错误(带有CV示例程序),ubuntu,opencv,Ubuntu,Opencv,我在VMware上运行了Ubuntu12.0432位。在此之后,我安装了OpenCV 2.4.2() 当我尝试从CV Page()运行findContours示例时,它会编译,但在“findContours”调用时崩溃 我不知道,有什么问题 我在Eclipse中使用运行代码。CDT构建控制台说: make all Building file: ../src/FrameTest.cpp Invoking: Cross G++ Compiler g++ -O0 -g3 -Wall -c -fmes

我在VMware上运行了Ubuntu12.0432位。在此之后,我安装了OpenCV 2.4.2()

当我尝试从CV Page()运行findContours示例时,它会编译,但在“findContours”调用时崩溃

我不知道,有什么问题

我在Eclipse中使用运行代码。CDT构建控制台说:

make all 
Building file: ../src/FrameTest.cpp
Invoking: Cross G++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/FrameTest.d" -MT"src/FrameTest.d" -o "src/FrameTest.o" "../src/FrameTest.cpp"
../src/FrameTest.cpp:26:2: warning: "/*" within comment [-Wcomment]
../src/FrameTest.cpp: In function ‘int main()’:
../src/FrameTest.cpp:319:25: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
../src/FrameTest.cpp: In function ‘void thresh_callback(int, void*)’:
../src/FrameTest.cpp:345:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Finished building: ../src/FrameTest.cpp

Building target: FrameTest
Invoking: Cross G++ Linker
g++ -L/home/ubu/workspace/opencv -L/usr/share -L/usr/share/doc/libcv-dev -L/lib -L/lib/i386-linux-gnu -L/home/ubu/OpenCV-2.4.2/include/opencv -L/home/ubu/OpenCV-2.4.2/include/opencv2 -o "FrameTest"  ./src/FrameTest.o   -lopencv_core -lopencv_highgui -lpthread -lopencv_imgproc
Finished building target: FrameTestenter code here
有人有主意吗?我从一个使用VS2010在Windows中运行CV2.2的旧项目中获得了其他代码,它可以正常工作。。。VStudio与Win、Eclipse和Ubuntu的区别在哪里


到目前为止非常感谢。

您似乎安装了两个版本的OpenCV,链接器尝试使用与编译代码不同的版本进行链接


最简单的方法是删除所有其他旧的OpenCV版本,然后可能的错误库路径将更加明确。检查所有设置路径、链接器标志和包含文件夹,以确保通过包含/complile/link设置使用相同的版本

您说您安装了OpenCV 2.4.2,但在错误中,库位于OpenCV-2.3.1中,请对此进行澄清。是的,这肯定有问题。我想卸载并重建最新版本。希望能奏效。ThxIt始终使用最新版本。请尝试opencv2.4教程,但请确保链接器和包含库的路径使用opencv2.4。接受答案好的,升级到Ubuntu 12.10,我想删除所有旧的OpenCV并编译2.4.3。完全卸载CV以获得新版本的最佳方式是什么?谢谢你!有趣的是,你是如何复制粘贴而不是链接到它的。
make all 
Building file: ../src/FrameTest.cpp
Invoking: Cross G++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/FrameTest.d" -MT"src/FrameTest.d" -o "src/FrameTest.o" "../src/FrameTest.cpp"
../src/FrameTest.cpp:26:2: warning: "/*" within comment [-Wcomment]
../src/FrameTest.cpp: In function ‘int main()’:
../src/FrameTest.cpp:319:25: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
../src/FrameTest.cpp: In function ‘void thresh_callback(int, void*)’:
../src/FrameTest.cpp:345:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Finished building: ../src/FrameTest.cpp

Building target: FrameTest
Invoking: Cross G++ Linker
g++ -L/home/ubu/workspace/opencv -L/usr/share -L/usr/share/doc/libcv-dev -L/lib -L/lib/i386-linux-gnu -L/home/ubu/OpenCV-2.4.2/include/opencv -L/home/ubu/OpenCV-2.4.2/include/opencv2 -o "FrameTest"  ./src/FrameTest.o   -lopencv_core -lopencv_highgui -lpthread -lopencv_imgproc
Finished building target: FrameTestenter code here