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?
Related
enter image description hereenter image description here
enter image description here
These are the images of my code. When I compile the code using gcc command it gives me this error:
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crt1.o: In function _start': (.text+0x20): undefined reference to main'
/usr/tmp/ccftPNzM.o: In function listFileRecursively': task12prog.c:(.text+0x229): undefined reference to S_ISLINK'
task12prog.c:(.text+0x3ae): undefined reference to `listFilesRecursively'
collect2: error: ld returned 1 exit status
How do I fix it?
S_ISLINK is a typo, it should be S_ISLNK. See glibc documentation.
I am building a project and I am getting an error along the lines of
...//this_lib.so: error adding symbols: File format not recognised
collect2: error: ld returned 1 exit status
above this this line is displayed
...//this_lib.so: invalid string offset 1437763608 >= 38801 for section '.dynstr'
I am trying to fix this issue. this_lib.so is a lib that is built in the make process (so build by me).
How do I debug issues like these?
At first I thought that it could be a 32-bit lib, that is not the case.
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.
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.