LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-12-2019, 12:21 PM   #1
rdx
Member
 
Registered: Apr 2007
Location: Dallas
Distribution: Slackware64 14.2
Posts: 283

Rep: Reputation: 25
Using OpenCV with C++ on Slackware


I want to use OpenCv with C++ but I am having troubles.
On my desktop, running Slackware64 14.1, the SlackBuilds process craps out with a series of errors related to "'GstMiniObjectClass' does not name a type" This is trying to install opencv-3.0.0

On my laptop, running Slackware64 14.2 I have been rather more successful but not quite enough. After installing opencv-4.0.1 I was able to use the library through python (both 2.7 and 3.6) and I can compile a simple C++ program but when I try to run it, the dynamic library isn't found. I'm not sure where these dynamic libraries are so I can't tell the system where to look. Maybe this should be part of the SlackBuilds install process?

Any advice or suggestions are welcome. Thanks.
 
Old 03-13-2019, 12:06 AM   #2
rdx
Member
 
Registered: Apr 2007
Location: Dallas
Distribution: Slackware64 14.2
Posts: 283

Original Poster
Rep: Reputation: 25
I've made some progress on the Laptop problem. Simple programs are compiling and running. The difference was the syntax of the Makefile

%:: %.cpp
g++ $< -o $@ `pkg-config --cflags --libs opencv`

Although this is working, I'm not sure its completely right, but it is big progress.
 
Old 03-25-2019, 07:36 AM   #3
rdx
Member
 
Registered: Apr 2007
Location: Dallas
Distribution: Slackware64 14.2
Posts: 283

Original Poster
Rep: Reputation: 25
As I said before, the makefile was close but not completely right. For the 14.2 machine I found the better script to be:
Code:
%::    %.cpp
       g++ $< -o $@ -std=c++11 `pkg-config --cflags --libs opencv4`
Along the way I crashed my 14.1 system so I don't need to try to make OpenCV work there any more.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Error Compiling OpenCV 2.4.4 Slackware 14.0 ezanten Linux - Software 1 03-30-2013 11:53 PM
Can not get OpenCV work in Slackware t35t Slackware 8 11-14-2012 11:56 PM
[SOLVED] Error while using OpenCv mangatrai Programming 3 06-26-2012 04:19 PM
OpenCV - Pixel format of incoming image is unsupported by OpenCV golmschenk Programming 1 04-01-2011 12:32 PM
using avi files with OpenCV dmaman Programming 2 03-25-2004 08:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration