I am trying to re-use sqlite related code from my iOS application on tvOS and getting few linking errors as below
Undefined symbols for architecture arm64:
"_sqlite3_enable_load_extension", referenced from:
"_sqlite3_load_extension", referenced from:
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I am linking with libsqlite3.
The same code links fine on iOS. Seems like the library is missing some symbols for tvOS. Has anyone encountered this issue?
Related
After my Xcode automatically updated itself to 12.4, my Rstudio package compilation breaks and throws the following error:
ld: framework not found CoreFoundation
collect2: error: ld returned 1 exit status
I have tried reinstalling Xcode command-line tool; disabling csrutil and then manually creating links, but these attempts were to no avail. I would really appreciate any help!
I was able to fix this error by:
Installing XCode CLI (you can find it here: https://developer.apple.com/download/all/?q=for%20Xcode)
Removing ~/.R/Makevars and ~/.Renviron (you can just rename them if you don't want to delete them)
Installing gfortran from here: https://github.com/fxcoudert/gfortran-for-macOS/releases
add -F/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/ into LDFLAGS
I'm trying to compile Qscintilla 2.9.2 on Ubuntu 16.04 64bit using Qt 5.7 got the following error message:
-L/home/mwambi/Qt5.7.0/5.7/gcc_64/lib -lQt5PrintSupport -L/usr/lib64 -lQt5Widgets -lQt5Gui -lQt5Core -lpthread -lGL
/usr/bin/ld: cannot find -lGL
collect2: error: ld returned 1 exit status
Makefile:979: recipe for target 'libqscintilla2.so.12.0.1' failed
make: *** [libqscintilla2.so.12.0.1] Error 1
I do not know what the library GL is and where to find it. How can I solve this?
In my experience, this troubleshooting procedure is enough to solve about 90% of missing library issues during compilation:
"-l[name]" implies there's a "lib[name].so"
Search your system for "lib[name]" (use locate or find).
If you find it on your system, check paths ($LB_LIBRARY_PATH and the build system's -L flags) and verify that the architecture matches (x86+64 vs. i686).
Do a repository search for "lib[name]" (use apt, yum, synaptic, &c.).
Install it if it's missing.
Type "lib[name].so" into google or a dedicated package-search site (like RPMFind or packages.ubuntu.com) and see what package names come up, then search for as in #2-3.
In this case, libGL is an implementation of OpenGL. You can install Mesa or find an alternative implementation (I've only ever used Qt with Mesa). Here's a list of packages that provide libGL; if you already have one of these installed on your system, try fetching the dev versions of whichever ones you already have.
I am trying to compile an opencl sample code but I am getting the following error
/usr/bin/ld: cannot find -lOpenCL
/usr/bin/ld: cannot find -loclUtil_x86_64
/usr/bin/ld: cannot find -lshrutil_x86_64
collect2: error: ld returned 1 exit status
make: *** [../../..//OpenCL//bin//linux/release/DeviceQuery] Error 1
I am using intel based machine ...
My make file is
EXECUTABLE := DeviceQuery
CCFILES := devQury.cpp
include ../common/common_opencl.mk
Any help would be of great help
Thanks ,
Piyush
Make sure that the OpenCL library (libOpenCL.so) is present in /usr/lib. This should have been put in place by the driver, so you shouldn't have to do anything.
If not then copy libOpenCL.so present in your cuda toolkit (lib64) to the above location.
sudo cp /usr/local/cuda-7.0/lib64/libOpenCL.so /usr/lib
This fixes the error
/usr/bin/ld: cannot find -lOpenCL
collect2: error: ld returned 1 exit status
Have you installed the OpenCL SDK from either Intel or AMD? If not then perhaps you should follow these instructions. If you have an SDK installed then your makefile is probably missing -L... in the compiler command line, where ... is the path to the lib folder in the OpenCL SDK that should contain a file libOpenCL.a or something similar.
when i linked the libjunit provided by the generated j2objc source code, and i try to build my project, this error is occured:
ld: warning: ignoring file /Users/Niangsou/Documents/Workspace/mastercard/iOS/Mobile_api_Tests/SDKConversion/j2objc/lib/libjunit.a, file was built for archive which is not the architecture being linked (i386): /Users/Niangsou/Documents/Workspace/mastercard/iOS/Mobile_api_Tests/SDKConversion/j2objc/lib/libjunit.a
and Undefined symbols for architecture i386:
"_OBJC_CLASS_$_JunitFrameworkAssert", referenced from
How can I do to resolve this problem?
It seems that the libjunit.a generated is not supported by the arch i386.
j2objc now distributes a libjunit.a that supports the armv7, armv7s, i386, MACOSX architectures.
I just installed QtSDK 1.2 on my redhat enterprise linux 5.6. While compiling a QT program, I got the following errors:
[root#stack example1]# make
g++ -m64 -Wl,-O1 -Wl,-rpath,/opt/QtSDK/Desktop/Qt/4.8.0/gcc/lib -o example1 fac1.o -L/opt/QtSDK/Desktop/Qt/4.8.0/gcc/lib -lQtGui -lQtCore -lpthread
/opt/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtCore.so: undefined reference to `g_main_context_push_thread_default'
/opt/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtCore.so: undefined reference to `inotify_init1#GLIBC_2.9'
/opt/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtGui.so: undefined reference to `pipe2#GLIBC_2.9'
/opt/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtCore.so: undefined reference to `g_main_context_pop_thread_default'
/opt/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtGui.so: undefined reference to `FcFreeTypeQueryFace'
/opt/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtGui.so: undefined reference to `FT_Library_SetLcdFilter'
/opt/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtGui.so: undefined reference to `__longjmp_chk#GLIBC_2.11'
collect2: ld returned 1 exit status
make: *** [example1] Error 1
[root#stack example1]#
It seems g++ compiler uses all correct options. Befor I installed QtSDK 1.2 on rhel 5.6, I had copied libstdc++.so.6.0.10 to /usr/lib64 and relinked libstdc++.so.6 to libstdc++.so.6.0.10, since QtSDK requires GLIBCXX_3.4.9 symbols in the libstdc++ library. I think this may be the source of the problem. But I'm not sure about that. So any advice? Thanks in advance.
My answer is multiple questions:
Are you in a 64 architecture? If not why using 64 libraries?
Did the libraries copied are 64 versions ?
If it is the case, why do you need to copy them, there should already be standard libraries in /usr/lib64
If it is not the case the errors are legit.
How did you compiled Qt in the first place? if your Qt libraries are really 64 bits, then it means the environment setup was already correct.