정의된 함수가 없을 때 에러 ( 링킹 과정에서 발생함 )
없다고 에러가 나오는 함수 종류를 파악해야하며 stdlib에 포함됐는지 커스텀경로( -L 옵션으로 라이브러리 경로 추가 )에 포함되는지를 확인해야한다.
옵션에 의해 standard libarary가 링킹에 포함되지 않을 경우 (
-nostdlib
) 표준함수를 찾을 수 없다고 에러가 발생한다.그외에 커스텀 라이브러리를 사용하는 경우 gcc옵션에
-L
이 빠졌거나 잘못되었는지 확인해봐야한다.
check_builtin gmtime_r time.h time_t *time; struct tm *tm; gmtime_r(time, tm)
check_code ld time.h time_t *time; struct tm *tm; gmtime_r(time, tm) cc
check_ld cc
check_cc
BEGIN /tmp/ffconf.yIgznaG6.c
1 #include <time.h>
2 int main(void) { time_t *time; struct tm *tm; gmtime_r(time, tm); return 0; }
END /tmp/ffconf.yIgznaG6.c
/home/###/workbench/ffmpeg_cross_compile/android-ndk-r21e/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android23-clang -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Dstrtod=avpriv_strtod -DPIC -Os -fPIC -D_FILE_OFFSET_BITS=64 -v -DANDROID -DBIONIC_IOCTL_NO_SIGNEDNESS_OVERLOAD -std=c99 -fomit-frame-pointer -fPIC -c -o /tmp/ffconf.Iye6vKfn.o /tmp/ffconf.yIgznaG6.c
Android (7019983 based on r365631c3) clang version 9.0.9 (https://android.googlesource.com/toolchain/llvm-project a2a1e703c0edb03ba29944e529ccbf457742737b) (based on LLVM 9.0.9svn)
Target: aarch64-unknown-linux-android23
Thread model: posix
InstalledDir: /home/###/workbench/ffmpeg_cross_compile/android-ndk-r21e/toolchains/llvm/prebuilt/linux-x86_64/bin
Found candidate GCC installation: /home/###/workbench/ffmpeg_cross_compile/android-ndk-r21e/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/gcc/aarch64-linux-android/4.9.x
Selected GCC installation: /home/###/workbench/ffmpeg_cross_compile/android-ndk-r21e/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/gcc/aarch64-linux-android/4.9.x
Candidate multilib: .;@m64
Selected multilib: .;@m64
"/home/###/workbench/ffmpeg_cross_compile/android-ndk-r21e/toolchains/llvm/prebuilt/linux-x86_64/bin/clang" -cc1 -triple aarch64-unknown-linux-android23 -emit-obj -mnoexecstack -disable-free -disable-llvm-verifier -discard-value-names -main-file-name ffconf.yIgznaG6.c -mrelocation-model pic -pic-level 2 -mthread-model posix -masm-verbose -mconstructor-aliases -fuse-init-array -target-cpu generic -target-feature +neon -target-abi aapcs -mllvm -aarch64-fix-cortex-a53-835769=1 -fallow-half-arguments-and-returns -dwarf-column-info -debugger-tuning=gdb -v -coverage-notes-file /tmp/ffconf.Iye6vKfn.gcno -resource-dir /home/###/workbench/ffmpeg_cross_compile/android-ndk-r21e/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/9.0.9 -D _ISOC99_SOURCE -D _FILE_OFFSET_BITS=64 -D _LARGEFILE_SOURCE -D strtod=avpriv_strtod -D PIC -D _FILE_OFFSET_BITS=64 -D ANDROID -D BIONIC_IOCTL_NO_SIGNEDNESS_OVERLOAD -internal-isystem /home/###/workbench/ffmpeg_cross_compile/android-ndk-r21e/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/local/include -internal-isystem /home/###/workbench/ffmpeg_cross_compile/android-ndk-r21e/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/9.0.9/include -internal-externc-isystem /home/###/workbench/ffmpeg_cross_compile/android-ndk-r21e/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/aarch64-linux-android -internal-externc-isystem /home/###/workbench/ffmpeg_cross_compile/android-ndk-r21e/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/include -internal-externc-isystem /home/###/workbench/ffmpeg_cross_compile/android-ndk-r21e/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include -Os -std=c99 -fdebug-compilation-dir /home/###/workbench/ffmpeg_cross_compile/FFMPEG -ferror-limit 19 -fmessage-length 0 -fno-signed-char -fobjc-runtime=gcc -fdiagnostics-show-option -vectorize-loops -vectorize-slp -o /tmp/ffconf.Iye6vKfn.o -x c /tmp/ffconf.yIgznaG6.c
clang -cc1 version 9.0.9 based upon LLVM 9.0.9svn default target x86_64-unknown-linux-gnu
ignoring nonexistent directory "/home/###/workbench/ffmpeg_cross_compile/android-ndk-r21e/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/include"
#include "..." search starts here:
#include <...> search starts here:
/home/###/workbench/ffmpeg_cross_compilze/android-ndk-r21e/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/local/include
/home/###/workbench/ffmpeg_cross_compile/android-ndk-r21e/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/9.0.9/include
/home/###/workbench/ffmpeg_cross_compile/android-ndk-r21e/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/aarch64-linux-android
/home/###/workbench/ffmpeg_cross_compile/android-ndk-r21e/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include
End of search list.
/home/###/workbench/ffmpeg_cross_compile/android-ndk-r21e/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android23-clang -Wl,-rpath-link=/home/###/workbench/ffmpeg_cross_compile/android-ndk-r21e/platforms/android-23/arch-arm64/usr/lib -L/home/###/workbench/ffmpeg_cross_compile/android-ndk-r21e/platforms/android-23/arch-arm64/usr/lib -nostdlib -Wl,--as-needed -Wl,-z,noexecstack -o /tmp/ffconf.tXhzlbeo /tmp/ffconf.Iye6vKfn.o
/home/###/workbench/ffmpeg_cross_compile/android-ndk-r21e/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin/ld: warning: cannot find entry symbol _start; defaulting to 00000000000002c0
/tmp/ffconf.Iye6vKfn.o: In function `main':
ffconf.yIgznaG6.c:(.text+0x4): undefined reference to `gmtime_r'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
'Linux Complie > 오류메세지' 카테고리의 다른 글
헤더를 찾을 수 없을 때 나오는 에러 ( obj파일 생성시 발생함 ) (0) | 2022.05.20 |
---|