LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-21-2014, 12:39 AM   #1
rohaanembedded
Member
 
Registered: May 2013
Location: India
Distribution: Ubuntu 11.10
Posts: 178

Rep: Reputation: Disabled
Question Creating the single executable of Qt App which uses the OpenCV


Dear sir,

I am using Qt Creator 2.2.1 based on Qt 4.7.4 and opencv-2.4.6.1 to develop app which shows images on my qt app and some basic image manipulation.

As I am done with the basic app i want to make it deployable utility but as i am using the opencv it shows dependency of opencv not installed.
how can i make single executable of this app so that PC on which it is going to be used will not need to install Qt and OPenCV.

I Hvae tried some changes in qt project .pro file like added
Code:
CONFIG +=static
.pro file
Code:
QT       += core gui

TARGET = PIV
TEMPLATE = app


SOURCES += main.cpp\
        mainwindow.cpp

HEADERS  += mainwindow.h

FORMS    += mainwindow.ui

# include own lib
INCLUDEPATH += /home/usb/include/
INCLUDEPATH += /home/usb/FPR/src/

LIBS += -L/home/usb/FPR/lib -lsyn -L /home/usb/lib -lcyusb # .so files

LIBS += `pkg-config opencv --libs`

CONFIG += static
please let me know the procedure to make this single executable.
i read some of the articles related with this but didnt got specific idea if one has done this please help me

Note:
I am using
Distributor ID: Ubuntu
Description: Ubuntu 11.10
Release: 11.10
Codename: oneiric

Regards,
Rohaan
 
Old 01-22-2014, 04:02 PM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
I have always had trouble "deploying" Qt applications that were non-static. As a result I always configure Qt and make Qt static.

This means that you'd need to configure the Qt toolkit and remake it using the static argument.

In your Qt directory where the source for Qt is located:

Code:
./configure <all other arguments you've already used> -static
make
sudo make install
Not sure if you wish to take that step, but that's what I've done to be able to give out Qt apps and just give out the final binary executable without needing a bunch of libraries or other dependencies.

Note also: I have config.status which shows the last form of my ./configure command. Well, sorry either config.status or config.last. I think I copied one as a former backup and forget which one Qt natively creates. But my point is Qt does create a record of your last ./configure argument so you can see what you did ... two years ago (Yes! That's how long it's been since I've rebuilt my Qt :-) )

Last edited by rtmistler; 01-22-2014 at 04:05 PM.
 
  


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
Trying to make single executable of my java app in linux rohaanembedded Programming 2 06-28-2013 12:07 AM
OpenCV - Pixel format of incoming image is unsupported by OpenCV golmschenk Programming 1 04-01-2011 12:32 PM
Creating a shortcut to an executable in Debian 5 Zango Debian 1 08-07-2010 11:29 AM
creating a window in linux with a 'window' variable??! (openCV) vmok82 Programming 1 02-28-2005 03:38 PM
creating an executable file liljhand Linux - Newbie 5 01-23-2005 10:56 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:04 PM.

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