Autotools and OpenSSL MD5/RAND_bytes undefined - c++

For some reason I am getting undefined symbols for MD5 and RAND_bytes in this one particular C++ file. OpenSSL has installed itself (libssl and libcrypto) to /usr/lib and /usr/include/openssl/.
libtool: link: (cd ".libs" && rm -f "libeapgpsk.so.1" && ln -s "libeapgpsk.so.1.0.0" "libeapgpsk.so.1")
libtool: link: (cd ".libs" && rm -f "libeapgpsk.so" && ln -s "libeapgpsk.so.1.0.0" "libeapgpsk.so")
libtool: link: ar cru .libs/libeapgpsk.a eap-gpsk/eap_gpsk_fsm.o
libtool: link: ranlib .libs/libeapgpsk.a
libtool: link: ( cd ".libs" && rm -f "libeapgpsk.la" && ln -s "../libeapgpsk.la" "libeapgpsk.la" )
depbase=`echo tests/md5_test.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
g++ -DPACKAGE_NAME=\"OpenDiameter\" -DPACKAGE_TARNAME=\"opendiameter\" -DPACKAGE_VERSION=\"1.0.7-i\" -DPACKAGE_STRING=\"OpenDiameter\ 1.0.7-i\" -DPACKAGE_BUGREPORT=\"vfajardo#tari.toshiba.com\" -DPACKAGE_URL=\"\" -DPACKAGE=\"opendiameter\" -DVERSION=\"1.0.7-i\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_IFADDRS_H=1 -DHAVE_SHADOW_H=1 -DHAVE__BOOL=1 -DHAVE_STDBOOL_H=1 -DHAVE_GETIFADDRS=1 -I. -Wall -I/usr -I/usr -fno-strict-aliasing -I../include -I../libeap/include -DOS_LINUX -I/usr/include/openssl -I/usr/include/openssl -MT tests/md5_test.o -MD -MP -MF $depbase.Tpo -c -o tests/md5_test.o tests/md5_test.cxx &&\
mv -f $depbase.Tpo $depbase.Po
In file included from ../include/aaa_dictionary_api.h:45:0,
from ../include/aaa_parser_api.h:38,
from ../libeap/include/eap.hxx:54,
from tests/md5_test.cxx:45:
../include/framework.h:1653:7: warning: ‘typedef’ was ignored in this declaration [enabled by default]
In file included from ../include/aaa_parser_api.h:38:0,
from ../libeap/include/eap.hxx:54,
from tests/md5_test.cxx:45:
../include/aaa_dictionary_api.h:58:1: warning: ‘typedef’ was ignored in this declaration [enabled by default]
tests/md5_test.cxx: In constructor ‘EapTask::EapTask()’:
tests/md5_test.cxx:71:45: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
tests/md5_test.cxx: In constructor ‘PeerApplication::PeerApplication(EapTask&, ACE_Semaphore&)’:
tests/md5_test.cxx:418:72: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
tests/md5_test.cxx: In constructor ‘StandAloneAuthApplication::StandAloneAuthApplication(EapTask&, ACE_Semaphore&)’:
tests/md5_test.cxx:460:80: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
tests/md5_test.cxx: In constructor ‘BackendAuthApplication::BackendAuthApplication(EapTask&, ACE_Semaphore&, bool)’:
tests/md5_test.cxx:514:58: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
tests/md5_test.cxx: In constructor ‘PassThroughAuthApplication::PassThroughAuthApplication(EapTask&, ACE_Semaphore&, bool)’:
tests/md5_test.cxx:576:62: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
/bin/bash ../libtool --tag=CXX --mode=link g++ -I/usr/include/openssl -L/usr/lib -o md5_test tests/md5_test.o -ldl -lssl -lcrypto -lACE_SSL -lACE -lACEXML_Parser -lACEXML -lpthread -lboost_system -lboost_thread -lboost_system -lboost_thread -lACEXML -lACEXML_Parser -ldl -lssl -lcrypto ../libeap/libeap.la ../libeap/libeaparchie.la ../libeap/libeapgpsk.la -lboost_system -lboost_thread -lACEXML -lACEXML_Parser -ldl -lssl -lcrypto
libtool: link: g++ -I/usr/include/openssl -o .libs/md5_test tests/md5_test.o -L/usr/lib /usr/lib/libACE_SSL.so /usr/lib/libACE.so -lpthread ../libeap/.libs/libeap.so ../libeap/.libs/libeaparchie.so ../libeap/.libs/libeapgpsk.so -lboost_system -lboost_thread /usr/lib/libACEXML.so /usr/lib/libACEXML_Parser.so -ldl -lssl -lcrypto
../libeap/.libs/libeap.so: undefined reference to `MD5#OPENSSL_1.0.0'
../libeap/.libs/libeap.so: undefined reference to `RAND_bytes#OPENSSL_1.0.0'
collect2: ld returned 1 exit status
Here is the Makefile.am responsible for this:
## Process this file with automake to produce Makefile.in
srcdir = #srcdir#
VPATH = #srcdir#
AM_CPPFLAGS = #L_CPPFLAGS# \
-I#top_srcdir#/include \
-I#top_srcdir#/libeap/include \
-D#HOST_OS#
AM_LDFLAGS = #L_LDFLAGS#
if compile_EAPTLS
CORE_SRC = eapcore/eap_fsm.cxx \
eapcore/eap_peerfsm.cxx \
eapcore/eap_authfsm.cxx \
eapcore/eap_standalone_authfsm.cxx \
eapcore/eap_backend_authfsm.cxx \
eapcore/eap_passthrough_authfsm.cxx \
eapcore/eap_identity.cxx \
eapcore/eap_method_registrar.cxx \
eapcore/eap_policy.cxx \
eapcore/eap_notification.cxx \
eapcore/eap_md5.cxx
CORE_HDR = include/eap_api.h \
include/eap.hxx \
include/eap_authfsm.hxx \
include/eap_fsm.hxx \
include/eap_identity.hxx \
include/eap_log.hxx \
include/eap_md5.hxx \
include/eap_method_registrar.hxx \
include/eap_notification.hxx \
include/eap_parser.hxx \
include/eap_peerfsm.hxx \
include/eap_policy.hxx \
include/eap_archie_crypto.hxx \
include/eap_archie_fsm.hxx \
include/eap_archie_parser.hxx \
include/eap_archie.hxx \
include/eap_gpsk_crypto.hxx \
include/eap_gpsk_fsm.hxx \
include/eap_gpsk_parser.hxx \
include/eap_gpsk.hxx \
include/eap_tls.hxx \
include/eap_tls_mng.hxx \
include/eap_tls_session.hxx \
include/eap_tls_parser.hxx \
include/eap_tls_fsm.hxx \
include/eap_tls_xml_data.hxx \
include/eap_tls_xml_parser.hxx \
include/eap_tls_data_defs.hxx
else
CORE_SRC = eapcore/eap_fsm.cxx \
eapcore/eap_peerfsm.cxx \
eapcore/eap_authfsm.cxx \
eapcore/eap_standalone_authfsm.cxx \
eapcore/eap_backend_authfsm.cxx \
eapcore/eap_passthrough_authfsm.cxx \
eapcore/eap_identity.cxx \
eapcore/eap_method_registrar.cxx \
eapcore/eap_policy.cxx \
eapcore/eap_notification.cxx \
eapcore/eap_md5.cxx
CORE_HDR = include/eap_api.h \
include/eap.hxx \
include/eap_authfsm.hxx \
include/eap_fsm.hxx \
include/eap_identity.hxx \
include/eap_log.hxx \
include/eap_md5.hxx \
include/eap_method_registrar.hxx \
include/eap_notification.hxx \
include/eap_parser.hxx \
include/eap_peerfsm.hxx \
include/eap_policy.hxx \
include/eap_archie_crypto.hxx \
include/eap_archie_fsm.hxx \
include/eap_archie_parser.hxx \
include/eap_archie.hxx \
include/eap_gpsk_crypto.hxx \
include/eap_gpsk_fsm.hxx \
include/eap_gpsk_parser.hxx \
include/eap_gpsk.hxx
endif
ARCHIE_SRC = eap-archie/eap_archie_fsm.cxx
GPSK_SRC = eap-gpsk/eap_gpsk_fsm.cxx
if compile_EAPTLS
TLS_SRC = eap-tls/eap_tls_mng.cxx \
eap-tls/eap_tls_crypto.cxx \
eap-tls/eap_tls_fsm.cxx \
eap-tls/eap_tls_xml_data.cxx \
eap-tls/eap_tls_xml_parser.cxx
endif
includedir = $(prefix)/include/opendiameter/eap
include_HEADERS = $(CORE_HDR)
sysconfdir = $(prefix)/etc/opendiameter/eap
sysconf_DATA = config/client.eap-tls.xml \
config/server.eap-tls.xml
if compile_EAPTLS
lib_LTLIBRARIES = libeap.la libeaparchie.la libeapgpsk.la libeaptls.la
else
lib_LTLIBRARIES = libeap.la libeaparchie.la libeapgpsk.la
endif
libeap_la_SOURCES = $(CORE_SRC) $(CORE_HDR)
libeaparchie_la_SOURCES = $(ARCHIE_SRC)
libeapgpsk_la_SOURCES = $(GPSK_SRC)
if compile_EAPTLS
libeaptls_la_SOURCES = $(TLS_SRC)
endif
libeap_la_LIBADD = -ldl -lssl -lcrypto
libeap_la_LDFLAGS = -version-info 1:0:0 -lssl -lcrypto
libeap_la_AR = $(AR) -qcs
libeaparchie_la_LDFLAGS = -version-info 1:0:0
libeaparchie_la_AR = $(AR) -qcs
libeapgpsk_la_LDFLAGS = -version-info 1:0:0
libeapgpsk_la_AR = $(AR) -qcs
if compile_EAPTLS
libeaptls_la_LDFLAGS = -version-info 1:0:0
libeaptls_la_AR = $(AR) -qcs
LDADD = #L_LIBS# \
$(top_builddir)/libeap/libeap.la \
$(top_builddir)/libeap/libeaparchie.la \
$(top_builddir)/libeap/libeapgpsk.la \
$(top_builddir)/libeap/libeaptls.la \
$(top_builddir)/libdiamparser/libdiamparser.la
else
LDADD = #L_LIBS# \
$(top_builddir)/libeap/libeap.la \
$(top_builddir)/libeap/libeaparchie.la \
$(top_builddir)/libeap/libeapgpsk.la
endif
if compile_EAPTLS
noinst_PROGRAMS = md5_test archie_test gpsk_test tls_test
else
noinst_PROGRAMS = md5_test archie_test gpsk_test
endif
md5_test_SOURCES = tests/md5_test.cxx -lssl -lcrypto
archie_test_SOURCES = tests/archie_test.cxx
gpsk_test_SOURCES = tests/gpsk_test.cxx
if compile_EAPTLS
tls_test_SOURCES = tests/tls_test.cxx
endif
EXTRA_DIST = config
I suspect autotools isn't doing something because I haven't specified it to do so. Inside of the file md5_test.c, but it still errors.
#include <openssl/md5.h>
#include <openssl/rand.h>
Any help would be greatly appreciated.
Edit:
I dug into the libraries to see if there was versioning information and it led me to this very interesting predicament - openssl 1.0.0m when compiled with this command: ./config --prefix=/usr --openssldir=/etc/ssl --libdir=lib shared
Generates two sets of shared objects located in:
/usr/lib/x86_64-linux-gnu/
/usr/lib
The shared objects in /usr/lib/x86_64-linux-gnu/ Produce a version (used objdump -T)
00000000001546b0 g DF .text 0000000000000108 OPENSSL_1.0.0 PKCS7_to_TS_TST_INFO
The shared objects in /usr/lib produce this:
000000000012ee20 g DF .text 000000000000000c Base BIO_new_CMS
How would one fix this because this seems highly unstandard....?

Remove -lssl -lcrypto from the LDFLAGS for your libraries; the way the link editor works, LDFLAGS are passed before the object files, and that means they are discarded; in at least some version of the link editor, the libraries passed before object files are also "blacklisted", or to be precise, they get ignored when passed again.
You're passing -lssl -lcrypto twice in both LDFLAGS and LIBADD so you may be triggering that behaviour.

Related

How to solve gfortran compilation and linking error?

I have trying to compile a collection of old fortran and C codes with gfortran. They compile fine on a linux workstation but this fails in a Mac. Any idea on how to solve this ? The Makefile in the Linux version has one extra flag in CFLAGS and FFLAGS -mcmodel=large that I removed following some advice.
This is the error at the final linking line.
gfortran -fopenmp -O3 -m64 lsmrDataModule.o lsmrModule.o delsph.o gaussian.o CalSurfG2.o main2.o aprod.o cluster1.o covar.o datum.o delaz.o delaz2.o direct1.o dist.o exist.o freeunit.o ifindi.o indexxi.o juliam.o matmult1.o matmult2.o matmult3.o mdian1.o normlz.o ran.o redist.o resstat_FDD.o scopy.o sdc2.o setorg.o snrm2.o sort.o sorti.o sscal.o svd.o tiddid.o trialsrc_FDD_shot.o trimlen.o vmodel.o RaySPDR2new.o getinpSPDR.o getdata_SPDR.o dtres_FDD_lm5.o weighting_FDD.o lsfitHFDD_lsqr_lm5.o get_dims.o add_sta.o find_id2.o surfdisp96.o atoangle_.o atoangle.o datetime_.o hypot_.o rpad_.o sscanf3_.o transform_r_gfortran_double.o -o tomoJointBS
final section layout:
__TEXT/__text addr=0x1000014A0, size=0x0008F7D1, fileOffset=0x000014A0, type=1
__TEXT/__text_startup addr=0x100090C80, size=0x00000026, fileOffset=0x00090C80, type=1
__TEXT/__stubs addr=0x100090CA6, size=0x0000018C, fileOffset=0x00090CA6, type=28
__TEXT/__stub_helper addr=0x100090E34, size=0x000002A4, fileOffset=0x00090E34, type=32
__TEXT/__cstring addr=0x1000910D8, size=0x000130B9, fileOffset=0x000910D8, type=13
__TEXT/__const addr=0x1000A41A0, size=0x00004C6C, fileOffset=0x000A41A0, type=0
__TEXT/__eh_frame addr=0x1000A8E10, size=0x000051E0, fileOffset=0x000A8E10, type=19
__DATA/__got addr=0x1000AE000, size=0x00000028, fileOffset=0x000AE000, type=29
__DATA/__nl_symbol_ptr addr=0x1000AE028, size=0x00000010, fileOffset=0x000AE028, type=29
__DATA/__la_symbol_ptr addr=0x1000AE038, size=0x00000210, fileOffset=0x000AE038, type=27
__DATA/__const addr=0x1000AE248, size=0x00000010, fileOffset=0x000AE248, type=0
__DATA/__data addr=0x1000AE260, size=0x00000030, fileOffset=0x000AE260, type=0
__DATA/__pu_bss2 addr=0x1000AE290, size=0x000000A8, fileOffset=0x00000000, type=25
__DATA/__pu_bss5 addr=0x1000AE340, size=0x000004C0, fileOffset=0x00000000, type=25
__DATA/__bss5 addr=0x1000AE800, size=0x00229680, fileOffset=0x00000000, type=25
__DATA/__pu_bss3 addr=0x1002D7E80, size=0x00000028, fileOffset=0x00000000, type=25
__DATA/__common addr=0x1002D7EC0, size=0x000000A0, fileOffset=0x00000000, type=25
__DATA/__bss3 addr=0x1002D7F60, size=0x00000010, fileOffset=0x00000000, type=25
__DATA/__bss2 addr=0x1002D7F70, size=0x00000004, fileOffset=0x00000000, type=25
__DATA/__huge addr=0x1002D7F80, size=0x3FA6069F4, fileOffset=0x00000000, type=25
ld: unexpected bindingNone in '_MAIN__' from main2.o for architecture x86_64
collect2: error: ld returned 1 exit status
make: *** [tomoJointBS] Error 1
This is the Makefile.
CMD = tomoJointBS
CC = gcc
FC = gfortran
SRCS = main2.f\
aprod.f cluster1.f covar.f datum.f \
delaz.f delaz2.f direct1.f dist.f exist.f \
freeunit.f ifindi.f \
indexxi.f juliam.f \
matmult1.f matmult2.f matmult3.f mdian1.f \
normlz.f ran.f redist.f \
resstat_FDD.f scopy.f sdc2.f setorg.f \
snrm2.f sort.f sorti.f sscal.f \
svd.f tiddid.f trialsrc_FDD_shot.f trimlen.f \
vmodel.f RaySPDR2new.f \
getinpSPDR.f getdata_SPDR.f \
dtres_FDD_lm5.f weighting_FDD.f lsfitHFDD_lsqr_lm5.f \
get_dims.f add_sta.f find_id2.f \
surfdisp96.f
CSRCS = atoangle_.c atoangle.c datetime_.c hypot_.c rpad_.c \
sscanf3_.c transform_r_gfortran_double.c
F90SRCS = lsmrDataModule.f90 \
lsmrModule.f90 delsph.f90 gaussian.f90
OBJS = $(F90SRCS:%.f90=%.o) CalSurfG2.o $(SRCS:%.f=%.o) $(CSRCS:%.c=%.o)
INCLDIR = ./include
CFLAGS = -O3 -I$(INCLDIR) -m64
FFLAGS = -O3 -I$(INCLDIR) -ffixed-line-length-none -ffloat-store -W -m64 -fbounds-check
LDFLAGS = -O3 -m64
all: $(CMD)
$(CMD): $(OBJS)
$(FC) -fopenmp $(LDFLAGS) $(OBJS) $(LIBS) -o $#
%.o: %.f90
$(FC) $(FFLAGS) -c $(#F:.o=.f90) -o $#
CalSurfG2.o:CalSurfGnew2.f90
$(FC) -fopenmp $(FFLAGS) -c $< -o $#
%.o: %.f
$(FC) $(FFLAGS) -c $(#F:.o=.f) -o $#

Adding Makefile options into qtcreator project

I have a project made in qtcreator. The project in itself isn't very important for the question. I would like to add a project called PowerWatershed, the sources are available here:
PowerWatershed
Unfortunately, adding all the files to the .pro file give me an error when compiling, when making the "make" command with the Makefile of the PowerWatershed project works.
The makefile of the project is:
# Camille Couprie
# october 2009
OBJDIR = objects
PINKDIR = PINK
CSDIR = CSparse
ARGV = argv
PWSRC = src
VPATH = ${PINKDIR}:${CSDIR}:${ARGV}
CSINCLUDE = -I${CSDIR}/Include
PINKINCLUDE = -I${PINKDIR}
ARGVINCLUDE = -I${ARGV}
PWINCLUDE = -Iinclude
INCL = ${CSINCLUDE} ${PINKINCLUDE} ${ARGVINCLUDE} ${PWINCLUDE}
OBJ= objects/larith.o \
objects/ccsort.o \
objects/cccodimage.o \
objects/gageodesic.o \
objects/mccodimage.o \
objects/mcimage.o \
objects/mcindic.o \
objects/mclifo.o \
objects/random_walker.o \
objects/lMSF.o \
objects/MSF_RW.o \
objects/mcrbt.o \
objects/union_find.o \
objects/image_toolbox.o \
objects/cs_lu.o \
objects/cs_lusol.o \
objects/cs_malloc.o \
objects/cs_util.o \
objects/cs_multiply.o \
objects/cs_compress.o \
objects/cs_lsolve.o \
objects/cs_scatter.o \
objects/cs_cumsum.o \
objects/cs_sqr.o \
objects/cs_ipvec.o \
objects/cs_amd.o \
objects/cs_permute.o \
objects/cs_transpose.o \
objects/cs_counts.o \
objects/cs_add.o \
objects/cs_etree.o \
objects/cs_leaf.o \
objects/cs_fkeep.o \
objects/cs_tdfs.o \
objects/cs_usolve.o \
objects/cs_spsolve.o \
objects/cs_post.o \
objects/cs_reach.o \
objects/cs_dfs.o \
objects/argv.o
# objects/cs_print.o \
# objects/cs_norm.o \
#
FLAGS = -g -Wall # -pg
CXX = g++
CC = gcc
OPTIMISE=-O4
WARNINGS=-Wall #-Werror
DEBUG=-g
CXXFLAGS= ${DEBUG} ${WARNINGS} ${OPTIMISE} -Wno-deprecated ${FLAGS}
CFLAGS = ${DEBUG} ${WARNINGS} ${OPTIMISE} ${FLAGS}
all: ${CS} ${OBJ}
${MAKE} powerwatsegm.exe
# make with the Intel compiler, a very good complement to gcc/g++
# much more efficient and with better diagnoses
intel:
${MAKE} CC=icc CXX=icpc all
debug:
${MAKE} OPTIMISE='' all
# remove the asserts and the debug information
production:
${MAKE} DEBUG='' FLAGS="-DNDEBUG" all
clean:
rm -f *.exe; rm -f *~; rm -f $(OBJ); #rm -f overlay*; rm -f mask*;
powerwatsegm.exe: ${PWSRC}/powerwatsegm.c $(OBJ)
$(CXX) $(CXXFLAGS) $(INCL) ${PWSRC}/powerwatsegm.c $(OBJ) -o powerwatsegm.exe
$(OBJDIR)/%.o: ${PWSRC}/%.c
$(CXX) $(CXXFLAGS) ${INCL} -c $< -o $#
$(OBJDIR)/%.o: ${CSDIR}/Source/%.c ${CSDIR}/Include/cs.h
$(CC) $(CFLAGS) ${CSINCLUDE} -c $< -o $#
$(OBJDIR)/%.o: ${PINKDIR}/%.c
$(CXX) $(CXXFLAGS) ${PINKINCLUDE} -c $< -o $#
$(OBJDIR)/argv.o: ${ARGV}/argv.c ${ARGV}/argv.h ${ARGV}/argv_loc.h
$(CC) $(CCFLAGS) ${ARGVINCLUDE} -c $< -o $#
$(OBJDIR)/lMSF.o: ${PWSRC}/lMSF.c ${PINKDIR}/mcimage.h ${PINKDIR}/mccodimage.h
$(CXX) $(CFLAGS) ${PINKINCLUDE} ${PWINCLUDE} -c ${PWSRC}/lMSF.c -o $#
I would like to add th propoer option to my .pro file to make the compilation work. At the moment, my pro file looks like
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = Power
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp \
PW_1.0.1/argv/argv.c \
PW_1.0.1/CSparse/Source/cs_add.c \
PW_1.0.1/CSparse/Source/cs_amd.c \
PW_1.0.1/CSparse/Source/cs_chol.c \
PW_1.0.1/CSparse/Source/cs_cholsol.c \
PW_1.0.1/CSparse/Source/cs_compress.c \
PW_1.0.1/CSparse/Source/cs_counts.c \
PW_1.0.1/CSparse/Source/cs_cumsum.c \
PW_1.0.1/CSparse/Source/cs_dfs.c \
PW_1.0.1/CSparse/Source/cs_etree.c \
PW_1.0.1/CSparse/Source/cs_fkeep.c \
PW_1.0.1/CSparse/Source/cs_ipvec.c \
PW_1.0.1/CSparse/Source/cs_leaf.c \
PW_1.0.1/CSparse/Source/cs_lsolve.c \
PW_1.0.1/CSparse/Source/cs_lu.c \
PW_1.0.1/CSparse/Source/cs_lusol.c \
PW_1.0.1/CSparse/Source/cs_malloc.c \
PW_1.0.1/CSparse/Source/cs_multiply.c \
PW_1.0.1/CSparse/Source/cs_norm.c \
PW_1.0.1/CSparse/Source/cs_permute.c \
PW_1.0.1/CSparse/Source/cs_post.c \
PW_1.0.1/CSparse/Source/cs_print.c \
PW_1.0.1/CSparse/Source/cs_reach.c \
PW_1.0.1/CSparse/Source/cs_scatter.c \
PW_1.0.1/CSparse/Source/cs_spsolve.c \
PW_1.0.1/CSparse/Source/cs_sqr.c \
PW_1.0.1/CSparse/Source/cs_tdfs.c \
PW_1.0.1/CSparse/Source/cs_transpose.c \
PW_1.0.1/CSparse/Source/cs_usolve.c \
PW_1.0.1/CSparse/Source/cs_util.c \
PW_1.0.1/PINK/gageodesic.c \
PW_1.0.1/PINK/larith.c \
PW_1.0.1/PINK/lMSF.c \
PW_1.0.1/PINK/mccodimage.c \
PW_1.0.1/PINK/mcimage.c \
PW_1.0.1/PINK/mcindic.c \
PW_1.0.1/PINK/mclifo.c \
PW_1.0.1/PINK/mcrbt.c \
PW_1.0.1/src/cccodimage.c \
PW_1.0.1/src/ccsort.c \
PW_1.0.1/src/gageodesic.c \
PW_1.0.1/src/image_toolbox.c \
PW_1.0.1/src/lMSF.c \
PW_1.0.1/src/MSF_RW.c \
PW_1.0.1/src/powerwatsegm.c \
PW_1.0.1/src/random_walker.c \
PW_1.0.1/src/union_find.c
HEADERS += mainwindow.h \
PW_1.0.1/argv/argv.h \
PW_1.0.1/argv/argv_loc.h \
PW_1.0.1/argv/compat.h \
PW_1.0.1/argv/conf.h \
PW_1.0.1/CSparse/Include/cs.h \
PW_1.0.1/include/cccodimage.h \
PW_1.0.1/include/ccsort.h \
PW_1.0.1/include/gageodesic.h \
PW_1.0.1/include/image_toolbox.h \
PW_1.0.1/include/lMSF.h \
PW_1.0.1/include/MSF_RW.h \
PW_1.0.1/include/powerwatsegm.h \
PW_1.0.1/include/random_walker.h \
PW_1.0.1/include/union_find.h \
PW_1.0.1/PINK/larith.h \
PW_1.0.1/PINK/mccodimage.h \
PW_1.0.1/PINK/mcimage.h \
PW_1.0.1/PINK/mcindic.h \
PW_1.0.1/PINK/mclifo.h \
PW_1.0.1/PINK/mcrbt.h \
PW_1.0.1/PINK/mcutil.h
FORMS += mainwindow.ui
And I have the error:
/home/iznogood/Documents/Power/PW_1.0.1/src/gageodesic.c:44: erreur : mccodimage.h: No such file or directory
#include <mccodimage.h>
^
I think this is a matter of path, which are mentionned in the Makefile with:
OBJDIR = objects
PINKDIR = PINK
CSDIR = CSparse
ARGV = argv
PWSRC = src
VPATH = ${PINKDIR}:${CSDIR}:${ARGV}
But I can't manage to add them to the .pro file.
The relevant qmake variable is INCLUDEPATH.
So, for the following from the original makefile:
CSINCLUDE = -I${CSDIR}/Include
PINKINCLUDE = -I${PINKDIR}
ARGVINCLUDE = -I${ARGV}
PWINCLUDE = -Iinclude
INCL = ${CSINCLUDE} ${PINKINCLUDE} ${ARGVINCLUDE} ${PWINCLUDE}
would be something like this:
INCLUDEPATH += ${CSDIR}/Include \
${PINKDIR} \
${ARGV} \
include
This is documented in the QMake manual in the reference pages.

When trying to build a project in Qt Creator, I get the error:'ui_texo.h' file not found #include "ui_texo.h"

My project file qt.pro is located in the same folder as a .ui file called texo.ui. From what I have read, it seems like a file ui_texo.h should be automatically generated when I try to build the project but I'm not positive. I am a Qt beginner and am quite lost. I had a similar problem initially with a file qgraphicsview.h, which I fixed by using finder to locate the file and then pasting it into the same file that qt.pro is in. Unfortunately, I can't locate a ui_texo.h file anywhere on my computer. Thanks in advance for any help, and let me know if you have any questions or if I haven't been clear!
The contents of qt.pro are:
QT += core gui
TARGET = qt
TEMPLATE = app
HEADERS += \
TexoView.h \
TexoDemo.h \
stdafx.h \
TexoViewImg.h \
SOURCES += \
TexoView.cpp \
TexoDemo.cpp \
StdAfx.cpp \
main.cpp \
TexoViewImg.cpp
FORMS += \
texo.ui
RESOURCES += \
texo.qrc \
texo.qrc
OTHER_FILES += \
res/u.ico \
res/stop.png \
res/run.png \
res/init.png
INCLUDEPATH += ../../inc/
LIBS += -L"../../lib/" -ltexo
LIBS += -L"../../../bin/" -ltexo
`
and the contents of makefile are:
Makefile: qt.pro ../../../Qt/5.3/clang_64/mkspecs/macx-clang/qmake.conf ../../../Qt/5.3/clang_64/mkspecs/features/spec_pre.prf \
../../../Qt/5.3/clang_64/mkspecs/qdevice.pri \
../../../Qt/5.3/clang_64/mkspecs/features/device_config.prf \
../../../Qt/5.3/clang_64/mkspecs/common/shell-unix.conf \
../../../Qt/5.3/clang_64/mkspecs/common/unix.conf \
../../../Qt/5.3/clang_64/mkspecs/common/mac.conf \
../../../Qt/5.3/clang_64/mkspecs/common/macx.conf \
../../../Qt/5.3/clang_64/mkspecs/common/gcc-base.conf \
../../../Qt/5.3/clang_64/mkspecs/common/gcc-base-mac.conf \
../../../Qt/5.3/clang_64/mkspecs/common/clang.conf \
../../../Qt/5.3/clang_64/mkspecs/common/clang-mac.conf \
../../../Qt/5.3/clang_64/mkspecs/qconfig.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_bluetooth.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_bluetooth_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_bootstrap_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_clucene_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_concurrent.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_concurrent_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_core.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_core_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_dbus.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_dbus_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_declarative.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_declarative_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_designer.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_designer_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_designercomponents_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_enginio.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_enginio_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_gui.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_gui_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_help.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_help_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_macextras.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_macextras_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_multimedia.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_multimedia_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_multimediawidgets.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_multimediawidgets_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_network.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_network_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_nfc.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_nfc_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_opengl.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_opengl_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_openglextensions.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_openglextensions_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_platformsupport_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_positioning.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_positioning_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_printsupport.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_printsupport_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_qml.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_qml_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_qmldevtools_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_qmltest.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_qmltest_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_qtmultimediaquicktools_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_quick.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_quick_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_quickparticles_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_quickwidgets.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_quickwidgets_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_script.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_script_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_scripttools.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_scripttools_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_sensors.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_sensors_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_serialport.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_serialport_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_sql.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_sql_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_svg.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_svg_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_testlib.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_testlib_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_uitools.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_uitools_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_webkit.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_webkit_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_webkitwidgets.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_webkitwidgets_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_websockets.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_websockets_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_widgets.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_widgets_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_xml.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_xml_private.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_xmlpatterns.pri \
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_xmlpatterns_private.pri \
../../../Qt/5.3/clang_64/mkspecs/features/qt_functions.prf \
../../../Qt/5.3/clang_64/mkspecs/features/qt_config.prf \
../../../Qt/5.3/clang_64/mkspecs/macx-clang/qmake.conf \
../../../Qt/5.3/clang_64/mkspecs/features/spec_post.prf \
../../../../.qmake.stash \
../../../Qt/5.3/clang_64/mkspecs/features/exclusive_builds.prf \
../../../Qt/5.3/clang_64/mkspecs/features/default_pre.prf \
../../../Qt/5.3/clang_64/mkspecs/features/mac/default_pre.prf \
../../../Qt/5.3/clang_64/mkspecs/features/resolve_config.prf \
../../../Qt/5.3/clang_64/mkspecs/features/default_post.prf \
../../../Qt/5.3/clang_64/mkspecs/features/mac/sdk.prf \
../../../Qt/5.3/clang_64/mkspecs/features/mac/default_post.prf \
../../../Qt/5.3/clang_64/mkspecs/features/mac/objective_c.prf \
../../../Qt/5.3/clang_64/mkspecs/features/warn_on.prf \
../../../Qt/5.3/clang_64/mkspecs/features/qt.prf \
../../../Qt/5.3/clang_64/mkspecs/features/resources.prf \
../../../Qt/5.3/clang_64/mkspecs/features/moc.prf \
../../../Qt/5.3/clang_64/mkspecs/features/unix/opengl.prf \
../../../Qt/5.3/clang_64/mkspecs/features/unix/thread.prf \
../../../Qt/5.3/clang_64/mkspecs/features/mac/rez.prf \
../../../Qt/5.3/clang_64/mkspecs/features/testcase_targets.prf \
../../../Qt/5.3/clang_64/mkspecs/features/exceptions.prf \
../../../Qt/5.3/clang_64/mkspecs/features/yacc.prf \
../../../Qt/5.3/clang_64/mkspecs/features/lex.prf \
qt.pro \
texo.qrc \
/Users/Mike/Desktop/Work/Qt/5.3/clang_64/lib/QtGui.framework/QtGui.prl \
/Users/Mike/Desktop/Work/Qt/5.3/clang_64/lib/QtCore.framework/QtCore.prl
$(QMAKE) -spec macx-clang CONFIG+=debug CONFIG+=x86_64 -o Makefile qt.pro
../../../Qt/5.3/clang_64/mkspecs/features/spec_pre.prf:
../../../Qt/5.3/clang_64/mkspecs/qdevice.pri:
../../../Qt/5.3/clang_64/mkspecs/features/device_config.prf:
../../../Qt/5.3/clang_64/mkspecs/common/shell-unix.conf:
../../../Qt/5.3/clang_64/mkspecs/common/unix.conf:
../../../Qt/5.3/clang_64/mkspecs/common/mac.conf:
../../../Qt/5.3/clang_64/mkspecs/common/macx.conf:
../../../Qt/5.3/clang_64/mkspecs/common/gcc-base.conf:
../../../Qt/5.3/clang_64/mkspecs/common/gcc-base-mac.conf:
../../../Qt/5.3/clang_64/mkspecs/common/clang.conf:
../../../Qt/5.3/clang_64/mkspecs/common/clang-mac.conf:
../../../Qt/5.3/clang_64/mkspecs/qconfig.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_bluetooth.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_bluetooth_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_bootstrap_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_clucene_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_concurrent.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_concurrent_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_core.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_core_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_dbus.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_dbus_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_declarative.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_declarative_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_designer.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_designer_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_designercomponents_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_enginio.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_enginio_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_gui.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_gui_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_help.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_help_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_macextras.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_macextras_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_multimedia.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_multimedia_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_multimediawidgets.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_multimediawidgets_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_network.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_network_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_nfc.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_nfc_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_opengl.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_opengl_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_openglextensions.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_openglextensions_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_platformsupport_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_positioning.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_positioning_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_printsupport.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_printsupport_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_qml.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_qml_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_qmldevtools_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_qmltest.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_qmltest_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_qtmultimediaquicktools_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_quick.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_quick_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_quickparticles_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_quickwidgets.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_quickwidgets_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_script.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_script_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_scripttools.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_scripttools_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_sensors.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_sensors_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_serialport.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_serialport_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_sql.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_sql_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_svg.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_svg_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_testlib.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_testlib_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_uitools.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_uitools_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_webkit.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_webkit_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_webkitwidgets.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_webkitwidgets_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_websockets.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_websockets_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_widgets.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_widgets_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_xml.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_xml_private.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_xmlpatterns.pri:
../../../Qt/5.3/clang_64/mkspecs/modules/qt_lib_xmlpatterns_private.pri:
../../../Qt/5.3/clang_64/mkspecs/features/qt_functions.prf:
../../../Qt/5.3/clang_64/mkspecs/features/qt_config.prf:
../../../Qt/5.3/clang_64/mkspecs/macx-clang/qmake.conf:
../../../Qt/5.3/clang_64/mkspecs/features/spec_post.prf:
../../../../.qmake.stash:
../../../Qt/5.3/clang_64/mkspecs/features/exclusive_builds.prf:
../../../Qt/5.3/clang_64/mkspecs/features/default_pre.prf:
../../../Qt/5.3/clang_64/mkspecs/features/mac/default_pre.prf:
../../../Qt/5.3/clang_64/mkspecs/features/resolve_config.prf:
../../../Qt/5.3/clang_64/mkspecs/features/default_post.prf:
../../../Qt/5.3/clang_64/mkspecs/features/mac/sdk.prf:
../../../Qt/5.3/clang_64/mkspecs/features/mac/default_post.prf:
../../../Qt/5.3/clang_64/mkspecs/features/mac/objective_c.prf:
../../../Qt/5.3/clang_64/mkspecs/features/warn_on.prf:
../../../Qt/5.3/clang_64/mkspecs/features/qt.prf:
../../../Qt/5.3/clang_64/mkspecs/features/resources.prf:
../../../Qt/5.3/clang_64/mkspecs/features/moc.prf:
../../../Qt/5.3/clang_64/mkspecs/features/unix/opengl.prf:
../../../Qt/5.3/clang_64/mkspecs/features/unix/thread.prf:
../../../Qt/5.3/clang_64/mkspecs/features/mac/rez.prf:
../../../Qt/5.3/clang_64/mkspecs/features/testcase_targets.prf:
../../../Qt/5.3/clang_64/mkspecs/features/exceptions.prf:
../../../Qt/5.3/clang_64/mkspecs/features/yacc.prf:
../../../Qt/5.3/clang_64/mkspecs/features/lex.prf:
qt.pro:
texo.qrc:
/Users/Mike/Desktop/Work/Qt/5.3/clang_64/lib/QtGui.framework/QtGui.prl:
/Users/Mike/Desktop/Work/Qt/5.3/clang_64/lib/QtCore.framework/QtCore.prl:
qmake: FORCE
#$(QMAKE) -spec macx-clang CONFIG+=debug CONFIG+=x86_64 -o Makefile qt.pro
qmake_all: FORCE
qt.app/Contents/PkgInfo:
#test -d qt.app/Contents || mkdir -p qt.app/Contents
#$(DEL_FILE) qt.app/Contents/PkgInfo
#echo "APPL????" >qt.app/Contents/PkgInfo
qt.app/Contents/Resources/empty.lproj:
#test -d qt.app/Contents/Resources || mkdir -p qt.app/Contents/Resources
#touch qt.app/Contents/Resources/empty.lproj
qt.app/Contents/Info.plist:
#test -d qt.app/Contents || mkdir -p qt.app/Contents
#$(DEL_FILE) qt.app/Contents/Info.plist
#sed -e "s,#SHORT_VERSION#,1.0,g" -e "s,#TYPEINFO#,????,g" -e "s,#ICON#,,g" -e "s,#BUNDLEIDENTIFIER#,sdf.qt,g" -e "s,#EXECUTABLE#,qt,g" -e "s,#TYPEINFO#,????,g" ../../../Qt/5.3/clang_64/mkspecs/macx-clang/Info.plist.app >qt.app/Contents/Info.plist
dist:
#test -d .tmp/qt1.0.0 || mkdir -p .tmp/qt1.0.0
$(COPY_FILE) --parents $(DIST) .tmp/qt1.0.0/ && $(COPY_FILE) --parents texo.qrc texo.qrc .tmp/qt1.0.0/ && $(COPY_FILE) --parents TexoView.h TexoDemo.h stdafx.h TexoViewImg.h .tmp/qt1.0.0/ && $(COPY_FILE) --parents TexoView.cpp TexoDemo.cpp StdAfx.cpp main.cpp TexoViewImg.cpp .tmp/qt1.0.0/ && (cd `dirname .tmp/qt1.0.0` && $(TAR) qt1.0.0.tar qt1.0.0 && $(COMPRESS) qt1.0.0.tar) && $(MOVE) `dirname .tmp/qt1.0.0`/qt1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/qt1.0.0
clean:compiler_clean
-$(DEL_FILE) $(OBJECTS)
-$(DEL_FILE) *~ core *.core
distclean: clean
-$(DEL_FILE) -r qt.app
-$(DEL_FILE) Makefile
####### Sub-libraries
mocclean: compiler_moc_header_clean compiler_moc_source_clean
mocables: compiler_moc_header_make_all compiler_moc_source_make_all
check: first
compiler_objective_c_make_all:
compiler_objective_c_clean:
compiler_rcc_make_all: qrc_texo.cpp qrc_texo.cpp
compiler_rcc_clean:
-$(DEL_FILE) qrc_texo.cpp qrc_texo.cpp
qrc_texo.cpp: texo.qrc \
res/stop.png \
res/u.ico \
res/run.png \
res/init.png
/Users/Mike/Desktop/Work/Qt/5.3/clang_64/bin/rcc -name texo texo.qrc -o qrc_texo.cpp
qrc_texo.cpp: texo.qrc \
res/stop.png \
res/u.ico \
res/run.png \
res/init.png
/Users/Mike/Desktop/Work/Qt/5.3/clang_64/bin/rcc -name texo texo.qrc -o qrc_texo.cpp
compiler_moc_header_make_all: moc_TexoDemo.cpp
compiler_moc_header_clean:
-$(DEL_FILE) moc_TexoDemo.cpp
moc_TexoDemo.cpp: TexoDemo.h
/Users/Mike/Desktop/Work/Qt/5.3/clang_64/bin/moc $(DEFINES) -D__APPLE__ -D__GNUC__=4 -I/Users/Mike/Desktop/Work/Qt/5.3/clang_64/mkspecs/macx-clang -I/Users/Mike/Desktop/Work/texo/demo/qt -I/Users/Mike/Desktop/Work/texo/inc -I/Users/Mike/Desktop/Work/Qt/5.3/clang_64/lib/QtGui.framework/Headers -I/Users/Mike/Desktop/Work/Qt/5.3/clang_64/lib/QtCore.framework/Headers -F/Users/Mike/Desktop/Work/Qt/5.3/clang_64/lib TexoDemo.h -o moc_TexoDemo.cpp
compiler_moc_source_make_all:
compiler_moc_source_clean:
compiler_rez_source_make_all:
compiler_rez_source_clean:
compiler_yacc_decl_make_all:
compiler_yacc_decl_clean:
compiler_yacc_impl_make_all:
compiler_yacc_impl_clean:
compiler_lex_make_all:
compiler_lex_clean:
compiler_clean: compiler_rcc_clean compiler_moc_header_clean
####### Compile
TexoView.o: TexoView.cpp stdafx.h \
../../inc/texo_def.h \
../../inc/texo.h \
TexoView.h \
qgraphicsview.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o TexoView.o TexoView.cpp
TexoDemo.o: TexoDemo.cpp stdafx.h \
../../inc/texo_def.h \
../../inc/texo.h \
TexoDemo.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o TexoDemo.o TexoDemo.cpp
StdAfx.o: StdAfx.cpp stdafx.h \
../../inc/texo_def.h \
../../inc/texo.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o StdAfx.o StdAfx.cpp
main.o: main.cpp stdafx.h \
../../inc/texo_def.h \
../../inc/texo.h \
TexoDemo.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp
TexoViewImg.o: TexoViewImg.cpp stdafx.h \
../../inc/texo_def.h \
../../inc/texo.h \
TexoViewImg.h \
qgraphicsview.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o TexoViewImg.o TexoViewImg.cpp
qrc_texo.o: qrc_texo.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o qrc_texo.o qrc_texo.cpp
moc_TexoDemo.o: moc_TexoDemo.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_TexoDemo.o moc_TexoDemo.cpp
####### Install
install: FORCE
uninstall: FORCE
FORCE:
Make sure that the .ui file is referenced in the project file. Add this line to qt.pro if it's not there already:
FORMS = texo.ui
You Makefile doesn't contain any ui specific rules, indicating that it was not created from your .pro file, or at least not from this version of your .pro file. (Re-)running qmake might indeed help. You should be able to run qmake from Creator's "Build" menu.

