I am getting below linker errors while building Qt for embedded ARM linux platform, Any ideas what can be the reason? or How to solve it?
.obj/release-shared-emb-arm/qtconcurrentiteratekernel.o: In function
getticks()': qtconcurrentiteratekernel.cpp:(.text+0x60): undefined
reference toclock_gettime'
.obj/release-shared-emb-arm/qthread_unix.o: In function
set_thread_data(QThreadData*)': qthread_unix.cpp:(.text+0x40):
undefined reference to__tls_get_addr'
.obj/release-shared-emb-arm/qthread_unix.o: In function
QThreadData::current()': qthread_unix.cpp:(.text+0x37c): undefined
reference to__tls_get_addr' .obj/release-shared-emb-arm/qresource.o:
In function QDynamicFileResourceRoot::registerSelf(QString const&)':
qresource.cpp:(.text._ZN24QDynamicFileResourceRoot12registerSelfERK7QString[QDynamicFileResourceRoot::registerSelf(QString
const&)]+0x88): undefined reference tofstat'
.obj/release-shared-emb-arm/qfilesystemengine.o: In function
QFileSystemEngine::fillMetaData(int, QFileSystemMetaData&)':
qfilesystemengine.cpp:(.text+0x490): undefined reference tofstat'
.obj/release-shared-emb-arm/qfilesystemengine_unix.o: In function
QFileSystemEngine::currentPath()':
qfilesystemengine_unix.cpp:(.text+0x34): undefined reference tostat'
.obj/release-shared-emb-arm/qfilesystemengine_unix.o: In function
QFileSystemEngine::removeDirectory(QFileSystemEntry const&, bool)':
qfilesystemengine_unix.cpp:(.text+0x3bc): undefined reference to
stat' .obj/release-shared-emb-arm/qfilesystemengine_unix.o: In
function QFileSystemEngine::createDirectory(QFileSystemEntry const&,
bool)': qfilesystemengine_unix.cpp:(.text+0x5c4): undefined reference
tostat' .obj/release-shared-emb-arm/qfilesystemengine_unix.o: In
function QFileSystemEngine::fillMetaData(QFileSystemEntry const&,
QFileSystemMetaData&, QFlags<QFileSystemMetaData::MetaDataFlag>)':
qfilesystemengine_unix.cpp:(.text+0xda4): undefined reference to
lstat' qfilesystemengine_unix.cpp:(.text+0xe34): undefined reference
to stat' .obj/release-shared-emb-arm/qtranslator.o: In function
QTranslatorPrivate::do_load(QString const&)':
qtranslator.cpp:(.text+0x1730): undefined reference to `fstat'
collect2: ld returned 1 exit status make[1]: *
[../../lib/libQtCore.so.4.8.0] Error 1
It seems like there's something wrong with your toolchain or qmake.conf. Try to manually link to libc and to rt library either in your qmake.conf or in the configure using -l and -L: http://doc.qt.nokia.com/stable/configure-options.html.
Related
I am compiling lua using ARM GCC on ARM A53, and during link I get quit a lot error related to math library, for example:
/home/bruce/data/code/star2000e/3rdparty/lua/lua-5.3.5/src/lmathlib.c:71: undefined reference to `acos'
/ux/cad/tools/ARM/gcc-arm-9.2-2019.12-x86_64-aarch64-none-elf/bin/../lib/gcc/aarch64-none-elf/9.2.1/../../../../aarch64-none-elf/bin/ld: 3rdparty/lua/liblua.a(lmathlib.c.o): in function `math_atan':
/home/bruce/data/code/star2000e/3rdparty/lua/lua-5.3.5/src/lmathlib.c:78: undefined reference to `atan2'
/ux/cad/tools/ARM/gcc-arm-9.2-2019.12-x86_64-aarch64-none-elf/bin/../lib/gcc/aarch64-none-elf/9.2.1/../../../../aarch64-none-elf/bin/ld: 3rdparty/lua/liblua.a(lmathlib.c.o): in function `math_floor':
/home/bruce/data/code/star2000e/3rdparty/lua/lua-5.3.5/src/lmathlib.c:109: undefined reference to `floor'
/ux/cad/tools/ARM/gcc-arm-9.2-2019.12-x86_64-aarch64-none-elf/bin/../lib/gcc/aarch64-none-elf/9.2.1/../../../../aarch64-none-elf/bin/ld: 3rdparty/lua/liblua.a(lmathlib.c.o): in function `math_ceil':
/home/bruce/data/code/star2000e/3rdparty/lua/lua-5.3.5/src/lmathlib.c:120: undefined reference to `ceil'
/ux/cad/tools/ARM/gcc-arm-9.2-2019.12-x86_64-aarch64-none-elf/bin/../lib/gcc/aarch64-none-elf/9.2.1/../../../../aarch64-none-elf/bin/ld: 3rdparty/lua/liblua.a(lmathlib.c.o): in function `math_fmod':
/home/bruce/data/code/star2000e/3rdparty/lua/lua-5.3.5/src/lmathlib.c:138: undefined reference to `fmod'
/ux/cad/tools/ARM/gcc-arm-9.2-2019.12-x86_64-aarch64-none-elf/bin/../lib/gcc/aarch64-none-elf/9.2.1/../../../../aarch64-none-elf/bin/ld: 3rdparty/lua/liblua.a(lmathlib.c.o): in function `math_modf':
/home/bruce/data/code/star2000e/3rdparty/lua/lua-5.3.5/src/lmathlib.c:157: undefined reference to `ceil'
/ux/cad/tools/ARM/gcc-arm-9.2-2019.12-x86_64-aarch64-none-elf/bin/../lib/gcc/aarch64-none-elf/9.2.1/../../../../aarch64-none-elf/bin/ld: /home/bruce/data/code/star2000e/3rdparty/lua/lua-5.3.5/src/lmathlib.c:157: undefined reference to `floor'
/ux/cad/tools/ARM/gcc-arm-9.2-2019.12-x86_64-aarch64-none-elf/bin/../lib/gcc/aarch64-none-elf/9.2.1/../../../../aarch64-none-elf/bin/ld: 3rdparty/lua/liblua.a(lmathlib.c.o): in function `math_sqrt':
/home/bruce/data/code/star2000e/3rdparty/lua/lua-5.3.5/src/lmathlib.c:167: undefined reference to `sqrt'
/ux/cad/tools/ARM/gcc-arm-9.2-2019.12-x86_64-aarch64-none-elf/bin/../lib/gcc/aarch64-none-elf/9.2.1/../../../../aarch64-none-elf/bin/ld: 3rdparty/lua/liblua.a(lmathlib.c.o): in function `math_log':
/home/bruce/data/code/star2000e/3rdparty/lua/lua-5.3.5/src/lmathlib.c:183: undefined reference to `log'
I DO add '-lm' option during link, and I can find two libm.a find in the compiler home, at:
/ux/cad/tools/ARM/gcc-arm-9.2-2019.12-x86_64-aarch64-none-elf/./aarch64-none-elf/lib/libm.a
/ux/cad/tools/ARM/gcc-arm-9.2-2019.12-x86_64-aarch64-none-elf/./aarch64-none-elf/lib/ilp32/libm.a
Below is the link command (I use CMAKE, link command is generated by CMAKE):
/ux/cad/tools/ARM/gcc-arm-9.2-2019.12-x86_64-aarch64-none-elf/bin/aarch64-none-elf-gcc -g -nostartfiles -T /home/bruce/data/code/star2000e/project/star2000e/src/link_new.ld -Wl,-Map=star2000e.map -Wl,--gc-sections -specs=nosys.specs -Wl,-cref -lm CMakeFiles/star2000e.elf.dir/project/star2000e/src/boot_el1.s.o CMakeFiles/star2000e.elf.dir/project/star2000e/src/main_star2000e.c.o CMakeFiles/star2000e.elf.dir/project/star2000e/src/newlib_port.c.o CMakeFiles/star2000e.elf.dir/project/star2000e/src/vectors.c.o -o star2000e.elf sys/libsys.a 3rdparty/cmocka/libcmocka.a core/libcore.a bsp/board_v2/libbsp.a -lm sys/libsys.a core/lib/littlefs/liblittlefs.a 3rdparty/json/libjson.a 3rdparty/lua/liblua.a 3rdparty/sfud/libsfud.a bsp/board_v2/libbsp.a 3rdparty/sfud/libsfud.a driver/star2000_soc/libdriver_star2000.a arch/arm_a55/libcpu_arm.a
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 using an esp8266 together with platformio to write a simple sketch.
#include <sstream>
#include <Arduino.h>
std::stringstream s;
void setup()
{
Serial.begin(9600);
Serial.println("Test");
}
void loop()
{
}
Everything should be setup correctly and most sketches worked without issues.
But as soon as I try to use stringstreams I get errors when platformio is linking the firmware.
platformio run
[12/29/16 12:11:32] Processing esp12e (platform: espressif8266, board: nodemcu, framework: arduino)
Verbose mode can be enabled via `-v, --verbose` option
Collected 23 compatible libraries
Looking for dependencies...
Project does not have dependencies
Linking .pioenvs\esp12e\firmware.elf
c:/users/simon/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .pioenvs\esp12e\firmware.elf section `.text' will not fit in region `iram1_0_seg'
C:\users\simon\.platformio\packages\framework-arduinoespressif8266\tools\sdk\lib\libstdc++.a(locale-inst.o):(.literal._ZSt16__convert_from_vRKPiPciPKcz[_ZSt16__convert_from_vRKPiPciPKcz]+0x4): undefined reference to `setlo
cale'
C:\users\simon\.platformio\packages\framework-arduinoespressif8266\tools\sdk\lib\libstdc++.a(locale-inst.o):(.literal._ZSt16__convert_from_vRKPiPciPKcz[_ZSt16__convert_from_vRKPiPciPKcz]+0xc): undefined reference to `vspri
ntf'
C:\users\simon\.platformio\packages\framework-arduinoespressif8266\tools\sdk\lib\libstdc++.a(locale-inst.o):(.literal._ZSt9use_facetISt5ctypeIcEERKT_RKSt6locale[_ZSt9use_facetISt5ctypeIcEERKT_RKSt6locale]+0x4): undefined r
eference to `std::__throw_bad_cast()'
C:\users\simon\.platformio\packages\framework-arduinoespressif8266\tools\sdk\lib\libstdc++.a(locale-inst.o):(.literal._ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE15_M_insert_floatIdEES3_S3_RSt8ios_baseccT_
[_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE15_M_insert_floatIdEES3_S3_RSt8ios_baseccT_]+0x0): undefined reference to `memchr'
C:\users\simon\.platformio\packages\framework-arduinoespressif8266\tools\sdk\lib\libstdc++.a(locale-inst.o): In function `std::__convert_from_v(int* const&, char*, int, char const*, ...)':
/Users/igrokhotkov/e/ESPTools/crosstool-NG/.build/xtensa-lx106-elf/build/build-cc-gcc-final/xtensa-lx106-elf/libstdc++-v3/include/bits/locale_classes.tcc:114: undefined reference to `setlocale'
/Users/igrokhotkov/e/ESPTools/crosstool-NG/.build/xtensa-lx106-elf/build/build-cc-gcc-final/xtensa-lx106-elf/libstdc++-v3/include/bits/locale_classes.tcc:114: undefined reference to `setlocale'
/Users/igrokhotkov/e/ESPTools/crosstool-NG/.build/xtensa-lx106-elf/build/build-cc-gcc-final/xtensa-lx106-elf/libstdc++-v3/include/bits/locale_classes.tcc:114: undefined reference to `vsprintf'
/Users/igrokhotkov/e/ESPTools/crosstool-NG/.build/xtensa-lx106-elf/build/build-cc-gcc-final/xtensa-lx106-elf/libstdc++-v3/include/bits/locale_classes.tcc:114: undefined reference to `setlocale'
C:\users\simon\.platformio\packages\framework-arduinoespressif8266\tools\sdk\lib\libstdc++.a(locale-inst.o): In function `std::ctype<char> const& std::use_facet<std::ctype<char> >(std::locale const&)':
/Users/igrokhotkov/e/ESPTools/crosstool-NG/.build/xtensa-lx106-elf/build/build-cc-gcc-final/xtensa-lx106-elf/libstdc++-v3/include/bits/locale_classes.tcc:114: undefined reference to `std::__throw_bad_cast()'
C:\users\simon\.platformio\packages\framework-arduinoespressif8266\tools\sdk\lib\libstdc++.a(locale-inst.o): In function `std::numpunct<char> const& std::use_facet<std::numpunct<char> >(std::locale const&)':
/Users/igrokhotkov/e/ESPTools/crosstool-NG/.build/xtensa-lx106-elf/build/build-cc-gcc-final/xtensa-lx106-elf/libstdc++-v3/include/bits/locale_classes.tcc:114: undefined reference to `std::__throw_bad_cast()'
C:\users\simon\.platformio\packages\framework-arduinoespressif8266\tools\sdk\lib\libstdc++.a(locale-inst.o): In function `std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > > const& std::use_facet<s
td::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > > >(std::locale const&)':
/Users/igrokhotkov/e/ESPTools/crosstool-NG/.build/xtensa-lx106-elf/build/build-cc-gcc-final/xtensa-lx106-elf/libstdc++-v3/include/bits/locale_classes.tcc:114: undefined reference to `std::__throw_bad_cast()'
C:\users\simon\.platformio\packages\framework-arduinoespressif8266\tools\sdk\lib\libstdc++.a(locale-inst.o): In function `std::num_get<char, std::istreambuf_iterator<char, std::char_traits<char> > > const& std::use_facet<s
td::num_get<char, std::istreambuf_iterator<char, std::char_traits<char> > > >(std::locale const&)':
/Users/igrokhotkov/e/ESPTools/crosstool-NG/.build/xtensa-lx106-elf/build/build-cc-gcc-final/xtensa-lx106-elf/libstdc++-v3/include/bits/locale_classes.tcc:114: undefined reference to `std::__throw_bad_cast()'
C:\users\simon\.platformio\packages\framework-arduinoespressif8266\tools\sdk\lib\libstdc++.a(locale-inst.o): In function `std::moneypunct<char, true> const& std::use_facet<std::moneypunct<char, true> >(std::locale const&)'
:
/Users/igrokhotkov/e/ESPTools/crosstool-NG/.build/xtensa-lx106-elf/build/build-cc-gcc-final/xtensa-lx106-elf/libstdc++-v3/include/bits/locale_classes.tcc:114: undefined reference to `std::__throw_bad_cast()'
C:\users\simon\.platformio\packages\framework-arduinoespressif8266\tools\sdk\lib\libstdc++.a(locale-inst.o):/Users/igrokhotkov/e/ESPTools/crosstool-NG/.build/xtensa-lx106-elf/build/build-cc-gcc-final/xtensa-lx106-elf/libst
dc++-v3/include/bits/locale_classes.tcc:114: more undefined references to `std::__throw_bad_cast()' follow
C:\users\simon\.platformio\packages\framework-arduinoespressif8266\tools\sdk\lib\libstdc++.a(locale-inst.o): In function `std::ostreambuf_iterator<char, std::char_traits<char> > std::num_put<char, std::ostreambuf_iterator<
char, std::char_traits<char> > >::_M_insert_float<double>(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, char, double) const':
/Users/igrokhotkov/e/ESPTools/crosstool-NG/.build/xtensa-lx106-elf/build/build-cc-gcc-final/xtensa-lx106-elf/libstdc++-v3/include/bits/locale_classes.tcc:114: undefined reference to `memchr'
C:\users\simon\.platformio\packages\framework-arduinoespressif8266\tools\sdk\lib\libstdc++.a(locale-inst.o): In function `std::ostreambuf_iterator<char, std::char_traits<char> > std::num_put
A lot more similar errors
----------
collect2.exe: error: ld returned 1 exit status
*** [.pioenvs\esp12e\firmware.elf] Error 1
[ERROR] Took 8.38 seconds
I am quite new to platformio and programming the esp but maybe some of you encountered a similar issue or got clues from the console log. Could you help me fix these errors?
As far as I know, you cannot easily include sstream in your project nor most other C++ libraries.
Arduino has his own libraries, I advice you to take a closer look to the String documentation as it might already provide the functionality you need in your project.
There are some C++ library ports out there for Arduino, including a StringStream port that --theoretically speaking-- you could use.
There are also ports of C libraries, but I honestly don't know what is the state of advancement/reliability of these libraries.
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.
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