I'm using robo robo simulator. It requires SDL to be installed. SDL was successfully installed using sudo apt-get install in Ubuntu
'make' was used to compile and link.
compilation was successful but while linking I got the following linker errors
[LD] roborobo
src/core/roborobo.o: In function `clean_up()':
roborobo.cpp:(.text+0x29): undefined reference to `SDL_FreeSurface'
roborobo.cpp:(.text+0x35): undefined reference to `SDL_FreeSurface'
roborobo.cpp:(.text+0x41): undefined reference to `SDL_FreeSurface'
roborobo.cpp:(.text+0x4d): undefined reference to `SDL_FreeSurface'
roborobo.cpp:(.text+0x59): undefined reference to `SDL_FreeSurface'
src/core/roborobo.o:roborobo.cpp:(.text+0x6a): more undefined references to `SDL_FreeSurface' follow
src/core/roborobo.o: In function `checkQuitEvent()':
roborobo.cpp:(.text+0xdff): undefined reference to `SDL_PollEvent'
src/core/roborobo.o: In function `handleKeyEvent(unsigned char*)':
roborobo.cpp:(.text+0xead): undefined reference to `SDL_Delay'
roborobo.cpp:(.text+0xf1a): undefined reference to `SDL_Delay'
roborobo.cpp:(.text+0xf43): undefined reference to `SDL_Delay'
roborobo.cpp:(.text+0x1037): undefined reference to `SDL_Delay'
roborobo.cpp:(.text+0x111e): undefined reference to `SDL_Delay'
src/core/roborobo.o:roborobo.cpp:(.text+0x1191): more undefined references to `SDL_Delay' follow
and many more
SDL_gfxPrimitives.c:(.text+0x7477): undefined reference to `SDL_UnlockSurface'
SDL_gfxPrimitives.c:(.text+0x7491): undefined reference to `SDL_UpperBlit'
SDL_gfxPrimitives.c:(.text+0x74e6): undefined reference to `SDL_CreateRGBSurface'
collect2: error: ld returned 1 exit status
make: [roborobo] Error 1 (ignored)
the make file also has sdl-config --cflags --libs -lSDL_image
the Makefile is in http://pastebin.com/5EdcZWAd
the entire console output after 'make' is in http://pastebin.com/yXDHR9xw
Related
I am finding trouble linking a library in C++.
I am trying for the first time to use "matplotlibcpp.h". This is a library that uses "Python.h"
My code is not using either of the libraries yet. It gives error just by including "matplotlibcpp". I am using python2.7 and Ubuntu 18.04 and am using Eclipse.
The code does not run if I include:
#include "matplotlibcpp.h" // programme runs if this is commented out. But I need it to add new features.
#include "Python.h"
I have added these paths in several futile attempts (they solved similar issues to other threads):
GCC C++ Compiler, include paths (-l)
/home/toni/Programs/Workspace/Libraries/matplotlib-cpp-master/
/usr/lib/python2.7/dist-packages/numpy/core/include/numpy
/usr/include/python2.7
GCC C++ Linker, Library search path (-L)
/home/toni/Programs/Workspace/Libraries/matplotlib-cpp-master/
/usr/lib/python2.7/config-i386-linux-gnu
/usr/lib/python2.7
/usr/include/python2.7
The programme builds, but does not run:
Finished building: ../src/WindProfilesCoursera.cpp
Building target: WindProfilesCoursera
Invoking: GCC C++ Linker
g++ -L/home/toni/Programs/Workspace/Libraries/matplotlib-cpp-master/ -L/usr/lib/python2.7/config-i386-linux-gnu -L/usr/lib/python2.7 -L/usr/include/python2.7 -o "WindProfilesCoursera" ./src/WindProfilesCoursera.o
./src/WindProfilesCoursera.o: In function `_import_array':
/usr/include/python2.7/numpy/__multiarray_api.h:1456: undefined reference to `PyImport_ImportModule'
makefile:45: recipe for target 'WindProfilesCoursera' failed
/usr/include/python2.7/numpy/__multiarray_api.h:1460: undefined reference to `PyExc_ImportError'
/usr/include/python2.7/numpy/__multiarray_api.h:1460: undefined reference to `PyErr_SetString'
/usr/include/python2.7/numpy/__multiarray_api.h:1463: undefined reference to `PyObject_GetAttrString'
/usr/include/python2.7/numpy/__multiarray_api.h:1466: undefined reference to `PyExc_AttributeError'
/usr/include/python2.7/numpy/__multiarray_api.h:1466: undefined reference to `PyErr_SetString'
/usr/include/python2.7/numpy/__multiarray_api.h:1478: undefined reference to `PyCObject_Type'
/usr/include/python2.7/numpy/__multiarray_api.h:1479: undefined reference to `PyExc_RuntimeError'
/usr/include/python2.7/numpy/__multiarray_api.h:1479: undefined reference to `PyErr_SetString'
/usr/include/python2.7/numpy/__multiarray_api.h:1483: undefined reference to `PyCObject_AsVoidPtr'
/usr/include/python2.7/numpy/__multiarray_api.h:1487: undefined reference to `PyExc_RuntimeError'
/usr/include/python2.7/numpy/__multiarray_api.h:1487: undefined reference to `PyErr_SetString'
/usr/include/python2.7/numpy/__multiarray_api.h:1493: undefined reference to `PyExc_RuntimeError'
/usr/include/python2.7/numpy/__multiarray_api.h:1493: undefined reference to `PyErr_Format'
/usr/include/python2.7/numpy/__multiarray_api.h:1499: undefined reference to `PyExc_RuntimeError'
/usr/include/python2.7/numpy/__multiarray_api.h:1499: undefined reference to `PyErr_Format'
/usr/include/python2.7/numpy/__multiarray_api.h:1511: undefined reference to `PyExc_RuntimeError'
/usr/include/python2.7/numpy/__multiarray_api.h:1511: undefined reference to `PyErr_Format'
/usr/include/python2.7/numpy/__multiarray_api.h:1522: undefined reference to `PyExc_RuntimeError'
/usr/include/python2.7/numpy/__multiarray_api.h:1522: undefined reference to `PyErr_Format'
collect2: error: ld returned 1 exit status
make: *** [WindProfilesCoursera] Error 1
"make all" terminated with exit code 2. Build might be incomplete.
20:35:04 Build Failed. 22 errors, 1 warnings. (took 2s.454ms)
I am using gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf on my ubuntu system using NetBeans IDE. My cross compiler is having libc-2.21 where as some of the libraries requires libc-2.28.And my target machine(debian jessie) do have libc-2.28 .
How can I upgrade it?
This is the error message I am getting after compiling in Netbeans:
/opt/crosstool/arm-linux-gnueabihf/bin/../arm-linux-gnueabihf/libc/usr/lib/libavutil.so.56: undefined reference to 'fcntl64#GLIBC_2.28'
/opt/crosstool/arm-linux-gnueabihf/bin/../arm-linux-gnueabihf/libc/usr/lib/libsystemd.so.0: undefined reference to 'getrandom#GLIBC_2.25'
/opt/crosstool/arm-linux-gnueabihf/bin/../arm-linux-gnueabihf/libc/usr/lib/libbellesip.so.0: undefined reference to 'fcntl#GLIBC_2.28'
/opt/crosstool/arm-linux-gnueabihf/bin/../arm-linux-gnueabihf/libc/usr/lib/libavcodec.so.58: undefined reference to 'powf#GLIBC_2.27'
/opt/crosstool/arm-linux-gnueabihf/bin/../arm-linux-gnueabihf/libc/usr/lib/libsystemd.so.0: undefined reference to 'reallocarray#GLIBC_2.26'
/opt/crosstool/arm-linux-gnueabihf/bin/../arm-linux-gnueabihf/libc/usr/lib/libmediastreamer_voip.so.10: undefined reference to 'expf#GLIBC_2.27'
/opt/crosstool/arm-linux-gnueabihf/bin/../arm-linux-gnueabihf/libc/usr/lib/libpulsecommon-12.2.so: undefined reference to 'memfd_create#GLIBC_2.27'
/opt/crosstool/arm-linux-gnueabihf/bin/../arm-linux-gnueabihf/libc/usr/lib/libavcodec.so.58: undefined reference to 'exp2f#GLIBC_2.27'
/opt/crosstool/arm-linux-gnueabihf/bin/../arm-linux-gnueabihf/libc/usr/lib/libavcodec.so.58: undefined reference to 'log2f#GLIBC_2.27'
/opt/crosstool/arm-linux-gnueabihf/bin/../arm-linux-gnueabihf/libc/usr/lib/libortp.so.13: undefined reference to 'logf#GLIBC_2.27'
collect2: error: ld returned 1 exit status
I am trying to compile a qt project with qtcurl using a statically built curl.
I am using the following to build a minimalist curl static library:
./configure --disable-shared --enable-static --prefix=/tmp/curl --disable-ldap --disable-sspi --without-librtmp --disable-ftp --disable-file --disable-dict --disable-telnet --disable-tftp --disable-rtsp --disable-pop3 --disable-imap --disable-smtp --disable-gopher --disable-smb --without-libidn --enable-ares
I am including
-L/tmp/curl/lib/libcurl.a
in the LIBS of the project, and
/tmp/curl/include
in the INCLUDEPATH
This is the output that I am getting:
QtCUrl.o: In function `QtCUrl::QtCUrl()':
QtCUrl.cpp:(.text+0x10d): undefined reference to `curl_easy_init'
QtCUrl.o: In function `QtCUrl::~QtCUrl()':
QtCUrl.cpp:(.text+0x32e): undefined reference to `curl_slist_free_all'
QtCUrl.cpp:(.text+0x355): undefined reference to `curl_easy_cleanup'
QtCUrl.o: In function `QtCUrl::setOptions(QHash<CURLoption, QVariant>&)':
QtCUrl.cpp:(.text+0xcee): undefined reference to `curl_easy_setopt'
QtCUrl.cpp:(.text+0xdac): undefined reference to `curl_easy_setopt'
QtCUrl.cpp:(.text+0xee9): undefined reference to `curl_slist_append'
QtCUrl.cpp:(.text+0xfe5): undefined reference to `curl_easy_setopt'
QtCUrl.cpp:(.text+0x1078): undefined reference to `curl_easy_setopt'
QtCUrl.cpp:(.text+0x109f): undefined reference to `curl_easy_setopt'
QtCUrl.cpp:(.text+0x1155): undefined reference to `curl_easy_setopt'
QtCUrl.cpp:(.text+0x1290): undefined reference to `curl_easy_setopt'
QtCUrl.o: In function `QtCUrl::exec(QHash<CURLoption, QVariant>&)':
QtCUrl.cpp:(.text+0x1f27): undefined reference to `curl_easy_perform'
QtCUrl.o: In function `curlGlobalInit()':
QtCUrl.cpp:(.text+0xa6): undefined reference to `curl_global_init'
collect2: error: ld returned 1 exit status
What am I missing here?
I have a project which i started building with QT5 but since other people in the company use QT4, I tried making it back compatible. I was able to get all the includes etc work right but there is a linking error I can't figure out.
The error is :
compiling gen/Release/obj/qrc_map_markup_gui.cpp
linking bin/visual_route_generationmap_markup_gui
/usr/bin/ld: warning: libicui18n.so.49, needed by /other/Qt5.0.1/5.0.1/gcc_64/lib/libQt5Core.so.5, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libicuuc.so.49, needed by /other/Qt5.0.1/5.0.1/gcc_64/lib/libQt5Core.so.5, not found (try using -rpath or -rpath-link)
/other/Qt5.0.1/5.0.1/gcc_64/lib/libQt5Core.so.5: undefined reference to `ucnv_compareNames_49'
/other/Qt5.0.1/5.0.1/gcc_64/lib/libQt5Core.so.5: undefined reference to `ucol_close_49'
/other/Qt5.0.1/5.0.1/gcc_64/lib/libQt5Core.so.5: undefined reference to `ucol_setAttribute_49'
/other/Qt5.0.1/5.0.1/gcc_64/lib/libQt5Core.so.5: undefined reference to `ucnv_toUnicode_49'
/other/Qt5.0.1/5.0.1/gcc_64/lib/libQt5Core.so.5: undefined reference to `ures_getStringByKey_49'
/other/Qt5.0.1/5.0.1/gcc_64/lib/libQt5Core.so.5: undefined reference to `u_strToUpper_49'
/other/Qt5.0.1/5.0.1/gcc_64/lib/libQt5Core.so.5: undefined reference to `ucnv_countAvailable_49'
/other/Qt5.0.1/5.0.1/gcc_64/lib/libQt5Core.so.5: undefined reference to `ucol_open_49'
/other/Qt5.0.1/5.0.1/gcc_64/lib/libQt5Core.so.5: undefined reference to `u_strToLower_49'
/other/Qt5.0.1/5.0.1/gcc_64/lib/libQt5Core.so.5: undefined reference to `ucnv_getDefaultName_49'
/other/Qt5.0.1/5.0.1/gcc_64/lib/libQt5Core.so.5: undefined reference to `ucnv_getStandardName_49'
/other/Qt5.0.1/5.0.1/gcc_64/lib/libQt5Core.so.5: undefined reference to `ucol_getAttribute_49'
/other/Qt5.0.1/5.0.1/gcc_64/lib/libQt5Core.so.5: undefined reference to `ucnv_countAliases_49'
/other/Qt5.0.1/5.0.1/gcc_64/lib/libQt5Core.so.5: undefined reference to `ures_open_49'
/other/Qt5.0.1/5.0.1/gcc_64/lib/libQt5Core.so.5: undefined reference to `ures_close_49'
/other/Qt5.0.1/5.0.1/gcc_64/lib/libQt5Core.so.5: undefined reference to `ucnv_close_49'
/other/Qt5.0.1/5.0.1/gcc_64/lib/libQt5Core.so.5: undefined reference to `ucol_strcoll_49'
/other/Qt5.0.1/5.0.1/gcc_64/lib/libQt5Core.so.5: undefined reference to `ucnv_setSubstChars_49'
/other/Qt5.0.1/5.0.1/gcc_64/lib/libQt5Core.so.5: undefined reference to `ucnv_fromUnicode_49'
/other/Qt5.0.1/5.0.1/gcc_64/lib/libQt5Core.so.5: undefined reference to `ucnv_getAvailableName_49'
/other/Qt5.0.1/5.0.1/gcc_64/lib/libQt5Core.so.5: undefined reference to `ucnv_getAlias_49'
/other/Qt5.0.1/5.0.1/gcc_64/lib/libQt5Core.so.5: undefined reference to `ucol_getSortKey_49'
/other/Qt5.0.1/5.0.1/gcc_64/lib/libQt5Core.so.5: undefined reference to `ucnv_getMaxCharSize_49'
/other/Qt5.0.1/5.0.1/gcc_64/lib/libQt5Core.so.5: undefined reference to `ucnv_open_49'
/other/Qt5.0.1/5.0.1/gcc_64/lib/libQt5Core.so.5: undefined reference to `u_errorName_49'
collect2: ld returned 1 exit status
make[1]: *** [bin/visual_route_generationmap_markup_gui] Error 1
make[1]: Leaving directory `/lucid/other/workspace/perception/visual_route_generation/map_markup_gui'
make: *** [release-all] Error 2
==================================================================================
Its still trying to use QT5 libraries. I have removed all the set variables from .bashrc.
How do I make the pro files look only for qt4 libs ?
I am driving nuts....
I'm working on a program to read out Joint Coordinates from an Xtion Primesense sensor with OpenNI and NiTE. I got the program splittet in 3 parts. Main, sensorOpenNI.hpp and sensorOpenNI.cpp. Now while linking the parts together I get lots of errors saying there are undefined references to some NiTE functions. I'm working with Kubuntu and g++. The NiTE and OpenNI libs are in a directory called Include...
Here's the error message:
/tmp/ccrPQHEg.o: In function openni::VideoFrameRef::release()':
sensorOpenNI.cpp:(.text._ZN6openni13VideoFrameRef7releaseEv[openni::VideoFrameRef::release()]+0x18): undefined reference tooniFrameRelease'
/tmp/ccrPQHEg.o: In function openni::VideoFrameRef::_setFrame(OniFrame*)':
sensorOpenNI.cpp:(.text._ZN6openni13VideoFrameRef9_setFrameEP8OniFrame[openni::VideoFrameRef::_setFrame(OniFrame*)]+0x25): undefined reference tooniFrameAddRef'
/tmp/ccrPQHEg.o: In function nite::UserTrackerFrameRef::release()':
sensorOpenNI.cpp:(.text._ZN4nite19UserTrackerFrameRef7releaseEv[nite::UserTrackerFrameRef::release()]+0x24): undefined reference toniteUserTrackerFrameRelease'
/tmp/ccrPQHEg.o: In function nite::UserTracker::create(openni::Device*)':
sensorOpenNI.cpp:(.text._ZN4nite11UserTracker6createEPN6openni6DeviceE[nite::UserTracker::create(openni::Device*)]+0x13): undefined reference toniteInitializeUserTracker'
sensorOpenNI.cpp:(.text._ZN4nite11UserTracker6createEPN6openni6DeviceE[nite::UserTracker::create(openni::Device*)]+0x27): undefined reference to niteInitializeUserTrackerByDevice'
/tmp/ccrPQHEg.o: In functionnite::UserTracker::destroy()':
sensorOpenNI.cpp:(.text._ZN4nite11UserTracker7destroyEv[nite::UserTracker::destroy()]+0x1e): undefined reference to niteShutdownUserTracker'
/tmp/ccrPQHEg.o: In functionnite::UserTracker::readFrame(nite::UserTrackerFrameRef*)':
sensorOpenNI.cpp:(.text._ZN4nite11UserTracker9readFrameEPNS_19UserTrackerFrameRefE[nite::UserTracker::readFrame(nite::UserTrackerFrameRef*)]+0x1d): undefined reference to niteReadUserTrackerFrame'
/tmp/ccrPQHEg.o: In functionnite::UserTracker::startSkeletonTracking(short)':
sensorOpenNI.cpp:(.text._ZN4nite11UserTracker21startSkeletonTrackingEs[nite::UserTracker::startSkeletonTracking(short)]+0x1e): undefined reference to niteStartSkeletonTracking'
/tmp/ccrPQHEg.o: In functionnite::NiTE::initialize()':
sensorOpenNI.cpp:(.text._ZN4nite4NiTE10initializeEv[nite::NiTE::initialize()]+0x7): undefined reference to niteInitialize'
collect2: ld returned 1 exit status
patrick#ubuntu:~/Koerpersteuerung$ g++ -c sensorOpenNI.cpp sensorOpenNI.hpp -I Include/
patrick#ubuntu:~/Koerpersteuerung$ g++ mainSensor.cpp sensorOpenNI.o -I Include/
sensorOpenNI.o: In functionopenni::VideoFrameRef::release()':
sensorOpenNI.cpp:(.text._ZN6openni13VideoFrameRef7releaseEv[openni::VideoFrameRef::release()]+0x18): undefined reference to oniFrameRelease'
sensorOpenNI.o: In functionopenni::VideoFrameRef::_setFrame(OniFrame*)':
sensorOpenNI.cpp:(.text._ZN6openni13VideoFrameRef9_setFrameEP8OniFrame[openni::VideoFrameRef::_setFrame(OniFrame*)]+0x25): undefined reference to oniFrameAddRef'
sensorOpenNI.o: In functionnite::UserTrackerFrameRef::release()':
sensorOpenNI.cpp:(.text._ZN4nite19UserTrackerFrameRef7releaseEv[nite::UserTrackerFrameRef::release()]+0x24): undefined reference to niteUserTrackerFrameRelease'
sensorOpenNI.o: In functionnite::UserTracker::create(openni::Device*)':
sensorOpenNI.cpp:(.text._ZN4nite11UserTracker6createEPN6openni6DeviceE[nite::UserTracker::create(openni::Device*)]+0x13): undefined reference to niteInitializeUserTracker'
sensorOpenNI.cpp:(.text._ZN4nite11UserTracker6createEPN6openni6DeviceE[nite::UserTracker::create(openni::Device*)]+0x27): undefined reference toniteInitializeUserTrackerByDevice'
sensorOpenNI.o: In function nite::UserTracker::destroy()':
sensorOpenNI.cpp:(.text._ZN4nite11UserTracker7destroyEv[nite::UserTracker::destroy()]+0x1e): undefined reference toniteShutdownUserTracker'
sensorOpenNI.o: In function nite::UserTracker::readFrame(nite::UserTrackerFrameRef*)':
sensorOpenNI.cpp:(.text._ZN4nite11UserTracker9readFrameEPNS_19UserTrackerFrameRefE[nite::UserTracker::readFrame(nite::UserTrackerFrameRef*)]+0x1d): undefined reference toniteReadUserTrackerFrame'
sensorOpenNI.o: In function nite::UserTracker::startSkeletonTracking(short)':
sensorOpenNI.cpp:(.text._ZN4nite11UserTracker21startSkeletonTrackingEs[nite::UserTracker::startSkeletonTracking(short)]+0x1e): undefined reference toniteStartSkeletonTracking'
sensorOpenNI.o: In function nite::NiTE::initialize()':
sensorOpenNI.cpp:(.text._ZN4nite4NiTE10initializeEv[nite::NiTE::initialize()]+0x7): undefined reference toniteInitialize'
collect2: ld returned 1 exit status
I'm calling g++ like this:
g++ -o test mainSensor.cpp sensorOpenNI.cpp -I Include/
Try copying the libraries libOpenNI2.so and libNiTE2 like that:
sudo cp ./OpenNI-Linux-x86-2.2/Redist/libOpenNI2.so /usr/local/lib
sudo cp ./NiTE-Linux-x86-2.2/Redist/libNiTE2.so /usr/local/lib
then do
sudo ldconfig
and now compile the program by adding -lOpenNI2 -lNiTE2