Go build ld: cannot find -l<library_name> - linux

I'm trying to build a golang website on Debian 11 but at build time I get this error:
# gocv.io/x/gocv
/usr/bin/ld: cannot find -lopencv_gapi
/usr/bin/ld: cannot find -lopencv_barcode
/usr/bin/ld: cannot find -lopencv_wechat_qrcode
/usr/bin/ld: cannot find -lopencv_xfeatures2d
collect2: error: ld returned 1 exit status
I installed open cv using pip3 install opencv-contrib-python
and can confirm that opencv is installed:
python3 -c "import cv2; print(cv2.__version__)"
4.6.0
In Debian 10 on another server I used to built the same codebase without any issues
My go version is go1.16.7 linux/amd64
I have tried many things like export CGO_LDFLAGS=-Wl,--no-as-needed as suggested here but they did not work.
Also, this might be helpful: ld -lzlib --verbose gives:
ld: mode elf_x86_64
attempt to open /usr/local/lib/x86_64-linux-gnu/libzlib.so failed
attempt to open /usr/local/lib/x86_64-linux-gnu/libzlib.a failed
attempt to open /lib/x86_64-linux-gnu/libzlib.so failed
attempt to open /lib/x86_64-linux-gnu/libzlib.a failed
attempt to open /usr/lib/x86_64-linux-gnu/libzlib.so failed
attempt to open /usr/lib/x86_64-linux-gnu/libzlib.a failed
attempt to open /usr/lib/x86_64-linux-gnu64/libzlib.so failed
attempt to open /usr/lib/x86_64-linux-gnu64/libzlib.a failed
attempt to open /usr/local/lib64/libzlib.so failed
attempt to open /usr/local/lib64/libzlib.a failed
attempt to open /lib64/libzlib.so failed
attempt to open /lib64/libzlib.a failed
attempt to open /usr/lib64/libzlib.so failed
attempt to open /usr/lib64/libzlib.a failed
attempt to open /usr/local/lib/libzlib.so failed
attempt to open /usr/local/lib/libzlib.a failed
attempt to open /lib/libzlib.so failed
attempt to open /lib/libzlib.a failed
attempt to open /usr/lib/libzlib.so failed
attempt to open /usr/lib/libzlib.a failed
attempt to open /usr/x86_64-linux-gnu/lib64/libzlib.so failed
attempt to open /usr/x86_64-linux-gnu/lib64/libzlib.a failed
attempt to open /usr/x86_64-linux-gnu/lib/libzlib.so failed
attempt to open /usr/x86_64-linux-gnu/lib/libzlib.a failed
ld: cannot find -lzlib
attempt to open /usr/local/lib/x86_64-linux-gnu/libzlib.so failed
attempt to open /usr/local/lib/x86_64-linux-gnu/zlib.a failed
attempt to open /lib/x86_64-linux-gnu/libzlib.so failed
attempt to open /lib/x86_64-linux-gnu/zlib.a failed
attempt to open /usr/lib/x86_64-linux-gnu/libzlib.so failed
attempt to open /usr/lib/x86_64-linux-gnu/zlib.a failed
attempt to open /usr/lib/x86_64-linux-gnu64/libzlib.so failed
attempt to open /usr/lib/x86_64-linux-gnu64/zlib.a failed
attempt to open /usr/local/lib64/libzlib.so failed
attempt to open /usr/local/lib64/zlib.a failed
attempt to open /lib64/libzlib.so failed
attempt to open /lib64/zlib.a failed
attempt to open /usr/lib64/libzlib.so failed
attempt to open /usr/lib64/zlib.a failed
attempt to open /usr/local/lib/libzlib.so failed
attempt to open /usr/local/lib/zlib.a failed
attempt to open /lib/libzlib.so failed
attempt to open /lib/zlib.a failed
attempt to open /usr/lib/libzlib.so failed
attempt to open /usr/lib/zlib.a failed
attempt to open /usr/x86_64-linux-gnu/lib64/libzlib.so failed
attempt to open /usr/x86_64-linux-gnu/lib64/zlib.a failed
attempt to open /usr/x86_64-linux-gnu/lib/libzlib.so failed
attempt to open /usr/x86_64-linux-gnu/lib/zlib.a failed
I have also tried: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/blnks as suggested here but still get the same erro.
Appreciate your help to resolve this.

Related

Error while building function with KNative

I was trying to build a Serverless application with Knative while using Rust. The program run well locally after calling cargo build. However before deploying the project, I keep ending with the error below.
Installing function v0.1.0 (/workspace)
error: failed to get `actix-http` as a dependency of package `function v0.1.0 (/workspace)`
Caused by:
failed to load source for dependency `actix-http`
Caused by:
Unable to update registry `crates-io`
Caused by:
usage of sparse registries requires `-Z sparse-registry`
unable to invoke layer creator
unable to contribute application layer
unable to install single
unable to build
exit status 101
ERROR: failed to build: exit status 1
Error: failed to build the function: executing lifecycle: failed with status code: 51
Error: exit status 1
I've been looking for solutions to solve this without any luck. Can someone help me figure out how to resolve this issue?

Nvm install - Warning: Failed to open the file - Permission Denied