compile QT and OpenCV together in Ubuntu using qmake

Im writing a OpenCV application and a QT GUI together and im having some issues compiling.
Some background information that might be useful; the OS is Ubuntu 13.10, the output of " qmake --version" is :QMake version 3.0 Using Qt version 5.0.2 in /usr/lib/x86_64-linux-gnu
The issues starts upon the appearance of one line of code, that being "Mat cvImage" where I declare a Mat object. The way im compiling is first "qmake -project" then "qmake" then i go into my .pro file and add "QT += widgets" and then I type "make", when i do this, i get the error
/usr/lib/x86_64-linux-gnu/qt5/bin/qmake -o Makefile gui2.pro
g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/share/qt5/mkspecs/linux-g++-64 -I. -I. -I/usr/include/qt5 - I/usr/include/qt5/QtWidgets -I/usr/include/qt5/QtGui -I/usr/include/qt5/QtCore -I. -o main.o main.cpp
main.cpp: In function ‘int main(int, char**)’:
main.cpp:55:2: error: ‘Mat’ was not declared in this scope
Mat cvImage;
^
main.cpp:55:2: note: suggested alternative:
In file included from main.cpp:20:0:
/usr/local/include/opencv2/core/core.hpp:1683:18: note: ‘cv::Mat’
class CV_EXPORTS Mat
^
main.cpp:55:6: error: expected ‘;’ before ‘cvImage’
Mat cvImage;
^
make: *** [main.o] Error 1
To be honest, i have no idea what "In file included from main.cpp:20:0: /usr/local/include/opencv2/core/core.hpp:1683:10 note: 'cv :: Mat' " means. I included all the appropriate OpenCV libraries and I dont know how to interpret that line of error output. Below is my code
/*****************C++ Libraries******************/
#include <iostream>
/****************User Defined*******************/
#include "function.h"
#include "function.cpp"
/****************Libraries Needed for QT********/
#include <QObject>
#include <QApplication>
#include <QWidget>
#include <QGridLayout>
#include <QSpinBox>
#include <QLabel>
#include <QGraphicsScene>
#include<QGraphicsView>
#include <QGraphicsPixmapItem>
/************Libraries Needed For OpenCV*******/
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace std;
int main(int argc, char ** argv){
QApplication a(argc, argv);
/** some code that runs a gui ***/
Mat cvImage; // This is where the problem starts
window.show();
return a.exec();
}
I also looked into my Makefile and i dont see any paths or anything to OpenCV libraries so I tried adding them, it caused more problems.
This is the auto-generated Makefile(via the qmake command)
#############################################################################
# Makefile for building: gui2
# Generated by qmake (3.0) (Qt 5.0.2) on: Mon Jan 27 12:24:52 2014
# Project: gui2.pro
# Template: app
# Command: /usr/lib/x86_64-linux-gnu/qt5/bin/qmake -o Makefile gui2.pro
#############################################################################
MAKEFILE = Makefile
####### Compiler, tools and options
CC = gcc
CXX = g++
DEFINES = -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB
CFLAGS = -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIE $(DEFINES)
CXXFLAGS = -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIE $(DEFINES)
INCPATH = -I/usr/share/qt5/mkspecs/linux-g++-64 -I. -I. -I/usr/include/qt5 -I/usr/include/qt5/QtWidgets -I/usr/include/qt5/QtGui -I/usr/include/qt5/QtCore -I.
LINK = g++
LFLAGS = -m64 -Wl,-O1
LIBS = $(SUBLIBS) -L/usr/X11R6/lib64 -lQt5Widgets -L/usr/lib/x86_64-linux-gnu -lQt5Gui -lQt5Core -lGL -lpthread
AR = ar cqs
RANLIB =
QMAKE = /usr/lib/x86_64-linux-gnu/qt5/bin/qmake
TAR = tar -cf
COMPRESS = gzip -9f
COPY = cp -f
SED = sed
COPY_FILE = cp -f
COPY_DIR = cp -f -R
STRIP = strip
INSTALL_FILE = install -m 644 -p
INSTALL_DIR = $(COPY_DIR)
INSTALL_PROGRAM = install -m 755 -p
DEL_FILE = rm -f
SYMLINK = ln -f -s
DEL_DIR = rmdir
MOVE = mv -f
CHK_DIR_EXISTS= test -d
MKDIR = mkdir -p
####### Output directory
OBJECTS_DIR = ./
####### Files
SOURCES = main.cpp moc_function.cpp
OBJECTS = main.o \
moc_function.o
DIST = /usr/share/qt5/mkspecs/features/spec_pre.prf \
/usr/share/qt5/mkspecs/common/shell-unix.conf \
/usr/share/qt5/mkspecs/common/unix.conf \
/usr/share/qt5/mkspecs/common/linux.conf \
/usr/share/qt5/mkspecs/common/gcc-base.conf \
/usr/share/qt5/mkspecs/common/gcc-base-unix.conf \
/usr/share/qt5/mkspecs/common/g++-base.conf \
/usr/share/qt5/mkspecs/common/g++-unix.conf \
/usr/share/qt5/mkspecs/qconfig.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_3d.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_3dquick.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_bootstrap.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_clucene.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_concurrent.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_core.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_dbus.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_designer.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_designercomponents.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_gui.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_help.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_location.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_multimedia.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_multimediawidgets.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_network.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_opengl.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_platformsupport.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_printsupport.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_qml.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_qmldevtools.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_qmltest.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_qtmultimediaquicktools.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_quick.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_quickparticles.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_script.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_scripttools.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_sensors.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_sql.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_svg.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_testlib.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_uitools.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_v8.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_webkit.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_webkitwidgets.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_widgets.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_xml.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_xmlpatterns.pri \
/usr/share/qt5/mkspecs/features/qt_functions.prf \
/usr/share/qt5/mkspecs/features/qt_config.prf \
/usr/share/qt5/mkspecs/linux-g++-64/qmake.conf \
/usr/share/qt5/mkspecs/features/spec_post.prf \
/usr/share/qt5/mkspecs/features/exclusive_builds.prf \
/usr/share/qt5/mkspecs/features/default_pre.prf \
/usr/share/qt5/mkspecs/features/unix/default_pre.prf \
/usr/share/qt5/mkspecs/features/resolve_config.prf \
/usr/share/qt5/mkspecs/features/default_post.prf \
/usr/share/qt5/mkspecs/features/unix/gdb_dwarf_index.prf \
/usr/share/qt5/mkspecs/features/warn_on.prf \
/usr/share/qt5/mkspecs/features/qt.prf \
/usr/share/qt5/mkspecs/features/resources.prf \
/usr/share/qt5/mkspecs/features/moc.prf \
/usr/share/qt5/mkspecs/features/unix/opengl.prf \
/usr/share/qt5/mkspecs/features/uic.prf \
/usr/share/qt5/mkspecs/features/unix/thread.prf \
/usr/share/qt5/mkspecs/features/wayland-scanner.prf \
/usr/share/qt5/mkspecs/features/testcase_targets.prf \
/usr/share/qt5/mkspecs/features/exceptions.prf \
/usr/share/qt5/mkspecs/features/yacc.prf \
/usr/share/qt5/mkspecs/features/lex.prf \
gui2.pro \
gui2.pro
QMAKE_TARGET = gui2
DESTDIR =
TARGET = gui2
first: all
####### Implicit rules
.SUFFIXES: .o .c .cpp .cc .cxx .C
.cpp.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$#" "$<"
.cc.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$#" "$<"
.cxx.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$#" "$<"
.C.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$#" "$<"
.c.o:
$(CC) -c $(CFLAGS) $(INCPATH) -o "$#" "$<"
####### Build rules
all: Makefile $(TARGET)
$(TARGET): $(OBJECTS)
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
Makefile: gui2.pro /usr/share/qt5/mkspecs/linux-g++-64/qmake.conf /usr/share/qt5/mkspecs/features/spec_pre.prf \
/usr/share/qt5/mkspecs/common/shell-unix.conf \
/usr/share/qt5/mkspecs/common/unix.conf \
/usr/share/qt5/mkspecs/common/linux.conf \
/usr/share/qt5/mkspecs/common/gcc-base.conf \
/usr/share/qt5/mkspecs/common/gcc-base-unix.conf \
/usr/share/qt5/mkspecs/common/g++-base.conf \
/usr/share/qt5/mkspecs/common/g++-unix.conf \
/usr/share/qt5/mkspecs/qconfig.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_3d.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_3dquick.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_bootstrap.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_clucene.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_concurrent.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_core.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_dbus.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_designer.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_designercomponents.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_gui.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_help.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_location.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_multimedia.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_multimediawidgets.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_network.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_opengl.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_platformsupport.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_printsupport.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_qml.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_qmldevtools.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_qmltest.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_qtmultimediaquicktools.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_quick.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_quickparticles.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_script.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_scripttools.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_sensors.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_sql.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_svg.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_testlib.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_uitools.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_v8.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_webkit.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_webkitwidgets.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_widgets.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_xml.pri \
/usr/share/qt5/mkspecs/modules/qt_lib_xmlpatterns.pri \
/usr/share/qt5/mkspecs/features/qt_functions.prf \
/usr/share/qt5/mkspecs/features/qt_config.prf \
/usr/share/qt5/mkspecs/linux-g++-64/qmake.conf \
/usr/share/qt5/mkspecs/features/spec_post.prf \
/usr/share/qt5/mkspecs/features/exclusive_builds.prf \
/usr/share/qt5/mkspecs/features/default_pre.prf \
/usr/share/qt5/mkspecs/features/unix/default_pre.prf \
/usr/share/qt5/mkspecs/features/resolve_config.prf \
/usr/share/qt5/mkspecs/features/default_post.prf \
/usr/share/qt5/mkspecs/features/unix/gdb_dwarf_index.prf \
/usr/share/qt5/mkspecs/features/warn_on.prf \
/usr/share/qt5/mkspecs/features/qt.prf \
/usr/share/qt5/mkspecs/features/resources.prf \
/usr/share/qt5/mkspecs/features/moc.prf \
/usr/share/qt5/mkspecs/features/unix/opengl.prf \
/usr/share/qt5/mkspecs/features/uic.prf \
/usr/share/qt5/mkspecs/features/unix/thread.prf \
/usr/share/qt5/mkspecs/features/wayland-scanner.prf \
/usr/share/qt5/mkspecs/features/testcase_targets.prf \
/usr/share/qt5/mkspecs/features/exceptions.prf \
/usr/share/qt5/mkspecs/features/yacc.prf \
/usr/share/qt5/mkspecs/features/lex.prf \
gui2.pro \
/usr/lib/x86_64-linux-gnu/libQt5Widgets.prl \
/usr/lib/x86_64-linux-gnu/libQt5Gui.prl \
/usr/lib/x86_64-linux-gnu/libQt5Core.prl
$(QMAKE) -o Makefile gui2.pro
/usr/share/qt5/mkspecs/features/spec_pre.prf:
/usr/share/qt5/mkspecs/common/shell-unix.conf:
/usr/share/qt5/mkspecs/common/unix.conf:
/usr/share/qt5/mkspecs/common/linux.conf:
/usr/share/qt5/mkspecs/common/gcc-base.conf:
/usr/share/qt5/mkspecs/common/gcc-base-unix.conf:
/usr/share/qt5/mkspecs/common/g++-base.conf:
/usr/share/qt5/mkspecs/common/g++-unix.conf:
/usr/share/qt5/mkspecs/qconfig.pri:
/usr/share/qt5/mkspecs/modules/qt_lib_3d.pri:
/usr/share/qt5/mkspecs/modules/qt_lib_3dquick.pri:
/usr/share/qt5/mkspecs/modules/qt_lib_bootstrap.pri:
/usr/share/qt5/mkspecs/modules/qt_lib_clucene.pri:
/usr/share/qt5/mkspecs/modules/qt_lib_concurrent.pri:
/usr/share/qt5/mkspecs/modules/qt_lib_core.pri:
/usr/share/qt5/mkspecs/modules/qt_lib_dbus.pri:
/usr/share/qt5/mkspecs/modules/qt_lib_designer.pri:
/usr/share/qt5/mkspecs/modules/qt_lib_designercomponents.pri:
/usr/share/qt5/mkspecs/modules/qt_lib_gui.pri:
/usr/share/qt5/mkspecs/modules/qt_lib_help.pri:
/usr/share/qt5/mkspecs/modules/qt_lib_location.pri:
/usr/share/qt5/mkspecs/modules/qt_lib_multimedia.pri:
/usr/share/qt5/mkspecs/modules/qt_lib_multimediawidgets.pri:
/usr/share/qt5/mkspecs/modules/qt_lib_network.pri:
/usr/share/qt5/mkspecs/modules/qt_lib_opengl.pri:
/usr/share/qt5/mkspecs/modules/qt_lib_platformsupport.pri:
/usr/share/qt5/mkspecs/modules/qt_lib_printsupport.pri:
/usr/share/qt5/mkspecs/modules/qt_lib_qml.pri:
/usr/share/qt5/mkspecs/modules/qt_lib_qmldevtools.pri:
/usr/share/qt5/mkspecs/modules/qt_lib_qmltest.pri:
/usr/share/qt5/mkspecs/modules/qt_lib_qtmultimediaquicktools.pri:
/usr/share/qt5/mkspecs/modules/qt_lib_quick.pri:
/usr/share/qt5/mkspecs/modules/qt_lib_quickparticles.pri:
/usr/share/qt5/mkspecs/modules/qt_lib_script.pri:
/usr/share/qt5/mkspecs/modules/qt_lib_scripttools.pri:
/usr/share/qt5/mkspecs/modules/qt_lib_sensors.pri:
/usr/share/qt5/mkspecs/modules/qt_lib_sql.pri:
/usr/share/qt5/mkspecs/modules/qt_lib_svg.pri:
/usr/share/qt5/mkspecs/modules/qt_lib_testlib.pri:
/usr/share/qt5/mkspecs/modules/qt_lib_uitools.pri:
/usr/share/qt5/mkspecs/modules/qt_lib_v8.pri:
/usr/share/qt5/mkspecs/modules/qt_lib_webkit.pri:
/usr/share/qt5/mkspecs/modules/qt_lib_webkitwidgets.pri:
/usr/share/qt5/mkspecs/modules/qt_lib_widgets.pri:
/usr/share/qt5/mkspecs/modules/qt_lib_xml.pri:
/usr/share/qt5/mkspecs/modules/qt_lib_xmlpatterns.pri:
/usr/share/qt5/mkspecs/features/qt_functions.prf:
/usr/share/qt5/mkspecs/features/qt_config.prf:
/usr/share/qt5/mkspecs/linux-g++-64/qmake.conf:
/usr/share/qt5/mkspecs/features/spec_post.prf:
/usr/share/qt5/mkspecs/features/exclusive_builds.prf:
/usr/share/qt5/mkspecs/features/default_pre.prf:
/usr/share/qt5/mkspecs/features/unix/default_pre.prf:
/usr/share/qt5/mkspecs/features/resolve_config.prf:
/usr/share/qt5/mkspecs/features/default_post.prf:
/usr/share/qt5/mkspecs/features/unix/gdb_dwarf_index.prf:
/usr/share/qt5/mkspecs/features/warn_on.prf:
/usr/share/qt5/mkspecs/features/qt.prf:
/usr/share/qt5/mkspecs/features/resources.prf:
/usr/share/qt5/mkspecs/features/moc.prf:
/usr/share/qt5/mkspecs/features/unix/opengl.prf:
/usr/share/qt5/mkspecs/features/uic.prf:
/usr/share/qt5/mkspecs/features/unix/thread.prf:
/usr/share/qt5/mkspecs/features/wayland-scanner.prf:
/usr/share/qt5/mkspecs/features/testcase_targets.prf:
/usr/share/qt5/mkspecs/features/exceptions.prf:
/usr/share/qt5/mkspecs/features/yacc.prf:
/usr/share/qt5/mkspecs/features/lex.prf:
gui2.pro:
/usr/lib/x86_64-linux-gnu/libQt5Widgets.prl:
/usr/lib/x86_64-linux-gnu/libQt5Gui.prl:
/usr/lib/x86_64-linux-gnu/libQt5Core.prl:
qmake: FORCE
#$(QMAKE) -o Makefile gui2.pro
qmake_all: FORCE
dist:
#test -d .tmp/gui21.0.0 || mkdir -p .tmp/gui21.0.0
$(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/gui21.0.0/ && $(COPY_FILE) --parents function.h hide/convertImage.h function.cpp .tmp/gui21.0.0/ && $(COPY_FILE) --parents main.cpp .tmp/gui21.0.0/ && (cd `dirname .tmp/gui21.0.0` && $(TAR) gui21.0.0.tar gui21.0.0 && $(COMPRESS) gui21.0.0.tar) && $(MOVE) `dirname .tmp/gui21.0.0`/gui21.0.0.tar.gz . && $(DEL_FILE) -r .tmp/gui21.0.0
clean:compiler_clean
-$(DEL_FILE) $(OBJECTS)
-$(DEL_FILE) *~ core *.core
####### Sub-libraries
distclean: clean
-$(DEL_FILE) $(TARGET)
-$(DEL_FILE) Makefile
mocclean: compiler_moc_header_clean compiler_moc_source_clean
mocables: compiler_moc_header_make_all compiler_moc_source_make_all
check: first
compiler_rcc_make_all:
compiler_rcc_clean:
compiler_wayland-server-header_make_all:
compiler_wayland-server-header_clean:
compiler_wayland-client-header_make_all:
compiler_wayland-client-header_clean:
compiler_moc_header_make_all: moc_function.cpp
compiler_moc_header_clean:
-$(DEL_FILE) moc_function.cpp
moc_function.cpp: /usr/include/qt5/QtCore/QObject \
/usr/include/qt5/QtCore/qobject.h \
/usr/include/qt5/QtCore/qobjectdefs.h \
/usr/include/qt5/QtCore/qnamespace.h \
/usr/include/qt5/QtCore/qglobal.h \
/usr/include/qt5/QtCore/qconfig.h \
/usr/include/qt5/QtCore/qfeatures.h \
/usr/include/qt5/QtCore/qsystemdetection.h \
/usr/include/qt5/QtCore/qcompilerdetection.h \
/usr/include/qt5/QtCore/qprocessordetection.h \
/usr/include/qt5/QtCore/qlogging.h \
/usr/include/qt5/QtCore/qflags.h \
/usr/include/qt5/QtCore/qtypeinfo.h \
/usr/include/qt5/QtCore/qtypetraits.h \
/usr/include/qt5/QtCore/qsysinfo.h \
/usr/include/qt5/QtCore/qobjectdefs_impl.h \
/usr/include/qt5/QtCore/qstring.h \
/usr/include/qt5/QtCore/qchar.h \
/usr/include/qt5/QtCore/qbytearray.h \
/usr/include/qt5/QtCore/qrefcount.h \
/usr/include/qt5/QtCore/qatomic.h \
/usr/include/qt5/QtCore/qbasicatomic.h \
/usr/include/qt5/QtCore/qatomic_bootstrap.h \
/usr/include/qt5/QtCore/qgenericatomic.h \
/usr/include/qt5/QtCore/qatomic_msvc.h \
/usr/include/qt5/QtCore/qatomic_integrity.h \
/usr/include/qt5/QtCore/qoldbasicatomic.h \
/usr/include/qt5/QtCore/qatomic_vxworks.h \
/usr/include/qt5/QtCore/qatomic_power.h \
/usr/include/qt5/QtCore/qatomic_aarch64.h \
/usr/include/qt5/QtCore/qatomic_alpha.h \
/usr/include/qt5/QtCore/qatomic_armv7.h \
/usr/include/qt5/QtCore/qatomic_armv6.h \
/usr/include/qt5/QtCore/qatomic_armv5.h \
/usr/include/qt5/QtCore/qatomic_bfin.h \
/usr/include/qt5/QtCore/qatomic_ia64.h \
/usr/include/qt5/QtCore/qatomic_mips.h \
/usr/include/qt5/QtCore/qatomic_s390.h \
/usr/include/qt5/QtCore/qatomic_sh4a.h \
/usr/include/qt5/QtCore/qatomic_sparc.h \
/usr/include/qt5/QtCore/qatomic_x86.h \
/usr/include/qt5/QtCore/qatomic_cxx11.h \
/usr/include/qt5/QtCore/qatomic_gcc.h \
/usr/include/qt5/QtCore/qatomic_unix.h \
/usr/include/qt5/QtCore/qarraydata.h \
/usr/include/qt5/QtCore/qstringbuilder.h \
/usr/include/qt5/QtCore/qlist.h \
/usr/include/qt5/QtCore/qalgorithms.h \
/usr/include/qt5/QtCore/qiterator.h \
/usr/include/qt5/QtCore/qcoreevent.h \
/usr/include/qt5/QtCore/qscopedpointer.h \
/usr/include/qt5/QtCore/qmetatype.h \
/usr/include/qt5/QtCore/qvarlengtharray.h \
/usr/include/qt5/QtCore/qcontainerfwd.h \
/usr/include/qt5/QtCore/qisenum.h \
/usr/include/qt5/QtCore/qobject_impl.h \
function.h
/usr/lib/x86_64-linux-gnu/qt5/bin/moc $(DEFINES) $(INCPATH) function.h -o moc_function.cpp
compiler_wayland-code_make_all:
compiler_wayland-code_clean:
compiler_moc_source_make_all:
compiler_moc_source_clean:
compiler_uic_make_all:
compiler_uic_clean:
compiler_yacc_decl_make_all:
compiler_yacc_decl_clean:
compiler_yacc_impl_make_all:
compiler_yacc_impl_clean:
compiler_lex_make_all:
compiler_lex_clean:
compiler_clean: compiler_moc_header_clean
####### Compile
main.o: main.cpp function.h \
/usr/include/qt5/QtCore/QObject \
/usr/include/qt5/QtCore/qobject.h \
/usr/include/qt5/QtCore/qobjectdefs.h \
/usr/include/qt5/QtCore/qnamespace.h \
/usr/include/qt5/QtCore/qglobal.h \
/usr/include/qt5/QtCore/qconfig.h \
/usr/include/qt5/QtCore/qfeatures.h \
/usr/include/qt5/QtCore/qsystemdetection.h \
/usr/include/qt5/QtCore/qcompilerdetection.h \
/usr/include/qt5/QtCore/qprocessordetection.h \
/usr/include/qt5/QtCore/qlogging.h \
/usr/include/qt5/QtCore/qflags.h \
/usr/include/qt5/QtCore/qtypeinfo.h \
/usr/include/qt5/QtCore/qtypetraits.h \
/usr/include/qt5/QtCore/qsysinfo.h \
/usr/include/qt5/QtCore/qobjectdefs_impl.h \
/usr/include/qt5/QtCore/qstring.h \
/usr/include/qt5/QtCore/qchar.h \
/usr/include/qt5/QtCore/qbytearray.h \
/usr/include/qt5/QtCore/qrefcount.h \
/usr/include/qt5/QtCore/qatomic.h \
/usr/include/qt5/QtCore/qbasicatomic.h \
/usr/include/qt5/QtCore/qatomic_bootstrap.h \
/usr/include/qt5/QtCore/qgenericatomic.h \
/usr/include/qt5/QtCore/qatomic_msvc.h \
/usr/include/qt5/QtCore/qatomic_integrity.h \
/usr/include/qt5/QtCore/qoldbasicatomic.h \
/usr/include/qt5/QtCore/qatomic_vxworks.h \
/usr/include/qt5/QtCore/qatomic_power.h \
/usr/include/qt5/QtCore/qatomic_aarch64.h \
/usr/include/qt5/QtCore/qatomic_alpha.h \
/usr/include/qt5/QtCore/qatomic_armv7.h \
/usr/include/qt5/QtCore/qatomic_armv6.h \
/usr/include/qt5/QtCore/qatomic_armv5.h \
/usr/include/qt5/QtCore/qatomic_bfin.h \
/usr/include/qt5/QtCore/qatomic_ia64.h \
/usr/include/qt5/QtCore/qatomic_mips.h \
/usr/include/qt5/QtCore/qatomic_s390.h \
/usr/include/qt5/QtCore/qatomic_sh4a.h \
/usr/include/qt5/QtCore/qatomic_sparc.h \
/usr/include/qt5/QtCore/qatomic_x86.h \
/usr/include/qt5/QtCore/qatomic_cxx11.h \
/usr/include/qt5/QtCore/qatomic_gcc.h \
/usr/include/qt5/QtCore/qatomic_unix.h \
/usr/include/qt5/QtCore/qarraydata.h \
/usr/include/qt5/QtCore/qstringbuilder.h \
/usr/include/qt5/QtCore/qlist.h \
/usr/include/qt5/QtCore/qalgorithms.h \
/usr/include/qt5/QtCore/qiterator.h \
/usr/include/qt5/QtCore/qcoreevent.h \
/usr/include/qt5/QtCore/qscopedpointer.h \
/usr/include/qt5/QtCore/qmetatype.h \
/usr/include/qt5/QtCore/qvarlengtharray.h \
/usr/include/qt5/QtCore/qcontainerfwd.h \
/usr/include/qt5/QtCore/qisenum.h \
/usr/include/qt5/QtCore/qobject_impl.h \
function.cpp \
/usr/include/qt5/QtWidgets/QApplication \
/usr/include/qt5/QtWidgets/qapplication.h \
/usr/include/qt5/QtCore/qcoreapplication.h \
/usr/include/qt5/QtCore/qeventloop.h \
/usr/include/qt5/QtGui/qwindowdefs.h \
/usr/include/qt5/QtGui/qwindowdefs_win.h \
/usr/include/qt5/QtCore/qpoint.h \
/usr/include/qt5/QtCore/qsize.h \
/usr/include/qt5/QtGui/qcursor.h \
/usr/include/qt5/QtWidgets/qdesktopwidget.h \
/usr/include/qt5/QtWidgets/qwidget.h \
/usr/include/qt5/QtCore/qmargins.h \
/usr/include/qt5/QtGui/qpaintdevice.h \
/usr/include/qt5/QtCore/qrect.h \
/usr/include/qt5/QtGui/qpalette.h \
/usr/include/qt5/QtGui/qcolor.h \
/usr/include/qt5/QtGui/qrgb.h \
/usr/include/qt5/QtCore/qstringlist.h \
/usr/include/qt5/QtCore/qdatastream.h \
/usr/include/qt5/QtCore/qiodevice.h \
/usr/include/qt5/QtCore/qpair.h \
/usr/include/qt5/QtCore/qregexp.h \
/usr/include/qt5/QtCore/qstringmatcher.h \
/usr/include/qt5/QtGui/qbrush.h \
/usr/include/qt5/QtCore/qvector.h \
/usr/include/qt5/QtGui/qmatrix.h \
/usr/include/qt5/QtGui/qpolygon.h \
/usr/include/qt5/QtGui/qregion.h \
/usr/include/qt5/QtCore/qline.h \
/usr/include/qt5/QtGui/qtransform.h \
/usr/include/qt5/QtGui/qpainterpath.h \
/usr/include/qt5/QtGui/qimage.h \
/usr/include/qt5/QtGui/qpixmap.h \
/usr/include/qt5/QtCore/qsharedpointer.h \
/usr/include/qt5/QtCore/qshareddata.h \
/usr/include/qt5/QtCore/qsharedpointer_impl.h \
/usr/include/qt5/QtCore/qhash.h \
/usr/include/qt5/QtGui/qfont.h \
/usr/include/qt5/QtGui/qfontmetrics.h \
/usr/include/qt5/QtGui/qfontinfo.h \
/usr/include/qt5/QtWidgets/qsizepolicy.h \
/usr/include/qt5/QtGui/qkeysequence.h \
/usr/include/qt5/QtGui/qevent.h \
/usr/include/qt5/QtCore/qvariant.h \
/usr/include/qt5/QtCore/qmap.h \
/usr/include/qt5/QtCore/qdebug.h \
/usr/include/qt5/QtCore/qtextstream.h \
/usr/include/qt5/QtCore/qlocale.h \
/usr/include/qt5/QtCore/qset.h \
/usr/include/qt5/QtCore/qcontiguouscache.h \
/usr/include/qt5/QtCore/qurl.h \
/usr/include/qt5/QtCore/qurlquery.h \
/usr/include/qt5/QtCore/qfile.h \
/usr/include/qt5/QtCore/qfiledevice.h \
/usr/include/qt5/QtGui/qvector2d.h \
/usr/include/qt5/QtGui/qtouchdevice.h \
/usr/include/qt5/QtGui/qguiapplication.h \
/usr/include/qt5/QtGui/qinputmethod.h \
/usr/include/qt5/QtWidgets/QWidget \
/usr/include/qt5/QtWidgets/QGridLayout \
/usr/include/qt5/QtWidgets/qgridlayout.h \
/usr/include/qt5/QtWidgets/qlayout.h \
/usr/include/qt5/QtWidgets/qlayoutitem.h \
/usr/include/qt5/QtWidgets/qboxlayout.h \
/usr/include/qt5/QtWidgets/QSpinBox \
/usr/include/qt5/QtWidgets/qspinbox.h \
/usr/include/qt5/QtWidgets/qabstractspinbox.h \
/usr/include/qt5/QtGui/qvalidator.h \
/usr/include/qt5/QtWidgets/QLabel \
/usr/include/qt5/QtWidgets/qlabel.h \
/usr/include/qt5/QtWidgets/qframe.h \
/usr/include/qt5/QtWidgets/QGraphicsScene \
/usr/include/qt5/QtWidgets/qgraphicsscene.h \
/usr/include/qt5/QtGui/qpen.h \
/usr/include/qt5/QtWidgets/QGraphicsView \
/usr/include/qt5/QtWidgets/qgraphicsview.h \
/usr/include/qt5/QtGui/qpainter.h \
/usr/include/qt5/QtGui/qtextoption.h \
/usr/include/qt5/QtWidgets/qscrollarea.h \
/usr/include/qt5/QtWidgets/qabstractscrollarea.h \
/usr/include/qt5/QtWidgets/QGraphicsPixmapItem \
/usr/include/qt5/QtWidgets/qgraphicsitem.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp
moc_function.o: moc_function.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_function.o moc_function.cpp
####### Install
install: FORCE
uninstall: FORCE
FORCE:
I found out that all I had to do was include the libraries that i needed into "LIBS" in the Makefile. So this is the solution,at the end of LIBS in the Makefile or at the bottom add the line
`LIBS += pkg-config --libs opencv`
this line can actually be added anywhere in the "Compiler, tools and options" section of the Makefile(refer to the Makefile code posted in the original question).
Additionally, my lack of "namespace" was also an issue!
As clang is trying to tell you, you forgot the openCV namespace.
use either:
cv::Mat cvImage;
or
using namespace cv;
See the documentation.

How to print dependencies from llvm / clang (equivalent of gcc -MD)?

Our build system is using gcc to generate source file's header dependencies to *.d files, when compiling:
gcc -MD -MF foo.d -c foo.o foo.cc
However, I can't figure out how to produce similar output with llvm clang.
It's exactly the same:
clang -MD -MF foo.d -c foo.o foo.cc
An example:
$ cat example.c
#include <stdio.h>
int main(int argc, char **argv)
{
printf("Hello, world!\n");
return 0;
}
$ clang -MD -MF example-clang.d -c -o example-clang.o example.c
$ gcc -MD -MF example-gcc.d -c -o example-gcc.o example.c
$ cat example-clang.d
example-clang.o: example.c /usr/include/stdio.h /usr/include/_types.h \
/usr/include/sys/_types.h /usr/include/sys/cdefs.h \
/usr/include/machine/_types.h /usr/include/i386/_types.h \
/usr/include/secure/_stdio.h /usr/include/secure/_common.h
$ cat example-gcc.d
example-gcc.o: example.c /usr/include/stdio.h /usr/include/_types.h \
/usr/include/sys/_types.h /usr/include/sys/cdefs.h \
/usr/include/machine/_types.h /usr/include/i386/_types.h \
/usr/include/secure/_stdio.h /usr/include/secure/_common.h
$ diff example-clang.d example-gcc.d
1c1
< example-clang.o: example.c /usr/include/stdio.h /usr/include/_types.h \
---
> example-gcc.o: example.c /usr/include/stdio.h /usr/include/_types.h \