I'm trying to use the library gdcm in my project. However I'm with some problem.
gdcmGlobal.cxx:-1: error: undefined reference to gdcm::System::FileIsDirectory(char const*)'
gdcmGlobal.cxx:-1: error: undefined reference togdcm::System::FileIsDirectory(char const*)'
gdcmGlobal.cxx:-1: error: undefined reference to gdcm::System::FileExists(char const*)'
:-1: error: C:\Program_Library\gdcm-2.0.18-mingw32\bin/libgdcmDICT.a(gdcmGlobal.cxx.obj): bad reloc address 0xf in section.text$ZNK4gdcm7Modules7IsEmptyEv[_ZNK4gdcm7Modules7IsEmptyEv]'
I included the libs:
LIBS += -L"C:\Program_Library\gdcm-2.0.18-mingw32\bin" \
-L"C:\Program_Library\gdcm-2.0.18-mingw32\bin\libgdcmMSFF.a" \
-L"C:\Program_Library\gdcm-2.0.18-mingw32\bin\libgdcmCommon.a"\
-L"C:\Program_Library\gdcm-2.0.18-mingw32\bin\libgdcmDICT.a"\
-L"C:\Program_Library\gdcm-2.0.18-mingw32\bin\libgdcmDSED.a"\
-L"C:\Program_Library\gdcm-2.0.18-mingw32\bin\libgdcmexpat.a"\
-L"C:\Program_Library\gdcm-2.0.18-mingw32\bin\libgdcmIOD.a"\
-L"C:\Program_Library\gdcm-2.0.18-mingw32\bin\libgdcmjpeg8.a"\
-L"C:\Program_Library\gdcm-2.0.18-mingw32\bin\libgdcmjpeg12.a"\
-L"C:\Program_Library\gdcm-2.0.18-mingw32\bin\libgdcmjpeg16.a"\
-L"C:\Program_Library\gdcm-2.0.18-mingw32\bin\libgdcmopenjpeg.a"\
-L"C:\Program_Library\gdcm-2.0.18-mingw32\bin\libgdcmzlib.a"\
-L"C:\Program_Library\gdcm-2.0.18-mingw32\bin\libgdcmcharls.a"\
-L"C:\Program_Library\gdcm-2.0.18-mingw32\bin\libgdcmgetopt.a"
LIBS += -lgdcmMSFF -lgdcmCommon -lgdcmDICT -lgdcmDSED -lgdcmexpat
-lgdcmIOD -lgdcmjpeg8 -lgdcmjpeg12 -lgdcmjpeg16 -lgdcmopenjpeg -lgdcmzlib -lgdcmcharls -lgdcmgetopt
Anybody would know what is happening?
Thanks!
Qt 5.1 uses g++ 4.8 and I used g++ 4.6 to compile gdcm! That is the problem! However when I included:
include < gdcmGlobal.h>
appear this error:
gdcmGlobal.cxx:-1: error: undefined reference to
`gdcm::System::FileIsDirectory(char const*)'
but when I remove: include < gdcmGlobal.h>, compiles!
Related
For some unknown reason, my libmysqlclient.a disappeared in my CentOS 7.
My program then got linker error, saying cannot find libmysqlclient.
And then I discovered that my mysql-devel package is gone:
yum info mysql-devel
yum install mysql-devel
Here is the response:
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: repo.virtualhosting.hk
* epel: mirror.pregi.net
* extras: repo.virtualhosting.hk
* updates: repo.virtualhosting.hk
Package MariaDB-devel-10.2.5-1.el7.centos.x86_64 already installed and latest version
So I think maybe I should use libmariadbclient instead, but when I link my program with libmariadbclient, it had linking errors:
/usr/lib64//libmariadbclient.a(openssl.c.o): In function `ma_tls_start':
(.text+0x191): undefined reference to `CRYPTO_num_locks'
/usr/lib64//libmariadbclient.a(openssl.c.o): In function `ma_tls_start':
(.text+0x1aa): undefined reference to `CRYPTO_THREADID_set_callback'
/usr/lib64//libmariadbclient.a(openssl.c.o): In function `ma_tls_start':
(.text+0x1b6): undefined reference to `CRYPTO_set_locking_callback'
/usr/lib64//libmariadbclient.a(openssl.c.o): In function `ma_tls_start':
(.text+0x1bb): undefined reference to `SSL_library_init'
/usr/lib64//libmariadbclient.a(openssl.c.o): In function `ma_tls_start':
(.text+0x1c7): undefined reference to `SSL_load_error_strings'
/usr/lib64//libmariadbclient.a(openssl.c.o): In function `ma_tls_start':
(.text+0x1cc): undefined reference to `OPENSSL_add_all_algorithms_noconf'
/usr/lib64//libmariadbclient.a(openssl.c.o): In function `ma_tls_end':
(.text+0x2b4): undefined reference to `CRYPTO_set_locking_callback'
/usr/lib64//libmariadbclient.a(openssl.c.o): In function `ma_tls_end':
(.text+0x2bb): undefined reference to `CRYPTO_set_id_callback'
/usr/lib64//libmariadbclient.a(openssl.c.o): In function `ma_tls_end':
(.text+0x2df): undefined reference to `CRYPTO_num_locks'
/usr/lib64//libmariadbclient.a(openssl.c.o): In function `ma_tls_end':
(.text+0x340): undefined reference to `EVP_cleanup'
/usr/lib64//libmariadbclient.a(openssl.c.o): In function `ma_tls_end':
(.text+0x345): undefined reference to `CRYPTO_cleanup_all_ex_data'
/usr/lib64//libmariadbclient.a(openssl.c.o): In function `ma_tls_end':
(.text+0x34a): undefined reference to `ERR_free_strings'
/usr/lib64//libmariadbclient.a(openssl.c.o): In function `ma_tls_end':
(.text+0x351): undefined reference to `CONF_modules_free'
/usr/lib64//libmariadbclient.a(openssl.c.o): In function `ma_tls_init':
(.text+0x3e1): undefined reference to `SSLv23_client_method'
/usr/lib64//libmariadbclient.a(openssl.c.o): In function `my_cb_threadid':
(.text+0x1e): undefined reference to `CRYPTO_THREADID_set_numeric'
/usr/lib64//libmariadbclient.a(ma_compress.c.o): In function `_mariadb_compress_alloc':
(.text+0x5d): undefined reference to `compress'
/usr/lib64//libmariadbclient.a(ma_compress.c.o): In function `_mariadb_uncompress':
(.text+0x191): undefined reference to `uncompress'
collect2: error: ld returned 1 exit status
I've been using libmysqlclient to connect with my MariaDB 10.1, and have recently been trying to build it from source, but failed due to problems with OpenSSL 1.1 version. Here you see my another post for it:
Error "incomplete type MD5_CONTEXT" with MariaDB 10.2 and Openssl 1.1.0e
So I'm confused why mysqlclient.a disappeared and which lib I should use.
Can anyone help?
Thanks!
I had the similar problem when tried to compile my program with "-lmariadbclient" (after apt-get update -lmysqlclient stopped working).
The Makefile I used was:
g++ -std=c++11 *.cpp ../common/*.cpp ../common/*.c -o myprogram -I.. -ldl -Wstack-protector -fstack-protector-all -pthread -ggdb -lssl -lcrypto -lz -lmariadbclient -Wwrite-strings -fPIC
I read that commands "-lssl -lcrypto -lz" must be added to fix those errors, but I put them in the wrong place (before lmariadbclient). When I added them after "-lmariadbclient" I was finally able to compile my program:
g++ -std=c++11 *.cpp ../common/*.cpp ../common/*.c -o myprogram -I.. -ldl -Wstack-protector -fstack-protector-all -pthread -ggdb -lmariadbclient -Wwrite-strings -lssl -lcrypto -lz -fPIC
UPDATE 22.07.2017:
I recently tried to compile my program on the new Linux Mint 18.2. Unfortunately I was getting the same compilation errors, and I was unable to fix it with the old method:
MariaDB version:
mysql --version
mysql Ver 15.1 Distrib 10.2.7-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
Compile errors:
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libmariadbclient.a(openssl.c.o): In function `ma_tls_start':
(.text+0x189): undefined reference to `CRYPTO_num_locks'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libmariadbclient.a(openssl.c.o): In function `ma_tls_start':
(.text+0x1a4): undefined reference to `CRYPTO_THREADID_set_callback'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libmariadbclient.a(openssl.c.o): In function `ma_tls_start':
(.text+0x1b0): undefined reference to `CRYPTO_set_locking_callback'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libmariadbclient.a(openssl.c.o): In function `ma_tls_start':
(.text+0x1b5): undefined reference to `SSL_library_init'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libmariadbclient.a(openssl.c.o): In function `ma_tls_start':
(.text+0x1c1): undefined reference to `SSL_load_error_strings'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libmariadbclient.a(openssl.c.o): In function `ma_tls_start':
(.text+0x1c6): undefined reference to `OPENSSL_add_all_algorithms_noconf'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libmariadbclient.a(openssl.c.o): In function `ma_tls_end':
(.text+0x2a4): undefined reference to `CRYPTO_set_locking_callback'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libmariadbclient.a(openssl.c.o): In function `ma_tls_end':
(.text+0x2ab): undefined reference to `CRYPTO_set_id_callback'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libmariadbclient.a(openssl.c.o): In function `ma_tls_end':
(.text+0x2cf): undefined reference to `CRYPTO_num_locks'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libmariadbclient.a(openssl.c.o): In function `ma_tls_end':
(.text+0x330): undefined reference to `EVP_cleanup'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libmariadbclient.a(openssl.c.o): In function `ma_tls_end':
(.text+0x335): undefined reference to `CRYPTO_cleanup_all_ex_data'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libmariadbclient.a(openssl.c.o): In function `ma_tls_end':
(.text+0x33a): undefined reference to `ERR_free_strings'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libmariadbclient.a(openssl.c.o): In function `ma_tls_end':
(.text+0x33f): undefined reference to `CONF_modules_free'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libmariadbclient.a(openssl.c.o): In function `ma_tls_init':
(.text+0x3c1): undefined reference to `SSLv23_client_method'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libmariadbclient.a(openssl.c.o): In function `my_cb_threadid':
(.text+0x1e): undefined reference to `CRYPTO_THREADID_set_numeric'
I managed to fix it by changing "-lmariadbclient" to: "-lmariadb". After that I was able to compile my program with no errors. I'm not sure if this solution will work for everyone, but worth to try :)
My final Makefile is:
g++ -std=c++11 *.cpp ../common/*.cpp ../common/*.c -o myprogram -I.. -ldl -Wstack-protector -fstack-protector-all -pthread -ggdb -lmariadb -Wwrite-strings -lssl -lcrypto -lz -fPIC
Good luck!
I am trying to use Taglib with Qt5.7. But my programm crashes:
The GDB process terminated unexpectedly (exit code 0).
Cannot continue debugged process: The program is not being run.
During startup program exited with code 0xc0000135
There did not seem to be any error messages while building Taglib.
*.pro file
QT += core
QT -= gui
CONFIG += c++11
TARGET = untitled2
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
TAGLIBDIR = $$quote(D:/D/Programmieren/Libraries/taglib)
INCLUDEPATH += $$quote( $${TAGLIBDIR}/include )
LIBS += -L$$quote($${TAGLIBDIR}/lib) -ltag
main.cpp
#include <QCoreApplication>
#include <taglib/tag.h>
#include <taglib/fileref.h>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
TagLib::FileRef ref("D:/D/Media/Musik/Disturbed/The Sickness/Disturbed - Stupify.mp3");
return a.exec();
}
Edit:
I created Taglib-buildfiles using CMake-GUI and native MinGW-Installation since I did not manage to create them using Qt. My OS is Windows 10 x64 Education and I use Qt-Creator. I downloaded the latest Taglib-Release (1.11.1)
Why I cant create buildfiles using CMake:
First some *dll-files where missing, i coud solve that by just copying the ones from native MinGW-Installation to QT-MinGW.
Second I could not find any of the *exe-files desired by CMake so i could not change the path from native MinGW-Installation.
After rebuilding Taglib in debugmode I get this errors:
main.cpp:10: error: undefined reference to `_imp___ZN6TagLib8FileNameC1EPKc'
main.cpp:10: error: undefined reference to `_imp___ZN6TagLib7FileRefC1ENS_8FileNameEbNS_15AudioProperties9ReadStyleE'
main.cpp:11: error: undefined reference to `_imp___ZNK6TagLib7FileRef3tagEv'
main.cpp:11: error: undefined reference to `_imp___ZNK6TagLib6String9toCStringEb'
main.cpp:11: error: undefined reference to `_imp___ZN6TagLib6StringD1Ev'
main.cpp:10: error: undefined reference to `_imp___ZN6TagLib7FileRefD1Ev'
main.cpp:11: error: undefined reference to `_imp___ZN6TagLib6StringD1Ev'
main.cpp:10: error: undefined reference to `_imp___ZN6TagLib7FileRefD1Ev'
collect2.exe:-1: error: error: ld returned 1 exit status
Solved it by using new version (5.8 instead of 5.7) of Qt.
I have problem with compiling newest version of Frama-C.
What I have done:
wget http://frama-c.com/download/frama-c-Neon-20140301.tar.gz
tar -xzf frama-c-Neon-20140301.tar.gz
cd frama-c-Neon-20140301/
./configure --prefix=/usr/local
make
After a minute I get this
Packing lib/plugins/Wp.cma
Linking bin/toplevel.byte
/tmp/ccLwedhX.o:(.data+0x4529f0): undefined reference to `terminate_process'
/tmp/ccLwedhX.o:(.data+0x4529f4): undefined reference to `ml_usleep'
/tmp/ccLwedhX.o:(.data+0x4529f8): undefined reference to `getperfcount'
/tmp/ccLwedhX.o:(.data+0x4529fc): undefined reference to `getperfcount1024'
/tmp/ccLwedhX.o:(.data+0x452a00): undefined reference to `address_of_value'
/tmp/ccLwedhX.o:(.data+0x452a04): undefined reference to `set_round_nearest_even'
/tmp/ccLwedhX.o:(.data+0x452a08): undefined reference to `single_precision_of_string'
/tmp/ccLwedhX.o:(.data+0x452a0c): undefined reference to `round_to_float'
/tmp/ccLwedhX.o:(.data+0x452a10): undefined reference to `set_round_upward'
/tmp/ccLwedhX.o:(.data+0x452a14): undefined reference to `set_round_downward'
/tmp/ccLwedhX.o:(.data+0x452a18): undefined reference to `float_is_negative'
/tmp/ccLwedhX.o:(.data+0x452a1c): undefined reference to `float_compare_total'
src/buckx/buckx_c.o: In function `round_to_float(long)':
buckx_c.c:(.text+0x45): undefined reference to `caml_copy_double(double)'
src/buckx/buckx_c.o: In function `single_precision_of_string(long)':
buckx_c.c:(.text+0x180): undefined reference to `caml_string_length(long)'
buckx_c.c:(.text+0x194): undefined reference to `caml_copy_double(double)'
buckx_c.c:(.text+0x1a7): undefined reference to `caml_failwith(char const*)'
collect2: error: ld returned 1 exit status
File "_none_", line 1, characters 0-1:
Error: Error while building custom runtime system
make: *** [bin/toplevel.byte] Error 2
I am using gcc 4.8.1, Ubuntu 12.04, ocaml 3.12.1
UPDATE:
VERBOSEMAKE=yes make
ocamlc.opt -w +a-4-6-9-41-44-45 -annot -g -I src/misc -I src/ai -I src/memory_state -I src/toplevel -I src/slicing_types -I src/pdg_types -I src/kernel -I src/logic -I src/lib -I src/printer -I src/project -I src/type -I src/buckx -I src/gui -I external -I cil/src -I cil/src/ext -I cil/src/frontc -I cil/src/logic -I cil/ocamlutil -I lib/plugins -I lib -linkall -custom -o bin/toplevel.byte nums.cma unix.cma bigarray.cma str.cma dynlink.cma lib/graph.cmo src/buckx/buckx_c.o external/unmarshal.cmo external/unmarshal_nums.cmo external/sysutil.cmo src/lib/dynlink_common_interface.cmo src/type/structural_descr.cmo src/type/type.cmo src/type/descr.cmo src/lib/FCSet.cmo src/lib/FCMap.cmo src/lib/FCHashtbl.cmo src/lib/extlib.cmo src/lib/pretty_utils.cmo src/lib/hook.cmo src/lib/bag.cmo src/lib/indexer.cmo src/lib/vector.cmo src/lib/bitvector.cmo src/lib/qstack.cmo src/lib/integer.cmo src/lib/filepath.cmo src/kernel/config.cmo src/kernel/log.cmo src/kernel/cmdline.cmo src/project/project_skeleton.cmo src/type/datatype.cmo src/kernel/journal.cmo src/project/state.cmo src/project/state_dependency_graph.cmo src/project/state_topological.cmo src/project/state_selection.cmo src/project/project.cmo src/project/state_builder.cmo src/kernel/typed_parameter.cmo src/kernel/dynamic.cmo src/kernel/parameter_customize.cmo src/kernel/parameter_state.cmo src/kernel/parameter_builder.cmo src/kernel/plugin.cmo src/kernel/kernel.cmo src/kernel/emitter.cmo src/lib/floating_point.cmo src/lib/rangemap.cmo src/lib/binary_cache.cmo external/hptmap.cmo src/lib/hptset.cmo src/printer/printer_builder.cmo cil/src/cilmsg.cmo cil/ocamlutil/alpha.cmo cil/ocamlutil/cilconfig.cmo cil/src/cil_datatype.cmo cil/src/cil_state_builder.cmo cil/src/logic/utf8_logic.cmo cil/src/machdep_x86_16.cmo cil/src/machdep_x86_32.cmo cil/src/machdep_x86_64.cmo cil/src/machdep_ppc_32.cmo cil/src/cil_const.cmo cil/src/logic/logic_env.cmo cil/src/escape.cmo cil/src/logic/logic_const.cmo cil/src/cil.cmo src/printer/cil_printer.cmo src/printer/cil_descriptive_printer.cmo cil/src/frontc/errorloc.cmo cil/src/frontc/cabs.cmo cil/src/ext/expcompare.cmo cil/src/frontc/cabs_debug.cmo cil/src/frontc/cabshelper.cmo cil/src/logic/logic_utils.cmo cil/src/logic/logic_builtin.cmo cil/src/logic/logic_print.cmo cil/src/logic/logic_parser.cmo cil/src/logic/logic_lexer.cmo cil/src/frontc/lexerhack.cmo cil/src/mergecil.cmo cil/src/rmtmps.cmo cil/src/logic/logic_typing.cmo cil/src/frontc/cprint.cmo cil/src/frontc/cabscond.cmo cil/src/frontc/cabsvisit.cmo cil/src/frontc/cabs2cil.cmo cil/src/frontc/clexer.cmo cil/src/frontc/cparser.cmo cil/src/logic/logic_preprocess.cmo cil/src/frontc/frontc.cmo cil/src/ext/callgraph.cmo cil/src/ext/dataflow.cmo cil/src/ext/oneret.cmo cil/src/ext/cfg.cmo src/buckx/buckx.cmo src/kernel/ast_info.cmo src/kernel/ast.cmo src/kernel/globals.cmo src/kernel/kernel_function.cmo src/logic/property.cmo src/logic/property_status.cmo src/logic/annotations.cmo src/printer/printer.cmo src/kernel/stmts_graph.cmo cil/src/ext/ordered_stmt.cmo cil/src/ext/dataflows.cmo cil/src/ext/dataflow2.cmo cil/src/ext/usedef.cmo cil/src/ext/liveness.cmo cil/src/ext/reachingdefs.cmo cil/src/ext/availexpslv.cmo cil/src/ext/rmciltmps.cmo cil/src/ext/deadcodeelim.cmo src/kernel/dominators.cmo src/logic/description.cmo src/logic/statuses_by_call.cmo src/kernel/alarms.cmo src/kernel/messages.cmo src/ai/abstract_interp.cmo src/ai/int_Base.cmo src/kernel/unicode.cmo src/misc/service_graph.cmo src/ai/ival.cmo src/misc/bit_utils.cmo src/ai/lattice_Interval_Set.cmo src/ai/base.cmo src/ai/origin.cmo src/ai/map_Lattice.cmo src/ai/trace.cmo src/memory_state/locations.cmo src/memory_state/value_messages.cmo src/kernel/cilE.cmo src/memory_state/int_Interv.cmo src/memory_state/int_Interv_Map.cmo src/memory_state/tr_offset.cmo src/memory_state/offsetmap.cmo src/memory_state/offsetmap_bitwise.cmo src/memory_state/lmap.cmo src/memory_state/lmap_bitwise.cmo src/memory_state/function_Froms.cmo src/memory_state/cvalue.cmo src/memory_state/widen_type.cmo src/kernel/visitor.cmo cil/src/frontc/cabsbranches.cmo src/kernel/loop.cmo src/memory_state/inout_type.cmo src/pdg_types/pdgIndex.cmo src/pdg_types/pdgTypes.cmo src/pdg_types/pdgMarks.cmo src/slicing_types/slicingInternals.cmo src/slicing_types/slicingTypes.cmo src/memory_state/value_types.cmo src/kernel/db.cmo src/kernel/command.cmo src/kernel/task.cmo src/kernel/file.cmo src/logic/translate_lightweight.cmo src/kernel/unroll_loops.cmo src/misc/filter.cmo src/kernel/special_hooks.cmo src/logic/logic_interp.cmo src/logic/infer_annotations.cmo src/logic/allocates.cmo lib/plugins/Metrics.cmo lib/plugins/Syntactic_callgraph.cmo lib/plugins/Value.cmo lib/plugins/Occurrence.cmo lib/plugins/RteGen.cmo lib/plugins/From.cmo lib/plugins/Users.cmo lib/plugins/Constant_Propagation.cmo lib/plugins/Postdominators.cmo lib/plugins/Inout.cmo lib/plugins/Semantic_callgraph.cmo lib/plugins/Impact.cmo lib/plugins/Pdg.cmo lib/plugins/Scope.cmo lib/plugins/Sparecode.cmo lib/plugins/Slicing.cmo src/kernel/boot.cmo
/tmp/ccg2Te0Y.o:(.data+0x4529f0): undefined reference to `terminate_process'
/tmp/ccg2Te0Y.o:(.data+0x4529f4): undefined reference to `ml_usleep'
/tmp/ccg2Te0Y.o:(.data+0x4529f8): undefined reference to `getperfcount'
/tmp/ccg2Te0Y.o:(.data+0x4529fc): undefined reference to `getperfcount1024'
/tmp/ccg2Te0Y.o:(.data+0x452a00): undefined reference to `address_of_value'
/tmp/ccg2Te0Y.o:(.data+0x452a04): undefined reference to `set_round_nearest_even'
/tmp/ccg2Te0Y.o:(.data+0x452a08): undefined reference to `single_precision_of_string'
/tmp/ccg2Te0Y.o:(.data+0x452a0c): undefined reference to `round_to_float'
/tmp/ccg2Te0Y.o:(.data+0x452a10): undefined reference to `set_round_upward'
/tmp/ccg2Te0Y.o:(.data+0x452a14): undefined reference to `set_round_downward'
/tmp/ccg2Te0Y.o:(.data+0x452a18): undefined reference to `float_is_negative'
/tmp/ccg2Te0Y.o:(.data+0x452a1c): undefined reference to `float_compare_total'
src/buckx/buckx_c.o: In function `round_to_float(long)':
buckx_c.c:(.text+0x45): undefined reference to `caml_copy_double(double)'
src/buckx/buckx_c.o: In function `single_precision_of_string(long)':
buckx_c.c:(.text+0x180): undefined reference to `caml_string_length(long)'
buckx_c.c:(.text+0x194): undefined reference to `caml_copy_double(double)'
buckx_c.c:(.text+0x1a7): undefined reference to `caml_failwith(char const*)'
collect2: error: ld returned 1 exit status
File "_none_", line 1, characters 0-1:
Error: Error while building custom runtime system
make: *** [bin/toplevel.byte] Error 2
VERBOSEMAKE gives almost the same information.
I am trying to get OpenCv2.4.6 to work with QT5.1.0
I've followed this Guide so far Qt creator 5.0.1 with OpenCv 2.3.4 on windows
Unfortunatly after finishing trying out the sample Application(Display an Image using OpenCv in the QtCreator I get these Errors:
[Project-Path]\main.o:-1: In function `main':
[Project-Path]\main.cpp:8: error: undefined reference to `cv::imread(std::string const&, int)'
[Project-Path]\main.cpp:9: error: undefined reference to `cv::namedWindow(std::string const&, int)'
[Project-Path]\main.cpp:10: error: undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'
[Project-Path]\main.cpp:10: error: undefined reference to `cv::imshow(std::string const&, cv::_InputArray const&)'
[Project-Path]\main.cpp:11: error: undefined reference to `cv::waitKey(int)'
[Project Build Path Desktop Debug]\debug\main.o:-1: In function `ZN2cv3MatD1Ev':
[OpenCV/Install/include]\opencv2\core\mat.hpp:278: error: undefined reference to `cv::fastFree(void*)'
[Project Build Path Desktop Debug]\debug\main.o:-1: In function `ZN2cv3Mat7releaseEv':
[OpenCV/Install/include]\opencv2\core\mat.hpp:367: error: undefined reference to `cv::Mat::deallocate()'
collect2.exe:-1: error: error: ld returned 1 exit status
the "[]" Paths are my formatting and supposed to help keep track .
main.cpp
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace cv;
int main() {
// read an image
Mat image = imread("img.jpg");
namedWindow("My Image");
imshow("My Image", image);
waitKey(5000);
return 1;
}
myFirstOpenCVProject.pro
QT += core
QT -= gui
TARGET = myFirstOpenCVProject
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
INCLUDEPATH += C:/qt/OpenCV246_bin/install/include
LIBS += -LC:/qt/OpenCV246_bin/install/lib/lopencv_core246.dll
LIBS += -LC:/qt/OpenCV246_bin/install/lib/lopencv_highgui246.dll
LIBS += -LC:/qt/OpenCV246_bin/install/lib/lopencv_imgproc246.dll
LIBS += -LC:/qt/OpenCV246_bin/install/lib/lopencv_features2d246.dll
LIBS += -LC:/qt/OpenCV246_bin/install/lib/lopencv_calib3d246.dll
Can you help me resolve this?
I can't find any solutions that apply to my case ...
-L is to add directories to the search path. The actual libs are added via -l. The correct line would be:
LIBS += -LC:/qt/OpenCV246_bin/install/lib -llopencv_core246 -llopencv_highgui246 ...
I think you are missing the static libs of opencv:
opencv_core246.lib
opencv_highgui246.lib
opencv_video246.lib
opencv_ml26d.lib
opencv_legacy246.lib
opencv_imgproc246.lib
opencv_whatever.lib
Don t know the pro commands very well. Maybe something like:
LIBS += -Lc:/blabla/opencv_imgproc246.lib
Trying to play sound, via QSound (QT 5, Ubuntu 13.04)
The code:
#include <QtMultimedia/QSound>
void MainWindow::on_pushButton_2_clicked()
{
QSound::play("sounds/win.wav");
}
And getting 2 errors:
undefined reference to `QSound::play(QString const&)'
collect2: error: ld returned 1 exit status
What am i doing wrong ? In documentation here i see the same code.
You need to include the multimedia module. Add this to your .pro file:
QT += multimedia