Trying to build TD:
https://github.com/tdlib/td
https://github.com/tdlib/td/tree/master/example/java
The main build works fine, but the Java examples do not.
My setup :
Ubuntu 18.04.2 LTS
cmake 3.10.2
gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
OpenSSL 1.1.1 11 Sep 2018
1:1.2.11.dfsg-0ubuntu2
gperf 3.1-1
After 30 minutes or so CMake spits this out.. any ideas what it means and where I can go from here?
Game.cpp:(.text._ZNK2td4Game15get_game_objectEPNS_2TdE+0xc8): undefined reference to vtable for td::td_api::formattedText' Game.cpp:(.text._ZNK2td4Game15get_game_objectEPNS_2TdE+0xeb): undefined reference to vtable for td::td_api::textEntity'
Game.cpp:(.text._ZNK2td4Game15get_game_objectEPNS_2TdE+0x15d): undefined reference to vtable for td::td_api::photo' Game.cpp:(.text._ZNK2td4Game15get_game_objectEPNS_2TdE+0x190): undefined reference to vtable for td::td_api::photoSize'
Game.cpp:(.text._ZNK2td4Game15get_game_objectEPNS_2TdE+0x1ab): undefined reference to vtable for td::td_api::file' Game.cpp:(.text._ZNK2td4Game15get_game_objectEPNS_2TdE+0x1c3): undefined reference to vtable for td::td_api::remoteFile'
Game.cpp:(.text._ZNK2td4Game15get_game_objectEPNS_2TdE+0x201): undefined reference to vtable for td::td_api::localFile' Game.cpp:(.text._ZNK2td4Game15get_game_objectEPNS_2TdE+0x29a): undefined reference to vtable for td::td_api::animation'
Game.cpp:(.text._ZNK2td4Game15get_game_objectEPNS_2TdE+0x2b5): undefined reference to vtable for td::td_api::file' Game.cpp:(.text._ZNK2td4Game15get_game_objectEPNS_2TdE+0x2ce): undefined reference to vtable for td::td_api::remoteFile'
Game.cpp:(.text._ZNK2td4Game15get_game_objectEPNS_2TdE+0x305): undefined reference to vtable for td::td_api::localFile' Game.cpp:(.text._ZNK2td4Game15get_game_objectEPNS_2TdE+0x34c): undefined reference to vtable for td::td_api::photoSize'
Game.cpp:(.text._ZNK2td4Game15get_game_objectEPNS_2TdE+0x369): undefined reference to vtable for td::td_api::file' Game.cpp:(.text._ZNK2td4Game15get_game_objectEPNS_2TdE+0x380): undefined reference to vtable for td::td_api::remoteFile'
Game.cpp:(.text._ZNK2td4Game15get_game_objectEPNS_2TdE+0x3b6): undefined reference to vtable for td::td_api::localFile' libtdcore.a(Game.cpp.o): In function td::process_input_message_game(td::ContactsManager const*, td::tl::unique_ptrtd::td_api::InputMessageContent&&)':
Game.cpp:(.text._ZN2td26process_input_message_gameEPKNS_15ContactsManagerEONS_2tl10unique_ptrINS_6td_api19InputMessageContentEEE+0xbc): undefined reference to `vtable for td::td_api::inputMessageGame'
collect2: error: ld returned 1 exit status
make[2]: *** [tg_cli] Error 1
make[1]: *** [CMakeFiles/tg_cli.dir/all] Error 2
make: *** [all] Error 2
What does undefined reference to vtable mean? Did I forget to compile something else first? or in a wrong folder?
I must have messed up a path somewhere . I deleted the folder, cloned it again and follows the steps in this tool:
https://tdlib.github.io/td/build.html?language=Java
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
When attempting to compile synergy 1.4.16 on a Mint 17.1 (Rebecca) I get the following error:
../../../../../lib/libarch.a(CArchMultithreadPosix.o): In function `CArchMultithreadPosix::newMutex()':
CArchMultithreadPosix.cpp:(.text+0x319): undefined reference to `pthread_mutexattr_init'
../../../../../lib/libarch.a(CArchMultithreadPosix.o): In function `CArchMultithreadPosix::raiseSignal(IArchMultithread::ESignal)':
CArchMultithreadPosix.cpp:(.text+0x43b): undefined reference to `pthread_kill'
../../../../../lib/libarch.a(CArchMultithreadPosix.o): In function `CArchMultithreadPosix::threadSignalHandler(void*)':
CArchMultithreadPosix.cpp:(.text+0x490): undefined reference to `pthread_detach'
../../../../../lib/libarch.a(CArchMultithreadPosix.o): In function `CArchMultithreadPosix::closeThread(CArchThreadImpl*)':
CArchMultithreadPosix.cpp:(.text+0x62b): undefined reference to `pthread_detach'
../../../../../lib/libarch.a(CArchMultithreadPosix.o): In function `CArchMultithreadPosix::newThread(void* (*)(void*), void*)':
CArchMultithreadPosix.cpp:(.text+0x8e6): undefined reference to `pthread_sigmask'
CArchMultithreadPosix.cpp:(.text+0x90f): undefined reference to `pthread_sigmask'
CArchMultithreadPosix.cpp:(.text+0x935): undefined reference to `pthread_create'
CArchMultithreadPosix.cpp:(.text+0x9a4): undefined reference to `pthread_create'
../../../../../lib/libarch.a(CArchMultithreadPosix.o): In function `CArchMultithreadPosix::CArchMultithreadPosix()':
CArchMultithreadPosix.cpp:(.text+0xe11): undefined reference to `pthread_mutexattr_init'
CArchMultithreadPosix.cpp:(.text+0xf05): undefined reference to `pthread_sigmask'
CArchMultithreadPosix.cpp:(.text+0xf26): undefined reference to `pthread_sigmask'
../../../../../lib/libarch.a(CArchMultithreadPosix.o): In function `CArchMultithreadPosix::startSignalHandler()':
CArchMultithreadPosix.cpp:(.text+0x10a8): undefined reference to `pthread_sigmask'
CArchMultithreadPosix.cpp:(.text+0x10cd): undefined reference to `pthread_sigmask'
CArchMultithreadPosix.cpp:(.text+0x1104): undefined reference to `pthread_create'
../../../../../lib/libarch.a(CArchMultithreadPosix.o): In function `CArchMultithreadPosix::cancelThread(CArchThreadImpl*)':
CArchMultithreadPosix.cpp:(.text+0x5e3): undefined reference to `pthread_kill'
collect2: error: ld returned 1 exit status
make[2]: *** [../../bin/synergyd] Error 1
make[1]: *** [src/cmd/synergyd/CMakeFiles/synergyd.dir/all] Error 2
make: *** [all] Error 2
Going back to: /home/jussi/Downloads/synergy-1.4.16/synergy-1.4.16-Source
Error: make failed: 512
I already tried the solution to the identical problem here but the solution of adding pthreadto the end of target_link_libraries on src/cmd/synergyd/CMakeLists.txt does not resolve my issue, it remains the same.
The only reason I'm not using pre-compiled packages is that I need to use synergy with my Raspberry Pi 3 and the packages available through the packge repos have incompatible synergy protocols - 1.4.16 on Pi vs 1.4.12 on Mint 17.1 so an alternative solution to have compatible protocols on each of the machines will also be sufficient.
Setting CMAKE_CXX_FLAGS after project definition in CMakeList.txt made it to work for me:
First, declare project (important for prerequisite checks).
project(synergy C CXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++03 -pthread")
Identified an alternative solution: I worked my way around this by (ab?)using the fact that the synergy server with higher protocol version seems to be backwards-compatible with older protocol versions, so I compiled the version 1.8.something and the client on my Pi with 1.4.16 is happy to connect and I can now share the keyboard and mouse connected to my Mint with the Pi.
I am trying to embed python in c++. I am not able to compile some c++ code that uses Python.h. I get an error that seems to be the library is not referenced correctly.
Below is the error shown which I received:
/tmp/ccxiQ8eE.o:(.data+0xc4): undefined reference to Py_NoopCmd(_object*, _object*)'
/tmp/ccxiQ8eE.o:(.data+0xd4): undefined reference toPy_FilterPalletteCmd(_object*, _object*)'
/tmp/ccxiQ8eE.o:(.data+0xe4): undefined reference to Py_FilterCmd(_object*, _object*)'
/tmp/ccxiQ8eE.o:(.data+0xf4): undefined reference toPy_CaptureCmd(_object*, _object*)'
/tmp/ccxiQ8eE.o:(.data+0x104): undefined reference to Py_CaptureBufferCmd(_object*, _object*)'
/tmp/ccxiQ8eE.o:(.data+0x114): undefined reference toPy_StreamCmd(_object*, _object*)'
/tmp/ccxiQ8eE.o:(.data+0x1b4): undefined reference to Py_ModelDebugCmd(_object*, _object*)'
/tmp/ccxiQ8eE.o:(.data+0x1c4): undefined reference toPy_ModelVersionCmd(_object*, _object*)'
/tmp/ccxiQ8eE.o:(.data+0x1d4): undefined reference to Py_ModelSimRunCmd(_object*, _object*)'
/tmp/ccxiQ8eE.o:(.data+0x1e4): undefined reference toPy_ModelSimEndCmd(_object*, _object*)'
collect2: error: ld returned 1 exit status
make: *** [xgs_sim.linux] Error 1
For these functions prototype declaration has been done in some other test.h file and that file has been included while compiling in the program.cc file.
The function definition has been done in test.cc file.
Python version used is python 2.7.1.
Any help/guidelines will be much appreciated. Thanks.
I have an assignment to write a program to implement i2c communication between a temp sensor and the Adafruit FT232H Breakout board (https://learn.adafruit.com/adafruit-ft232h-breakout/overview).
The end result is this running on a Linux computer, and they did not want it implemented in python like the examples, so I decided on using the suggested C library, libmpsse,(https://code.google.com/p/libmpsse/).
after installing the libftdi library that it needs, as well as the libpmpsse code. I was able to get the .c code working, using the make provided.
There Make
LDFLAGS= -lmpsse
all: spiflash spiflashfast i2ceeprom ds1305 gpio bitbang
spiflash:
spiflashfast:
i2ceeprom :
$(CC) $(CFlags) i2ceeprom.c -o i2ceeprom $(LDFLAGS)
ds1305:
clean:
rm -f* .dsym
rm -f spiflash spiflashfast i2ceeprom ds1305 gpio bitbang
distclean: clean
What I am hoping to be able to do, is take all the required library's and wrap it all together in one package (cmake?) With the end result being single functions in a c++ file that will be able to run the functions in my .c code.
What I've tried:
Using CMake, I tried to use the add_libraycommand to tie the lmpsse.c together.
I cant post any more links but it looks like:
cmake_minimum_required(VERSION 2.8)
project(i2c)
add_library(i2cFunctions, lmpsse.c)
include_directories("${PROJECT_SOURCE_DIR}/i2cFunctions")
add_subdirectory(i2cFunctions)
add_executable(i2c i2ceeprom.c)
target_link_libraries(i2c i2cFunctions)
I then run it, with the files I want in the dir above, but it produces
Linking C executable i2c
CMakeFiles/i2c.dir/i2ceeprom.c.o: In function `main':
i2ceeprom.c:(.text+0x73): undefined reference to `MPSSE'
i2ceeprom.c:(.text+0xa0): undefined reference to `Start'
i2ceeprom.c:(.text+0xb6): undefined reference to `Write'
i2ceeprom.c:(.text+0xcc): undefined reference to `Write'
i2ceeprom.c:(.text+0xd8): undefined reference to `GetAck'
i2ceeprom.c:(.text+0xec): undefined reference to `Stop'
i2ceeprom.c:(.text+0xf8): undefined reference to `Start'
i2ceeprom.c:(.text+0x10e): undefined reference to `Write'
i2ceeprom.c:(.text+0x11a): undefined reference to `GetAck'
i2ceeprom.c:(.text+0x133): undefined reference to `Read'
i2ceeprom.c:(.text+0x15b): undefined reference to `Stop'
i2ceeprom.c:(.text+0x18c): undefined reference to `Start'
i2ceeprom.c:(.text+0x1a2): undefined reference to `Write'
i2ceeprom.c:(.text+0x1b8): undefined reference to `Write'
i2ceeprom.c:(.text+0x1c4): undefined reference to `Stop'
i2ceeprom.c:(.text+0x1d0): undefined reference to `Start'
i2ceeprom.c:(.text+0x1e6): undefined reference to `Write'
i2ceeprom.c:(.text+0x1f2): undefined reference to `SendAcks'
i2ceeprom.c:(.text+0x203): undefined reference to `Read'
i2ceeprom.c:(.text+0x213): undefined reference to `SendNacks'
i2ceeprom.c:(.text+0x224): undefined reference to `Read'
i2ceeprom.c:(.text+0x234): undefined reference to `Stop'
i2ceeprom.c:(.text+0x6fc): undefined reference to `Stop'
i2ceeprom.c:(.text+0x716): undefined reference to `ErrorString'
collect2: error: ld returned 1 exit status
make[2]: *** [i2c] Error 1
make[1]: *** [CMakeFiles/i2c.dir/all] Error 2
make: *** [all] Error 2
Thanks for any ideas or help you might have,
If my explanation is a little weird I would be happy to explain better.