Could not open 'x64.lib'

System information (version)
  • OpenCV => 4.5.2 release
  • Operating System / Platform => Windows 64 Bit
  • Compiler => Visual Studio 2019 msvc or Intel clang 2021 (oneapi)
Detailed description

build opencv fails with:

lld-link: : error : could not open ‘x64.lib’: no such file or directory [I:\src\opencv-4.5.2\build\modules\world\opencv _world.vcxproj]

in opencv_world.vcxproj in the linker’s <AdditionalDependencies> I see x64.lib between cublas and cufft: cublas.lib;x64.lib;cufft.lib;

it seems to be a typo somewhere, and that should be part of a path x64/lib/

A grep allows me to see that it is present at many places:

./apps/annotation/opencv_annotation.vcxproj:      <AdditionalDependencies>..\..\3rdparty\lib\Debug\ippiw
./apps/annotation/opencv_annotation.vcxproj:      <AdditionalDependencies>..\..\3rdparty\lib\Release\ipp
./apps/interactive-calibration/opencv_interactive-calibration.vcxproj:      <AdditionalDependencies>..\.
./apps/interactive-calibration/opencv_interactive-calibration.vcxproj:      <AdditionalDependencies>..\.
./apps/model-diagnostics/opencv_model_diagnostics.vcxproj:      <AdditionalDependencies>..\..\3rdparty\l
./apps/model-diagnostics/opencv_model_diagnostics.vcxproj:      <AdditionalDependencies>..\..\3rdparty\l
./apps/version/opencv_version.vcxproj:      <AdditionalDependencies>..\..\3rdparty\lib\Debug\ippiwd.lib;
./apps/version/opencv_version.vcxproj:      <AdditionalDependencies>..\..\3rdparty\lib\Release\ippiw.lib
./apps/version/opencv_version_win32.vcxproj:      <AdditionalDependencies>..\..\3rdparty\lib\Debug\ippiw
./apps/version/opencv_version_win32.vcxproj:      <AdditionalDependencies>..\..\3rdparty\lib\Release\ipp
./apps/visualisation/opencv_visualisation.vcxproj:      <AdditionalDependencies>..\..\3rdparty\lib\Debug
./apps/visualisation/opencv_visualisation.vcxproj:      <AdditionalDependencies>..\..\3rdparty\lib\Relea
./CMakeVars.txt:_cuda_64bit_lib_dir=lib/x64;lib64;libx64
./modules/img_hash/opencv_img_hash.vcxproj:      <AdditionalDependencies>..\..\lib\Debug\opencv_world452
./modules/img_hash/opencv_img_hash.vcxproj:      <AdditionalDependencies>..\..\lib\Release\opencv_world4
Binary file ./modules/world/.vs/opencv_world/v16/Solution.VC.db matches
Binary file ./modules/world/.vs/opencv_world/v16/Solution.VC.db-wal matches
./modules/world/opencv_world.vcxproj:      <AdditionalDependencies>..\..\3rdparty\lib\Debug\ippiwd.lib;.
./modules/world/opencv_world.vcxproj:      <AdditionalDependencies>..\..\3rdparty\lib\Release\ippiw.lib;
Steps to reproduce

Not every option is useful, nevertheless this is how I I configured with cmake:

	cmake -T "Intel C++ Compiler 2021" -G $target -A x64 -S $src `
		-DBUILD_JAVA=0 -DWITH_MATLAB=0 -DBUILD_DOC=0 -DBUILD_PERF_TESTS=0 -DBUILD_TESTS=0 -DBUILD_opencv_world=1 `
		-DOPENCV_ENABLE_NONFREE=1 -DBUILD_opencv-apps=0 -DENABLE_PYLINT=0 -DENABLE_CXX11=1 `
		-DWITH_VTK=1 -DBUILD_opencv_viz=1 -DCPU_BASELINE=AVX2 `
		-DCUDA_SDK_ROOT_DIR="$env:CUDA_PATH" -DCUDA_ARCH_BIN="7.5" -DCUDA_VERBOSE_BUILD=0 -DBUILD_CUDA_STUBS=0 `
		-DWITH_OPENCL=0 -DWITH_CUDA=1 -DMKL_WITH_OPENMP=0 -DMKL_WITH_TBB=0 -DWITH_TBB=0 `
		-DTBB_DIR="$Env:TBB_DIR" -DTBB_ENV_INCLUDE="$Env:TBB_INCLUDE_DIR" -DTBB_ENV_LIB="$Env:TBB_LIB_DIR" `
		-DOPENCV_EXTRA_MODULES_PATH="$srcextra" -DPYTHON2_EXECUTABLE="C:\Python27\python.exe" `
		-DINSTALL_CREATE_DISTRIB=1 -DCPACK_BINARY_ZIP=1 -DCPACK_SOURCE_ZIP=1 -DCMAKE_VERBOSE_MAKEFILE=0 `
		-DCUDNN_INCLUDE_DIR="$Env:CUDNN"\include -DCUDNN_LIBRARY="$Env:CUDNN"\lib\x64 -DCUDA_HOST_COMPILER="$cc" `
		.. | Tee-Object -Variable RESULT

then build fails.

there is no x64.lib

i think, this should point to a lib file inside the folder (not the folder alone)

so, it is still not solved ?

1 Like

Solved indeed (I closed the issue on github). Thanks.

1 Like