question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[package] libx265/3.2.1 build fail in file INSTALL cannot find x265.pdb mingw64

See original GitHub issue

Package and Environment Details

  • Package Name/Version: libx265/3.2.1
  • Operating System+version: Windows 10
  • Compiler+version: gcc-mingw-w64-8.1.0
  • Docker image: conanio/gcc8.1
  • Conan version: conan 1.22.2
  • Python version: Python 3.7.5/none

Conan profile

Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Debug
compiler=gcc
compiler.cppstd=14
compiler.exception=seh
compiler.libcxx=libstdc++11
compiler.threads=posix
compiler.version=8.1
os=Windows
os_build=Windows
[options]
[build_requires]
[env]
CONAN_CMAKE_GENERATOR=MinGW Makefiles
[requires]
libx265/3.2.1

Steps to reproduce

Add package libx265/3.2.1 to build in mingw64 windows env (no Visual Studio). Fail in file INSTALL cannot find bin/x265.pdb:

CMake Error at source_subfolder/source/cmake_install.cmake:48 (file):
  file INSTALL cannot find
  "C:/Users/Home/.conan/data/libx265/3.2.1/_/_/build/e82f74c25b82d272dbcd1630371590cd62192d65/build_subfolder/bin/x265.pdb".
Call Stack (most recent call first):
  cmake_install.cmake:37 (include)

Same issues as https://github.com/bincrafters/community/issues/1085 problem.

Fixed method

.conan\data\libx265\3.2.1\_\_\source\source_subfolder\source\CMakeLists.txt line 581 -593

if((WIN32 AND ENABLE_CLI) OR (WIN32 AND ENABLE_SHARED))
    if(MSVC_IDE)
        install(FILES "${PROJECT_BINARY_DIR}/Debug/x265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug)
        install(FILES "${PROJECT_BINARY_DIR}/RelWithDebInfo/x265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS RelWithDebInfo)
        install(FILES "${PROJECT_BINARY_DIR}/Debug/libx265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug OPTIONAL NAMELINK_ONLY)
        install(FILES "${PROJECT_BINARY_DIR}/RelWithDebInfo/libx265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS RelWithDebInfo OPTIONAL NAMELINK_ONLY)
    else()
        install(FILES "${PROJECT_BINARY_DIR}/x265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug)
        install(FILES "${PROJECT_BINARY_DIR}/x265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS RelWithDebInfo)
        install(FILES "${PROJECT_BINARY_DIR}/libx265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug OPTIONAL NAMELINK_ONLY)
        install(FILES "${PROJECT_BINARY_DIR}/libx265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS RelWithDebInfo OPTIONAL NAMELINK_ONLY)
    endif()
endif()

Because of no x265.pdb due to this error. Fixed: https://github.com/microsoft/vcpkg/blob/master/ports/x265/disable-install-pdb.patch

We need to disable install pdb code in CMakeLists.txt when windows and mingw gcc. My fixed: .conan\data\libx265\3.2.1\_\_\export\conanfile.py line 40

    def _patch_sources(self):
        cmakelists = os.path.join(self._source_subfolder, "source", "CMakeLists.txt")
        if self.settings.os == "Windows":
            #   file INSTALL cannot find x265.pdb
            if self.settings.compiler == "Visual Studio":
                tools.replace_in_file(cmakelists,
                                      "${PROJECT_BINARY_DIR}/Debug/x265.pdb",
                                      "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/x265.pdb")
                tools.replace_in_file(cmakelists,
                                      "${PROJECT_BINARY_DIR}/x265.pdb",
                                      "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/x265.pdb")
            else:
                tools.replace_in_file(cmakelists,
                                      "install(FILES \"${PROJECT_BINARY_DIR}/Debug/x265.pdb\" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug)",
                                      "# install(FILES \"${PROJECT_BINARY_DIR}/Debug/x265.pdb\" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug)")
                tools.replace_in_file(cmakelists,
                                      "install(FILES \"${PROJECT_BINARY_DIR}/RelWithDebInfo/x265.pdb\" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS RelWithDebInfo)",
                                      "# install(FILES \"${PROJECT_BINARY_DIR}/RelWithDebInfo/x265.pdb\" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS RelWithDebInfo)")
                tools.replace_in_file(cmakelists,
                                      "install(FILES \"${PROJECT_BINARY_DIR}/x265.pdb\" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug)",
                                      "# install(FILES \"${PROJECT_BINARY_DIR}/x265.pdb\" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug)")
                tools.replace_in_file(cmakelists,
                                      "install(FILES \"${PROJECT_BINARY_DIR}/x265.pdb\" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS RelWithDebInfo)",
                                      "# install(FILES \"${PROJECT_BINARY_DIR}/x265.pdb\" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS RelWithDebInfo)")

Logs (Include/Attach if Applicable)

Click to expand log
[ 79%] Built target x265-static
[ 82%] Built target x265-shared
[100%] Built target cli
Install the project...
-- Install configuration: "Debug"
-- Installing: C:/Users/Home/.conan/data/libx265/3.2.1/_/_/package/e82f74c25b82d272dbcd1630371590cd62192d65/lib/libx265.a
-- Installing: C:/Users/Home/.conan/data/libx265/3.2.1/_/_/package/e82f74c25b82d272dbcd1630371590cd62192d65/include/x265.h
-- Installing: C:/Users/Home/.conan/data/libx265/3.2.1/_/_/package/e82f74c25b82d272dbcd1630371590cd62192d65/include/x265_config.h
CMake Error at source_subfolder/source/cmake_install.cmake:48 (file):
  file INSTALL cannot find
  "C:/Users/Home/.conan/data/libx265/3.2.1/_/_/build/e82f74c25b82d272dbcd1630371590cd62192d65/build_subfolder/bin/x265.pdb".
Call Stack (most recent call first):
  cmake_install.cmake:37 (include)


mingw32-make.exe: *** [Makefile:73: install] Error 1
ERROR: libx265/3.2.1: Error in package() method, line 95
	cmake.install()
	ConanException: Error 2 while executing cmake --build C:\Users\Home\.conan\data\libx265\3.2.1\_\_\build\e82f74c25b82d272dbcd1630371590cd62192d65\build_subfolder --target install -- -j4

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
leyewencommented, Apr 3, 2020

@uilianries Please try again with options:

# libx265
libx265:shared=True
0reactions
uilianriescommented, Mar 26, 2020

@leyewen I tried to reproduce your error, but libx265 looks fine:

https://gist.github.com/uilianries/1df0ba936f6552d597e412b18c84345b

That profile is correct according your description?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Compiling FFMPEG x265 not found using pkg-config
If you run into the Package Config error described in this thread, try installing ... I configure and compile ffmpeg successfully with x265....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found