hi every one i am working a in qt and qwt but in my program i am getting these error
undefined reference to `vtable for MainWindow'
error: collect2: ld returned 1 exit status
i didnt get it what is the meaning of these error can some one explain it as apparently i have no error in my code
thanks
You're not linking to everything you should. You need to run moc on your .cpp files, and add e.g. #include "moc_myfile.cpp" to the end of myfile.cpp
Alternatively, you have declared a virtual function (destructor perhaps) without defining it.
Related
I would like to cross-compile lmbench for ARM64, on a x86 machine. I have built my own cross-compiler according to the guide here: http://preshing.com/20141119/how-to-build-a-gcc-cross-compiler/
When I tried cross-compiling lmbench3 with this cross-compiler I first had to:
remove all the lines where bk.ver was used in the src/Makefile
replace bk.ver by 3 at line 200 of the Makefile, so that I have:
sed -e "s/<version>/3/g" < ../scripts/lmbench > $O/lmbench
Set CC=aarch64-linux-gcc, OS=aarch64-linux-gnu, CFLAGS="$CFLAGS -static"
Put all the glibc-2.20/sunrpc/rpc header files into /opt/cross/aarch64-linux/include/rpc folder
Then when I type the make command I get the following error:
gmake[1]: Entering directory `/home/florian/lmbench3/src'
aarch64-linux-gcc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1 -o ../bin/aarch64-linux-gnu/bw_tcp bw_tcp.c ../bin/aarch64-linux-gnu/lmbench.a -lm
../bin/aarch64-linux-gnu/lmbench.a(lib_tcp.o): In function `tcp_done':
lib_tcp.c:(.text+0x18): undefined reference to `pmap_unset'
../bin/aarch64-linux-gnu/lmbench.a(lib_tcp.o): In function `tcp_connect':
lib_tcp.c:(.text+0x338): undefined reference to `pmap_getport'
../bin/aarch64-linux-gnu/lmbench.a(lib_tcp.o): In function `tcp_server':
lib_tcp.c:(.text+0x568): undefined reference to `pmap_unset'
lib_tcp.c:(.text+0x584): undefined reference to `pmap_set'
collect2: error: ld returned 1 exit status
gmake[1]: *** [../bin/aarch64-linux-gnu/bw_tcp] Error 1
gmake[1]: Leaving directory `/home/florian/lmbench3/src'
make: *** [lmbench] Error 2
I know that pmap_set, pmap_unset and pmap_getport are called in lib_tcp.c, but I don't find anywhere their definitions. When I compile lmbench3 for x86 I don't get this error, and I checked everywhere on the host machine for the definition of these functions, but still don't find them anywhere.
Does anyone know what to do with this error? I guess I still need to use RPC, so I'd prefer not commenting any line.
From the error info, ld didn't find the lib, try following
make results LDFLAGS=-ltirpc
I downloaded the package ROSArduinoBridge and the examples that come with the packages don't work in Arduino.
The error I keep getting is:
ROSArduinoBridge.cpp.o: In function 'runCommand()':
/usr/share/arduino/ROSArduinoBridge.ino:150: undefined reference to
'readEncoder(int)' /usr/share/arduino/ROSArduinoBridge.ino:179:
undefined reference to 'readEncoder(int)'
/usr/share/arduino/ROSArduinoBridge.ino:234: undefined reference to
'initMotorController()' collect2: error: ld returned 1 exit status
I'm just confused on why the error is showing up since I haven't changed the code at all.
I am currently patching a older version of OpenSSL to the latest stable 1.0.0o build (via import_openssl.sh)for use with a Android application via the NDK r10c.
While building the libssl.so sharedlibrary i am presented with the following errors.
[armeabi] SharedLibrary : libssl.so
jni/openssl/ssl/s3_enc.c:542: error: undefined reference to 'ssl3_cbc_remove_padding'
jni/openssl/ssl/s3_enc.c:739: error: undefined reference to 'ssl3_cbc_record_digest_supported'
jni/openssl/ssl/s3_enc.c:764: error: undefined reference to 'ssl3_cbc_digest_record'
jni/openssl/ssl/s3_pkt.c:464: error: undefined reference to 'ssl3_cbc_copy_mac'
jni/openssl/ssl/t1_enc.c:763: error: undefined reference to 'tls1_cbc_remove_padding'
jni/openssl/ssl/t1_enc.c:919: error: undefined reference to 'ssl3_cbc_record_digest_supported'
jni/openssl/ssl/t1_enc.c:925: error: undefined reference to 'ssl3_cbc_digest_record'
jni/openssl/ssl/ssl_lib.c:1058: error: undefined reference to 'dtls1_min_mtu'
Taking the first error for example, i can see a reference in the file s3_enc.c (https://github.com/openssl/openssl/blob/OpenSSL_1_0_0-stable/ssl/s3_enc.c) to a function 'ssl3_cbc_remove_padding' but the actual function is nowhere to be seen, only a prototype in ssl_locl.h (https://github.com/openssl/openssl/blob/OpenSSL_1_0_0-stable/ssl/ssl_lib.c) so i am a little confused.
Any help or previous experience would be greatly appreciated in order to get these errors cleared. if you need me to elaborate further, please ask.
Check the files (s3_enc.c, t1_enc.c, ssl_lib.c), included in their respective .mk files or not. In my case it was not included so I just add these source files in ssl/Android.mk under LOCAL_SRC_FILES section.
I get an error in linux while I try to link a certain number of objects by using a script file. The error is:
/usr/lib/libc_nonshared.a(stack_chk_fail_local.oS): In function __stack_chk_fail_local ':
(.text+0x10): undefined reference to__stack_chk_fail'
collect2: ld returned 1 exit status
What's the problem and how to overcome it?
I'm trying to use libxml2 with android ndk. When I run the make file, I got errors saying that file 'unicode/ucnv.h' does not exist. I've seen 'unicode/ucnv.h' is included in one of the files and no such header file is present. So I downloaded unicode header files from http://site.icu-project.org/ and placed them in include folder.
Now the previous error is gone but I've got these errors.
SharedLibrary : libxml2.so
./obj/local/armeabi/objs-debug/xml2/encoding.o: In function `openIcuConverter':
C:\test\hello-jni/jni/encoding.c:109: undefined reference to `ucnv_open_49'
C:\test\hello-jni/jni/encoding.c:115: undefined reference to `ucnv_setToUCallBack_49'
C:\test\hello-jni/jni/encoding.c:119: undefined reference to `ucnv_setFromUCallBack_49'
C:\test\hello-jni/jni/encoding.c:126: undefined reference to `ucnv_open_49'
C:\test\hello-jni/jni/encoding.c:132: undefined reference to `ucnv_close_49'
C:\test\hello-jni/jni/encoding.c:135: undefined reference to `UCNV_TO_U_CALLBACK_STOP_49'
C:\test\hello-jni/jni/encoding.c:135: undefined reference to `UCNV_FROM_U_CALLBACK_STOP_49'
./obj/local/armeabi/objs-debug/xml2/encoding.o: In function `closeIcuConverter':
C:\test\hello-jni/jni/encoding.c:141: undefined reference to `ucnv_close_49'
C:\test\hello-jni/jni/encoding.c:142: undefined reference to `ucnv_close_49'
./obj/local/armeabi/objs-debug/xml2/encoding.o: In function `xmlUconvWrapper':
C:\test\hello-jni/jni/encoding.c:1865: undefined reference to `ucnv_convertEx_49'
C:\test\hello-jni/jni/encoding.c:1870: undefined reference to `ucnv_convertEx_49'
collect2: ld returned 1 exit status
make: * [obj/local/armeabi/libxml2.so] Error 1
I didn't find function ucnv_open_49 in any of the files.
Am I the only one who is facing this problem?
Build unicode library (icu) along with libxml2 and mention in LOCAL_SHARED_LIBRARIES.
That's it!
Are you intending to link libxml2 against ICU (e.g. use it for conversion)? It's optional but currently you have it enabled. With such you'll need ICU to be linked in as well rather static or dynamic. See the libxml2's configure script for options. Some of which are iconv or even no converters if you intend to work with UTF-8 only.