I currently have node installed on my computer (ubuntu) with the v12.22.9 version and I'm trying to install the v10.22.0 version with the following command: nvm install v10.22.0 but I always get the error described below. How do I resolve it?
Downloading and installing node v10.22.0...
Downloading https://nodejs.org/dist/v10.22.0/node-v10.22.0-linux-x64.tar.xz...
Warning: Failed to open the file
Warning: /home/wand/.nvm/.cache/bin/node-v10.22.0-linux-x64/node-v10.22.0-linux
Warning: -x64.tar.xz: Permission denied
curl: (23) Failure writing output to destination
Binary download from https://nodejs.org/dist/v10.22.0/node-v10.22.0-linux-x64.tar.xz failed, trying source.
grep: /home/wand/.nvm/.cache/bin/node-v10.22.0-linux-x64/node-v10.22.0-linux-x64.tar.xz: Arquivo ou diretório inexistente
Provided file to checksum does not exist.
Binary download failed, trying source.
Detected that you have 12 CPU core(s)
Running with 11 threads to speed up the build
Downloading https://nodejs.org/dist/v10.22.0/node-v10.22.0.tar.xz...
Warning: Failed to open the file
Warning: /home/wand/.nvm/.cache/src/node-v10.22.0/node-v10.22.0.tar.xz:
Warning: Permission denied
0.0%curl: (23) Failure writing output to destination
Binary download from https://nodejs.org/dist/v10.22.0/node-v10.22.0.tar.xz failed, trying source.
grep: /home/wand/.nvm/.cache/src/node-v10.22.0/node-v10.22.0.tar.xz: Arquivo ou diretório inexistente
Provided file to checksum does not exist.
I tried to install a previous version of node but it gave an error.

UnrealBuildTool: ld.lld: error: unable to find library

OS:
Manjaro Linux 4.19.28-1-MANJARO
I have some problem about ld in UnrealBuildTool. and I'm everything new about all Unreal Stuff.
A week ago, I was found some Unreal-based Opensource project. released binary version is working perfectly. But it cannot build on my PC. I think It was gcc linker cannot find assimp library.
So I setup environment variable 'LIBRARY_PATH' and 'LD_LIBRARY_PATH' However, UnrealBuildTool seems not using my local machine's ld linker.
Anyone have idea for this?
Log
[440/442] Compile BuildSettings.cpp
[441/442] Compile pugixml.cpp
[442/442] Link (lld) CarlaEditor
/home/suho/Repository/UnrealEngine/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v12_clang-6.0.1-centos7/x86_64-unknown-linux-gnu/bin/ld.lld: error: unable to find library -lassimp
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ERROR: UBT ERROR: Failed to produce item: /home/suho/Workspace/carla-map-editor/Unreal/CarlaEditor/Binaries/Linux/CarlaEditor
(see /home/suho/Library/Logs/Unreal Engine/LocalBuildLogs/UBT-CarlaEditor-Linux-Development.txt for full exception trace)
Total build time: 646.23 seconds (Local executor: 0.00 seconds)
Took 646.750887s to run mono, ExitCode=5
ERROR: UnrealBuildTool failed. See log for more details. (/home/suho/Library/Logs/Unreal Engine/LocalBuildLogs/UBT-CarlaEditor-Linux-Development.txt)
(see /home/suho/Library/Logs/Unreal Engine/LocalBuildLogs/Log.txt for full exception trace)
AutomationTool exiting with ExitCode=5 (5)
RunUAT ERROR: AutomationTool was unable to run successfully.
make: *** [Util/BuildTools/Linux.mk:13: package] Error 5
full of log are here: https://pastebin.com/HmLphXTe

When I am building meta-toolchain-qt5 using yocto I encountered foolowing error

ERROR: qtbase-5.9.2+gitAUTOINC+ec16ba393b-r0
do_prepare_recipe_sysroot: The file /usr/lib/pkgconfig/wayland-egl.pc
is installed by both mesa and imx-gpu-viv, aborting ERROR:
qtbase-5.9.2+gitAUTOINC+ec16ba393b-r0 do_prepare_recipe_sysroot:
Function failed: extend_recipe_sysroot ERROR: Logfile of failure
stored in:
/home/sandeep/fsl-community-bsp/build/tmp/work/cortexa9hf-neon-mx6qdl-poky-linux-gnueabi/qtbase/5.9.2+gitAUTOINC+ec16ba393b-r0/temp/log.do_prepare_recipe_sysroot.2803 ERROR: Task
(/home/sandeep/fsl-community-bsp/sources/meta-qt5/recipes-qt/qt5/qtbase_git.bb:do_prepare_recipe_sysroot)
failed with exit code '1'
mesa and imx-gpu-viv both recipe files are trying to insta the same file /usr/lib/pkgconfig/wayland-egl.pc that is cause the error. Remove the file manually and compile it again .

ERROR: input-utils-1.0-r0 do_compile: oe_runmake failed in arago project in Ubuntu 16.04

yocto#ilx:~/tisdk/build$ MACHINE=am335x-evm bitbake arago-core-tisdk-image
I am building sdk.
Not able to resolve this errors:
ERROR: input-utils-1.0-r0 do_compile: oe_runmake failed
ERROR: input-utils-1.0-r0 do_compile: Function failed: do_compile
It says ERROR: input-utils-1.0-r0 do_compile: oe_runmake failed .
I found some solutions from web and tried, but it gave me same error as figure above.
Does anybody have an idea for this?

Resources