I am trying to build the hello world gtkmm example from the docs using the command
-DLIBDEFLATE_DLL -IC:/msys64/mingw64/include/gtkmm-4.0 -IC:/msys64/mingw64/lib/gtkmm-4.0/include -IC:/msys64/mingw64/include/gtk-4.0 \
-IC:/msys64/mingw64/include/cairo -IC:/msys64/mingw64/include/graphene-1.0 \
-IC:/msys64/mingw64/lib/graphene-1.0/include -IC:/msys64/mingw64/include/pangomm-2.48 \
-IC:/msys64/mingw64/lib/pangomm-2.48/include -IC:/msys64/mingw64/include/giomm-2.68 \
-IC:/msys64/mingw64/lib/giomm-2.68/include -IC:/msys64/mingw64/include/glibmm-2.68 \
-IC:/msys64/mingw64/lib/glibmm-2.68/include -IC:/msys64/mingw64/include/cairomm-1.16 \
-IC:/msys64/mingw64/lib/cairomm-1.16/include -IC:/msys64/mingw64/include/sigc++-3.0 \
-IC:/msys64/mingw64/lib/sigc++-3.0/include -IC:/msys64/mingw64/include/pango-1.0 \
-IC:/msys64/mingw64/include/harfbuzz -IC:/msys64/mingw64/include/pango-1.0 \
-IC:/msys64/mingw64/include/fribidi -IC:/msys64/mingw64/include/cairo \
-IC:/msys64/mingw64/include/freetype2 -IC:/msys64/mingw64/include/harfbuzz \
-IC:/msys64/mingw64/include/pixman-1 -IC:/msys64/mingw64/include/gdk-pixbuf-2.0 \
-IC:/msys64/mingw64/include/libpng16 -IC:/msys64/mingw64/include/webp \
-IC:/msys64/mingw64/include/glib-2.0 -IC:/msys64/mingw64/lib/glib-2.0/include \
-lgtkmm-4.0 -lgtk-4.0 -lpangowin32-1.0 -lcairo-gobject -lgraphene-1.0 -lpangomm-2.48 \
-lgiomm-2.68 -lgio-2.0 -lglibmm-2.68 -lcairomm-1.16 -lsigc-3.0 -lpangocairo-1.0 -lpango-1.0 \
-lharfbuzz -lcairo -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lintl
or
g++ -static -static-libgcc `pkg-config gtkmm-4 --cflags --libs`
this resutls in the following errors
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lgtk-4: No such file or directory
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lgraphene-1.0: No such file or directory
collect2.exe: error: ld returned 1 exit status
according to this question I should add the path C:\msys64\mingw64\bin so i did but it did not help
I am using msys2 to compile this example
#include <gtkmm.h>
class Win : public Gtk::Window
{
public:
Win();
};
Win::Win()
{
set_title("Hello world");
set_default_size(500,500);
}
int main (int argc, char * argv[])
{
auto app = Gtk::Application::create("org.gtkmm.examples.base");
return app->make_window_and_run<Win>(argc, argv);
}
I did verify that gtk-4 and graphene are both installed and located the include and lib folders
Related
i'm using ffmpeg (open source) compiled dylib in macos for my project. But not able to debug ffmpeg dll's src using lldb.
configure \
--prefix=$_outAbsPathDebug \
--extra-cflags="-I${_x264AbsPathDebug}/include" \
--extra-ldflags="-L${_x264AbsPathDebug}/lib" \
--enable-debug \
--disable-optimizations \
--enable-shared \
--enable-static \
--disable-ffplay \
--enable-ffprobe \
--enable-ffmpeg \
--enable-gpl \
--enable-libx264 \
--enable-avresample
compiling sample
g++ \
-std=c++17 \
-D__STDC_CONSTANT_MACROS \
-Wno-deprecated \
-o "sampleffmpeg" \
-I"./../../../../../../mod/out/FFmpeg/mac/debug/config/" \
-I"./../../../../../../mod/src/FFmpeg/" \
-I"./../../../../../../mod/src/FFmpeg/compat/atomics/mac32/" \
-g \
"sampleffmpeg.cpp" \
-L"./" \
-lavcodec \
-lavdevice \
-lavfilter \
-lavformat \
-lavutil \
-lpostproc \
-lswresample \
-lswscale
sampleffmpeg.cpp
#include <iostream>
extern "C" {
#include <libavformat/avformat.h>
#include <libavutil/imgutils.h>
#include <libswscale/swscale.h>
}
int main() {
// Register all codecs and formats
av_register_all();
return 0;
}
lldb not able to step in av_register_all
Process 5392 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
frame #0: 0x0000000100003f98 sampleffmpeg`main at sampleffmpeg.cpp:10:5
7
8 int main() {
9 // Register all codecs and formats
-> 10 av_register_all();
11
12 return 0;
13 }
Target 0: (sampleffmpeg) stopped.
(lldb) s
Process 5392 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = step in
frame #0: 0x0000000100003fa0 sampleffmpeg`main at sampleffmpeg.cpp:12:5
9 // Register all codecs and formats
10 av_register_all();
11
-> 12 return 0;
13 }
Target 0: (sampleffmpeg) stopped.
When I compile my program that uses gtkmm I always have to add pkg-config flags to the command and the #include<gtkmm.h> is always underline red (cannot open source file).
How would I be able to get rid of the error and not have to type pkg-config gtkmm-3.0 --cflags --libs every time I compile my code, code below:
#include <gtkmm.h>
#include <iostream>
void hello_world() {
std::cout << "Hello world." << std::endl;
}
int main(int argc, char* argv[])
{
Gtk::Main app(argc, argv);
auto builder = Gtk::Builder::create_from_file("test.glade");
Gtk::Window *main_window;
builder->get_widget("window", main_window);
Gtk::Button *button1;
builder->get_widget("button1", button1);
button1->signal_clicked().connect(sigc::ptr_fun(&hello_world));
Gtk::Main::run(*main_window);
}
Without the flags I just get the error:
main.cpp:1:10: fatal error: gtkmm.h: No such file or directory
#include <gtkmm.h>
^~~~~~~~~
compilation terminated.
Have you typed in your terminal?
echo `pkg-config gtkmm-3.0 --cflags --libs`
This will display:
-pthread -I/usr/include/gtkmm-3.0 -I/usr/lib/x86_64-linux-gnu/gtkmm-3.0/include -I/usr/include/atkmm-1.6 -I/usr/include/gtk-3.0/unix-print -I/usr/include/gdkmm-3.0 -I/usr/lib/x86_64-linux-gnu/gdkmm-3.0/include -I/usr/include/giomm-2.4 -I/usr/lib/x86_64-linux-gnu/giomm-2.4/include -I/usr/include/pangomm-1.4 -I/usr/lib/x86_64-linux-gnu/pangomm-1.4/include -I/usr/include/glibmm-2.4 -I/usr/lib/x86_64-linux-gnu/glibmm-2.4/include -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/libdrm -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/cairomm-1.0 -I/usr/lib/x86_64-linux-gnu/cairomm-1.0/include -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/sigc++-2.0 -I/usr/lib/x86_64-linux-gnu/sigc++-2.0/include -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lgtkmm-3.0 -latkmm-1.6 -lgdkmm-3.0 -lgiomm-2.4 -lpangomm-1.4 -lglibmm-2.4 -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lgio-2.0 -lcairomm-1.0 -lcairo -lsigc-2.0 -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0
This is all your application needs to be compiled. You can type all these lines by hand but this is not a nice solution because this content depends on your environment and may change pkg-config is here to hide for you the misery.
This question already has answers here:
How do I use extern to share variables between source files?
(19 answers)
Closed 3 years ago.
I am testing some patches (C language) for BOINC client (C++ language), and during compilation I got a GNU linker error about GDBusProxy* proxy = NULL; line in file linux/user_idle_time_detection.h (complete file hereunder). So I started doing some attempts to modify the affected line, but I got two different errors (case 1 and 2 hereunder), and I really cannot understand why the linker does not like:
the extern statement
the pointer initialized at NULL;
Thank you
CASE 1
extern GDBusProxy* proxy;
returns error
/usr/bin/ld: boinc_client-user_idle_time_detection.o: in function `create_proxy':
/builddir/build/BUILD/boinc-client_release-7.14-7.14.2/client/linux/user_idle_time_detection.c:5: undefined reference to `proxy'
/usr/bin/ld: boinc_client-user_idle_time_detection.o: in function `get_user_idle_time':
/builddir/build/BUILD/boinc-client_release-7.14-7.14.2/client/linux/user_idle_time_detection.c:21: undefined reference to `proxy'
collect2: error: ld returned 1 exit status
CASE 2
Both
extern GDBusProxy* proxy = NULL;
and
GDBusProxy* proxy = NULL;
return error
/usr/bin/ld: boinc_client-hostinfo_unix.o:/builddir/build/BUILD/boinc-client_release-7.14-7.14.2/client/linux/user_idle_time_detection.h:7: multiple definition of `proxy'; boinc_client-user_idle_time_detection.o:/builddir/build/BUILD/boinc-client_release-7.14-7.14.2/client/linux/user_idle_time_detection.h:7: first defined here
CASE 3
The following works good instead
GDBusProxy* proxy;
SOURCE FILES
linux/user_idle_time_detection.h
#ifndef USER_IDLE_TIME_DETECTION_H
#define USER_IDLE_TIME_DETECTION_H
#include <gio/gio.h>
#include "gnome/gnome_dbus_interface.h"
GDBusProxy* proxy = NULL;
GDBusProxy* create_proxy();
double get_user_idle_time();
#endif /* USER_IDLE_TIME_DETECTION_H */
linux/user_idle_time_detection.c
#include <gio/gio.h>
#include "user_idle_time_detection.h"
GDBusProxy* create_proxy()
{
proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
G_DBUS_PROXY_FLAGS_NONE,
NULL,
GNOME_DBUS_SERVICE,
GNOME_DBUS_PATH_SETTINGS,
GNOME_DBUS_INTERFACE_SETTINGS,
NULL, NULL);
return proxy;
}
double get_user_idle_time()
{
guint64 user_idle_time;
double user_idle_time_double;
GError* error = NULL;
GVariant* ret = NULL;
proxy = create_proxy();
ret = g_dbus_proxy_call_sync(proxy,
GNOME_DBUS_METHOD_SETTINGS,
NULL,
G_DBUS_CALL_FLAGS_NONE, -1,
NULL, &error);
if (!ret) {
g_dbus_error_strip_remote_error (error);
g_print ("GetIdletime failed: %s\n", error->message);
g_error_free (error);
return;
}
g_variant_get(ret, "(t)", &user_idle_time);
user_idle_time_double = (double)user_idle_time;
g_variant_unref (ret);
return user_idle_time_double;
}
linux/gnome/gnome_dbus_interface.h
#ifndef GNOME_DBUS_INTERFACE_H
#define GNOME_DBUS_INTERFACE_H
#define GNOME_DBUS_SERVICE "org.gnome.Mutter.IdleMonitor"
#define GNOME_DBUS_PATH_SETTINGS "/org/gnome/Mutter/IdleMonitor/Core"
#define GNOME_DBUS_INTERFACE_SETTINGS "org.gnome.Mutter.IdleMonitor"
#define GNOME_DBUS_METHOD_SETTINGS "GetIdletime"
#endif /* GNOME_DBUS_INTERFACE_H */
hostinfo_unix.cpp
#include "linux/user_idle_time_detection.h"
CUT
bool HOST_INFO::users_idle(bool check_all_logins, double idle_time_to_run) {
double user_idle_time;
double user_pref_idle_time_in_ms;
//user_idle_time = get_user_idle_time();
user_pref_idle_time_in_ms = (idle_time_to_run * 60000);
CUT
Makefile.am
## -*- mode: makefile; tab-width: 4 -*-
## $Id$
include $(top_srcdir)/Makefile.incl
if ENABLE_CLIENT_RELEASE
AM_LDFLAGS += -static-libtool-libs
## for an entirely statically linked library, you may want to try
## -all-static instead. There's a good chance it won't work properly,
## so we'll use the safer "-static-libtool-libs" by default.
else
if DYNAMIC_CLIENT
## if libtool starts to need flags for dynamic linking, add them here
else
AM_LDFLAGS += -static
endif
endif ## ENABLE_CLIENT_RELEASE
LIBS += $(CLIENTLIBS)
if OS_DARWIN
LIBS += -framework IOKit -framework Foundation -framework ScreenSaver -framework Cocoa -framework CoreServices
endif
bin_PROGRAMS = boinc_client boinccmd
if !OS_WIN32
bin_PROGRAMS += switcher
endif
boinccmd_SOURCES = boinc_cmd.cpp
boinccmd_DEPENDENCIES = $(LIBBOINC)
boinccmd_CPPFLAGS = $(AM_CPPFLAGS)
boinccmd_LDFLAGS = $(AM_LDFLAGS) -L$(top_srcdir)/lib
boinccmd_LDADD = $(LIBBOINC) $(BOINC_EXTRA_LIBS) $(PTHREAD_LIBS)
boinc_client_SOURCES = \
acct_mgr.cpp \
acct_setup.cpp \
app.cpp \
app_config.cpp \
app_control.cpp \
app_start.cpp \
async_file.cpp \
check_state.cpp \
client_msgs.cpp \
client_state.cpp \
client_types.cpp \
coproc_sched.cpp \
cpu_sched.cpp \
cs_account.cpp \
cs_apps.cpp \
cs_benchmark.cpp \
cs_cmdline.cpp \
cs_files.cpp \
cs_notice.cpp \
cs_platforms.cpp \
cs_prefs.cpp \
cs_proxy.cpp \
cs_scheduler.cpp \
cs_statefile.cpp \
cs_trickle.cpp \
current_version.cpp \
dhrystone.cpp \
dhrystone2.cpp \
file_names.cpp \
file_xfer.cpp \
gpu_amd.cpp \
gpu_detect.cpp \
gpu_intel.cpp \
gpu_nvidia.cpp \
gpu_opencl.cpp \
gui_http.cpp \
gui_rpc_server.cpp \
gui_rpc_server_ops.cpp \
hostinfo_linux.cpp \
hostinfo_network.cpp \
http_curl.cpp \
log_flags.cpp \
mac_address.cpp \
main.cpp \
net_stats.cpp \
pers_file_xfer.cpp \
project.cpp \
project_list.cpp \
result.cpp \
rr_sim.cpp \
sandbox.cpp \
scheduler_op.cpp \
thread.cpp \
time_stats.cpp \
whetstone.cpp \
work_fetch.cpp \
linux/user_idle_time_detection.c
boinc_client_DEPENDENCIES = $(LIBBOINC)
boinc_client_CPPFLAGS = $(AM_CPPFLAGS) $(GIO_CFLAGS) $(GLIB_CFLAGS)
boinc_client_CXXFLAGS = $(AM_CXXFLAGS) $(SSL_CXXFLAGS)
boinc_client_LDFLAGS = $(AM_LDFLAGS) $(SSL_LDFLAGS) $(GIO_LIBS) $(GLIB_LIBS) -L$(top_srcdir)/lib
if OS_WIN32
boinc_client_CXXFLAGS += -I$(top_srcdir)/coprocs/NVIDIA/include
boinc_client_SOURCES += hostinfo_win.cpp \
hostinfo_wsl.cpp \
sysmon_win.cpp \
win/boinc_cli.rc \
win/res/boinc.ico
else
if OS_DARWIN
boinc_client_LDFLAGS += -Wl,-flat_namespace,-undefined,dynamic_lookup
else
boinc_client_SOURCES += hostinfo_unix.cpp
endif
endif
boinc_client_LDADD = $(LIBBOINC) $(LIBBOINC_CRYPT) $(BOINC_EXTRA_LIBS) $(PTHREAD_LIBS)
boinc_clientdir = $(bindir)
if OS_ARM_LINUX
boinc_client_LDADD += libwhetneon.a libwhetvfp.a
noinst_LIBRARIES = libwhetneon.a libwhetvfp.a
libwhetneon_a_SOURCES = whetstone.cpp
libwhetneon_a_CXXFLAGS = $(boinc_client_CXXFLAGS) -DANDROID_NEON -mfloat-abi=softfp -mfpu=neon
libwhetvfp_a_SOURCES = whetstone.cpp
libwhetvfp_a_CXXFLAGS = $(boinc_client_CXXFLAGS) -DANDROID_VFP -mfloat-abi=softfp -mfpu=vfp
endif
switcher_SOURCES = switcher.cpp
switcher_LDFLAGS = $(AM_LDFLAGS) -L../lib
switcher_LDADD = $(LIBBOINC)
## since we are using libtool we need some magic to get boinc and boinc_client
## to both be installed properly. The next two rules do that...
all-local: boinc$(EXEEXT)
boinc$(EXEEXT): boinc_client$(EXEEXT)
rm -f boinc$(EXEEXT) .libs/boinc$(EXEEXT)
$(LN) boinc_client$(EXEEXT) boinc$(EXEEXT)
if test -f .libs/boinc_client$(EXEEXT) ; then $(LN) .libs/boinc_client$(EXEEXT) .libs/boinc$(EXEEXT) ; fi
install-exec-hook:
rm -f $(DESTDIR)$(exec_prefix)/bin/boinc$(EXEEXT)
$(LN) $(DESTDIR)$(exec_prefix)/bin/boinc_client$(EXEEXT) $(DESTDIR)$(exec_prefix)/bin/boinc$(EXEEXT)
## these source files need to be specified because no rule uses them.
EXTRA_DIST = *.h \
mac \
translation \
win
Makefile.curl.am
## -*- mode: make; tab-width: 4 -*-
## $Id$
include $(top_srcdir)/Makefile.incl
# (for a while we used "-static -static-libgcc" on linux, but this is obsolete
# now)
#STATIC_FLAGS=#STATIC_FLAGS#
client-bin: #CLIENT_BIN_FILENAME#
LIBS += #CLIENTLIBS#
bin_PROGRAMS = boinc_client
EXTRA_PROGRAMS = cpu_benchmark
boinc_client_SOURCES = \
acct_mgr.cpp \
acct_setup.cpp \
app.cpp \
app_control.cpp \
app_graphics.cpp \
app_start.cpp \
check_state.cpp \
client_msgs.cpp \
client_state.cpp \
client_types.cpp \
cs_account.cpp \
cs_apps.cpp \
cs_benchmark.cpp \
cs_cmdline.cpp \
cs_data.cpp \
cs_files.cpp \
cs_prefs.cpp \
cs_scheduler.cpp \
cs_statefile.cpp \
cs_trickle.cpp \
dhrystone.cpp \
dhrystone2.cpp \
file_names.cpp \
file_xfer.cpp \
gui_http.cpp \
gui_rpc_server.cpp \
gui_rpc_server_ops.cpp \
hostinfo_linux.cpp \
hostinfo_network.cpp \
hostinfo_unix.cpp \
http_curl.cpp \
log_flags.cpp \
main.cpp \
net_stats.cpp \
net_xfer_curl.cpp \
pers_file_xfer.cpp \
scheduler_op.cpp \
time_stats.cpp \
whetstone.cpp \
linux/user_idle_time_detection.c
boinc_client_DEPENDENCIES = $(LIBRSA)
boinc_client_CPPFLAGS = -D_USE_CURL -I../../curl-7.14.0/include -I $(srcdir)/win $(AM_CPPFLAGS) -O3
boinc_client_LDFLAGS = -static-libgcc
boinc_client_LDADD = -L/usr/local/ssl/lib -lssl -L../../curl-7.14.0/lib -lcurl -L../lib -lboinc $(RSA_LIBS) $(PTHREAD_LIBS)
#boinc_client_LDFLAGS = $(STATIC_FLAGS)
# the following don't do anything
cpu_benchmark_SOURCES = whetstone.cpp dhrystone.cpp
cpu_benchmark_CFLAGS = -O3 $(AM_CFLAGS)
all-local: client-bin
# make a hard link to the client name.
#CLIENT_BIN_FILENAME#: boinc_client
rm -f $#
#LN# $? $#
#STRIP# $#
## these source files need to be specified because no rule uses them.
EXTRA_DIST = *.h \
mac \
translation \
win
clean-local:
rm -f #CLIENT_BIN_FILENAME#
configure.ac
Cannot insert it here due Stackoverflow characters limit.
You should be getting a warning:
// This is wrong...
extern GDBusProxy* proxy = NULL;
warning: ‘proxy’ initialized and declared ‘extern’
extern GDBusProxy* proxy = NULL;
^~~~~
The extern storage class specifier basically means "this is defined somewhere else", but the = NULL is not really somewhere else.
Just like functions, with variables you should:
Declare them in the header file (compiled many times):
extern GDBusProxy *proxy;
This is a declaration and you can have as many declarations of a single object as you like (as long as they are all compatible).
Define them in the C file (compiled once):
GDBusProxy *proxy = NULL;
This is a definition and you can only have one definition in your entire project. So it cannot appear in a header file, unless that header file is only included by one C file.
This not the only way to do it. You can use the following declaration everywhere:
GDBusProxy *proxy;
This is a special case, it counts as a definition but you are allowed to have more than one in your program.
Note that = NULL is redundant. Global variables are zero-initialized by default.
In the case 1 you missed to define the variable in a source file, so its definition is missing
In the other cases having
GDBusProxy* proxy = NULL;
in a header file does not declare the variable but define it, so including the header file in several sources define it several times.
replace it by
extern GDBusProxy* proxy;
and define it in one of the source files
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.
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.