conan-io / conan-center-index

Recipes for the ConanCenter repository
https://conan.io/center
MIT License
963 stars 1.77k forks source link

[package] libelf/0.18.13: Build error when using mingw #25275

Open joda01 opened 1 month ago

joda01 commented 1 month ago

Description

When building libelf using Mingw under Windows follwing build error occurs:

C:\Users\runneradmin\.conan2\p\b\libel28c31abd87fda\b\src\lib\version.c: In function 'elf_version':
C:\Users\runneradmin\.conan2\p\b\libel28c31abd87fda\b\src\lib\version.c:31:14: error: implicit declaration of function 'getenv' [-Wimplicit-function-declaration]
   31 |     if ((s = getenv("LIBELF_SANITY_CHECKS"))) {
      |              ^~~~~~
C:\Users\runneradmin\.conan2\p\b\libel28c31abd87fda\b\src\lib\version.c:21:1: note: 'getenv' is defined in header '<stdlib.h>'; this is probably fixable by adding '#include <stdlib.h>'
   20 | #include <private.h>
  +++ |+#include <stdlib.h>
   21 | 
C:\Users\runneradmin\.conan2\p\b\libel28c31abd87fda\b\src\lib\version.c:31:12: error: assignment to 'const char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
   31 |     if ((s = getenv("LIBELF_SANITY_CHECKS"))) {

Package and Environment Details

Conan profile

[settings] arch=x86_64 build_type=Release compiler=gcc compiler.cppstd=17 compiler.libcxx=libstdc++11 compiler.version=11 os=Windows

[conf] tools.system.package_manager:mode=install

[options] qt/:qtsvg=True qt/:qtcharts=True qt/:with_pq=False qt/:with_odbc=False qt/:with_sqlite3=False qt/:shared=True libxlsxwriter/*:md5=False

[buildenv] PATH=+D:/a/_temp/msys64/mingw64/bin;D:/a/_temp/msys64/usr/bin CC=D:/a/_temp/msys64/mingw64/bin/gcc.exe CXX=D:/a/_temp/msys64/mingw64/bin/g++.exe

[runenv] PATH=+D:/a/_temp/msys64/mingw64/bin;D:/a/_temp/msys64/usr/bin CC=D:/a/_temp/msys64/mingw64/bin/gcc.exe CXX=D:/a/_temp/msys64/mingw64/bin/g++.exe

Steps to reproduce

Use following conan.py

from conan import ConanFile
from conan.tools.cmake import cmake_layout

class Test(ConanFile):
    name = "Test"
    version = "1.0"
    license = "AGPL"
    settings = "os", "compiler", "build_type", "arch"
    generators = "CMakeDeps", "CMakeToolchain"
    exports_sources = "src/*"

    def requirements(self):
        self.requires("qt/6.7.1")
        self.requires("libpq/15.5", override=True)
    def layout(self):
        cmake_layout(self)

Logs

Click to expand log ``` "C:/Users/runneradmin/.conan2/p/b/libde5ce7fb16541d1/p" 2024-09-15T17:41:27.9112482Z -- Install configuration: "Release" 2024-09-15T17:41:27.9117453Z -- Installing: C:/Users/runneradmin/.conan2/p/b/libde5ce7fb16541d1/p/lib/libdeflate.a 2024-09-15T17:41:27.9130376Z -- Installing: C:/Users/runneradmin/.conan2/p/b/libde5ce7fb16541d1/p/include/libdeflate.h 2024-09-15T17:41:27.9142830Z -- Installing: C:/Users/runneradmin/.conan2/p/b/libde5ce7fb16541d1/p/lib/pkgconfig/libdeflate.pc 2024-09-15T17:41:27.9155854Z -- Installing: C:/Users/runneradmin/.conan2/p/b/libde5ce7fb16541d1/p/lib/cmake/libdeflate/libdeflate-targets.cmake 2024-09-15T17:41:27.9165683Z -- Installing: C:/Users/runneradmin/.conan2/p/b/libde5ce7fb16541d1/p/lib/cmake/libdeflate/libdeflate-targets-release.cmake 2024-09-15T17:41:27.9175121Z -- Installing: C:/Users/runneradmin/.conan2/p/b/libde5ce7fb16541d1/p/lib/cmake/libdeflate/libdeflate-config.cmake 2024-09-15T17:41:27.9186115Z -- Installing: C:/Users/runneradmin/.conan2/p/b/libde5ce7fb16541d1/p/lib/cmake/libdeflate/libdeflate-config-version.cmake 2024-09-15T17:41:27.9236053Z 2024-09-15T17:41:27.9269226Z libdeflate/1.19: package(): Packaged 1 '.h' file: libdeflate.h 2024-09-15T17:41:27.9270247Z libdeflate/1.19: package(): Packaged 1 '.a' file: libdeflate.a 2024-09-15T17:41:27.9270959Z libdeflate/1.19: package(): Packaged 1 file: COPYING 2024-09-15T17:41:27.9271676Z libdeflate/1.19: Created package revision 06cb3197045d3523915fa5fbf9cf1a96 2024-09-15T17:41:27.9272681Z libdeflate/1.19: Package '86b06ec12f1ccc8db0d3e1aa94c57fb99817ce55' created 2024-09-15T17:41:27.9274090Z libdeflate/1.19: Full package reference: libdeflate/1.19#3ea74a4549efc14d4b1202dc4bfbf602:86b06ec12f1ccc8db0d3e1aa94c57fb99817ce55#06cb3197045d3523915fa5fbf9cf1a96 2024-09-15T17:41:27.9544479Z libdeflate/1.19: Package folder C:\Users\runneradmin\.conan2\p\b\libde5ce7fb16541d1\p 2024-09-15T17:41:27.9952339Z libelf/0.8.13: Sources downloaded from 'conancenter' 2024-09-15T17:41:27.9974115Z libelf/0.8.13: Calling source() in C:\Users\runneradmin\.conan2\p\libelfab0e0f1e87fa\s\src 2024-09-15T17:41:28.1773464Z libelf/0.8.13: Unzipping libelf-0.8.13.tar.gz to . 2024-09-15T17:41:28.7122406Z 2024-09-15T17:41:28.7123419Z -------- Installing package libelf/0.8.13 (13 of 65) -------- 2024-09-15T17:41:28.7124152Z libelf/0.8.13: Building from source 2024-09-15T17:41:28.7124808Z libelf/0.8.13: Package libelf/0.8.13:86b06ec12f1ccc8db0d3e1aa94c57fb99817ce55 2024-09-15T17:41:28.7142407Z libelf/0.8.13: Copying sources to build folder 2024-09-15T17:41:29.2956997Z libelf/0.8.13: Building your package in C:\Users\runneradmin\.conan2\p\b\libel28c31abd87fda\b 2024-09-15T17:41:29.2958228Z libelf/0.8.13: Calling generate() 2024-09-15T17:41:29.2959195Z libelf/0.8.13: Generators folder: C:\Users\runneradmin\.conan2\p\b\libel28c31abd87fda\b\build\Release\generators 2024-09-15T17:41:29.3514231Z libelf/0.8.13: CMakeToolchain generated: conan_toolchain.cmake 2024-09-15T17:41:29.3524427Z libelf/0.8.13: CMakeToolchain generated: C:\Users\runneradmin\.conan2\p\b\libel28c31abd87fda\b\build\Release\generators\CMakePresets.json 2024-09-15T17:41:29.4106724Z libelf/0.8.13: Generating aggregated env files 2024-09-15T17:41:29.4108182Z libelf/0.8.13: Generated aggregated env files: ['conanbuild.bat', 'conanrun.bat'] 2024-09-15T17:41:29.4113756Z libelf/0.8.13: Calling build() 2024-09-15T17:41:29.4116158Z libelf/0.8.13: Running CMake.configure() 2024-09-15T17:41:29.4121139Z libelf/0.8.13: RUN: cmake -G "MinGW Makefiles" -DCMAKE_TOOLCHAIN_FILE="generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="C:/Users/runneradmin/.conan2/p/b/libel28c31abd87fda/p" -DCMAKE_SH="CMAKE_SH-NOTFOUND" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" -DCMAKE_BUILD_TYPE="Release" "C:/Users/runneradmin/.conan2/p/b/libel28c31abd87fda/b/src/.." 2024-09-15T17:41:29.4938613Z CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required): 2024-09-15T17:41:29.4940630Z Compatibility with CMake < 3.5 will be removed from a future version of 2024-09-15T17:41:29.4941734Z CMake. 2024-09-15T17:41:29.4941990Z 2024-09-15T17:41:29.4942520Z Update the VERSION argument value or use a ... suffix to tell 2024-09-15T17:41:29.4943835Z CMake that the project does not need compatibility with older versions. 2024-09-15T17:41:29.4944758Z 2024-09-15T17:41:29.4944767Z 2024-09-15T17:41:29.4953120Z -- Using Conan toolchain: C:/Users/runneradmin/.conan2/p/b/libel28c31abd87fda/b/build/Release/generators/conan_toolchain.cmake 2024-09-15T17:41:29.4954327Z -- Conan toolchain: Defining architecture flag: -m64 2024-09-15T17:41:29.4955166Z -- Conan toolchain: Setting BUILD_SHARED_LIBS = OFF 2024-09-15T17:41:29.6741076Z -- The C compiler identification is GNU 14.2.0 2024-09-15T17:41:29.8331303Z -- Detecting C compiler ABI info 2024-09-15T17:41:30.2763092Z -- Detecting C compiler ABI info - done 2024-09-15T17:41:30.3091341Z -- Check for working C compiler: D:/a/_temp/msys64/mingw64/bin/gcc.exe - skipped 2024-09-15T17:41:30.3095423Z -- Detecting C compile features 2024-09-15T17:41:30.3102001Z -- Detecting C compile features - done 2024-09-15T17:41:30.3168432Z -- Configuring done (0.8s) 2024-09-15T17:41:30.3527619Z -- Generating done (0.0s) 2024-09-15T17:41:30.3528138Z CMake Warning: 2024-09-15T17:41:30.3528854Z Manually-specified variables were not used by the project: 2024-09-15T17:41:30.3529301Z 2024-09-15T17:41:30.3529408Z CMAKE_SH 2024-09-15T17:41:30.3529589Z 2024-09-15T17:41:30.3529595Z 2024-09-15T17:41:30.3539672Z -- Build files have been written to: C:/Users/runneradmin/.conan2/p/b/libel28c31abd87fda/b/build/Release 2024-09-15T17:41:30.3611996Z 2024-09-15T17:41:30.3612995Z libelf/0.8.13: Running CMake.build() 2024-09-15T17:41:30.3617451Z libelf/0.8.13: RUN: cmake --build "C:\Users\runneradmin\.conan2\p\b\libel28c31abd87fda\b\build\Release" -- -j4 2024-09-15T17:41:30.5252992Z [ 1%] Building C object CMakeFiles/elf.dir/src/lib/32.fsize.c.obj 2024-09-15T17:41:30.5284449Z [ 3%] Building C object CMakeFiles/elf.dir/src/lib/32.getehdr.c.obj 2024-09-15T17:41:30.5364869Z [ 7%] Building C object CMakeFiles/elf.dir/src/lib/32.getshdr.c.obj 2024-09-15T17:41:30.5371368Z [ 5%] Building C object CMakeFiles/elf.dir/src/lib/32.getphdr.c.obj 2024-09-15T17:41:30.6689022Z [ 8%] Building C object CMakeFiles/elf.dir/src/lib/32.newehdr.c.obj 2024-09-15T17:41:30.6717630Z [ 10%] Building C object CMakeFiles/elf.dir/src/lib/32.newphdr.c.obj 2024-09-15T17:41:30.7024464Z [ 14%] Building C object CMakeFiles/elf.dir/src/lib/64.xlatetof.c.obj 2024-09-15T17:41:30.7025886Z [ 12%] Building C object CMakeFiles/elf.dir/src/lib/32.xlatetof.c.obj 2024-09-15T17:41:30.7527081Z C:\Users\runneradmin\.conan2\p\b\libel28c31abd87fda\b\src\lib\32.newphdr.c: In function 'gelf_newphdr': 2024-09-15T17:41:30.7571779Z C:\Users\runneradmin\.conan2\p\b\libel28c31abd87fda\b\src\lib\32.newphdr.c:115:12: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] 2024-09-15T17:41:30.7575423Z 115 | return (unsigned long)_elf_newphdr(elf, phnum, elf->e_class); 2024-09-15T17:41:30.7600863Z | ^ 2024-09-15T17:41:30.7637089Z C:\Users\runneradmin\.conan2\p\b\libel28c31abd87fda\b\src\lib\32.newehdr.c: In function 'gelf_newehdr': 2024-09-15T17:41:30.7694595Z C:\Users\runneradmin\.conan2\p\b\libel28c31abd87fda\b\src\lib\32.newehdr.c:77:12: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] 2024-09-15T17:41:30.7860750Z 77 | return (unsigned long)_elf_newehdr(elf, cls); 2024-09-15T17:41:30.7863993Z | ^ 2024-09-15T17:41:30.8610176Z [ 16%] Building C object CMakeFiles/elf.dir/src/lib/begin.c.obj 2024-09-15T17:41:30.8642233Z [ 17%] Building C object CMakeFiles/elf.dir/src/lib/assert.c.obj 2024-09-15T17:41:31.0051923Z [ 19%] Building C object CMakeFiles/elf.dir/src/lib/checksum.c.obj 2024-09-15T17:41:31.1757015Z [ 21%] Building C object CMakeFiles/elf.dir/src/lib/cntl.c.obj 2024-09-15T17:41:31.2751043Z [ 23%] Building C object CMakeFiles/elf.dir/src/lib/cook.c.obj 2024-09-15T17:41:31.3685439Z [ 25%] Building C object CMakeFiles/elf.dir/src/lib/data.c.obj 2024-09-15T17:41:31.4952158Z [ 26%] Building C object CMakeFiles/elf.dir/src/lib/end.c.obj 2024-09-15T17:41:31.5469467Z [ 28%] Building C object CMakeFiles/elf.dir/src/lib/errmsg.c.obj 2024-09-15T17:41:31.6479651Z [ 30%] Building C object CMakeFiles/elf.dir/src/lib/errno.c.obj 2024-09-15T17:41:31.6763999Z [ 32%] Building C object CMakeFiles/elf.dir/src/lib/fill.c.obj 2024-09-15T17:41:31.7676826Z [ 33%] Building C object CMakeFiles/elf.dir/src/lib/flag.c.obj 2024-09-15T17:41:31.7774799Z [ 35%] Building C object CMakeFiles/elf.dir/src/lib/gelfehdr.c.obj 2024-09-15T17:41:31.7923536Z [ 37%] Building C object CMakeFiles/elf.dir/src/lib/gelfphdr.c.obj 2024-09-15T17:41:31.8654407Z C:\Users\runneradmin\.conan2\p\b\libel28c31abd87fda\b\src\lib\gelfehdr.c: In function 'gelf_getehdr': 2024-09-15T17:41:31.8675593Z C:\Users\runneradmin\.conan2\p\b\libel28c31abd87fda\b\src\lib\gelfehdr.c:93:1: warning: function may return address of local variable [-Wreturn-local-addr] 2024-09-15T17:41:31.8686903Z 93 | } 2024-09-15T17:41:31.8703227Z | ^ 2024-09-15T17:41:31.8730186Z C:\Users\runneradmin\.conan2\p\b\libel28c31abd87fda\b\src\lib\gelfehdr.c:40:15: note: declared here 2024-09-15T17:41:31.8732541Z 40 | GElf_Ehdr buf; 2024-09-15T17:41:31.8733650Z | ^~~ 2024-09-15T17:41:31.8738739Z C:\Users\runneradmin\.conan2\p\b\libel28c31abd87fda\b\src\lib\gelfphdr.c: In function 'gelf_getphdr': 2024-09-15T17:41:31.8741277Z C:\Users\runneradmin\.conan2\p\b\libel28c31abd87fda\b\src\lib\gelfphdr.c:97:1: warning: function may return address of local variable [-Wreturn-local-addr] 2024-09-15T17:41:31.8777493Z 97 | } 2024-09-15T17:41:31.8821977Z | ^ 2024-09-15T17:41:31.8824864Z C:\Users\runneradmin\.conan2\p\b\libel28c31abd87fda\b\src\lib\gelfphdr.c:40:15: note: declared here 2024-09-15T17:41:31.8826545Z 40 | GElf_Phdr buf; 2024-09-15T17:41:31.8882979Z | ^~~ 2024-09-15T17:41:31.8954605Z [ 39%] Building C object CMakeFiles/elf.dir/src/lib/gelfshdr.c.obj 2024-09-15T17:41:31.9520557Z [ 41%] Building C object CMakeFiles/elf.dir/src/lib/gelftrans.c.obj 2024-09-15T17:41:31.9599337Z C:\Users\runneradmin\.conan2\p\b\libel28c31abd87fda\b\src\lib\gelfshdr.c: In function 'gelf_getshdr': 2024-09-15T17:41:31.9620893Z C:\Users\runneradmin\.conan2\p\b\libel28c31abd87fda\b\src\lib\gelfshdr.c:86:1: warning: function may return address of local variable [-Wreturn-local-addr] 2024-09-15T17:41:31.9630709Z 86 | } 2024-09-15T17:41:31.9631776Z | ^ 2024-09-15T17:41:31.9632947Z C:\Users\runneradmin\.conan2\p\b\libel28c31abd87fda\b\src\lib\gelfshdr.c:40:15: note: declared here 2024-09-15T17:41:31.9635697Z 40 | GElf_Shdr buf; 2024-09-15T17:41:31.9636808Z | ^~~ 2024-09-15T17:41:31.9876330Z [ 42%] Building C object CMakeFiles/elf.dir/src/lib/getarhdr.c.obj 2024-09-15T17:41:32.0144397Z C:\Users\runneradmin\.conan2\p\b\libel28c31abd87fda\b\src\lib\gelftrans.c: In function 'gelf_getsym': 2024-09-15T17:41:32.0321467Z C:\Users\runneradmin\.conan2\p\b\libel28c31abd87fda\b\src\lib\gelftrans.c:146:1: warning: function may return address of local variable [-Wreturn-local-addr] 2024-09-15T17:41:32.0344352Z 146 | } 2024-09-15T17:41:32.0345559Z | ^ 2024-09-15T17:41:32.0371595Z C:\Users\runneradmin\.conan2\p\b\libel28c31abd87fda\b\src\lib\gelftrans.c:109:14: note: declared here 2024-09-15T17:41:32.0374815Z 109 | GElf_Sym buf; 2024-09-15T17:41:32.0377258Z | ^~~ 2024-09-15T17:41:32.0413285Z [ 44%] Building C object CMakeFiles/elf.dir/src/lib/getaroff.c.obj 2024-09-15T17:41:32.0415095Z C:\Users\runneradmin\.conan2\p\b\libel28c31abd87fda\b\src\lib\gelftrans.c: In function 'gelf_getdyn': 2024-09-15T17:41:32.0417728Z C:\Users\runneradmin\.conan2\p\b\libel28c31abd87fda\b\src\lib\gelftrans.c:212:1: warning: function may return address of local variable [-Wreturn-local-addr] 2024-09-15T17:41:32.0419309Z 212 | } 2024-09-15T17:41:32.0419735Z | ^ 2024-09-15T17:41:32.0420727Z C:\Users\runneradmin\.conan2\p\b\libel28c31abd87fda\b\src\lib\gelftrans.c:179:14: note: declared here 2024-09-15T17:41:32.0421875Z 179 | GElf_Dyn buf; 2024-09-15T17:41:32.0422367Z | ^~~ 2024-09-15T17:41:32.0558980Z C:\Users\runneradmin\.conan2\p\b\libel28c31abd87fda\b\src\lib\gelftrans.c: In function 'gelf_getrela': 2024-09-15T17:41:32.0561282Z C:\Users\runneradmin\.conan2\p\b\libel28c31abd87fda\b\src\lib\gelftrans.c:276:1: warning: function may return address of local variable [-Wreturn-local-addr] 2024-09-15T17:41:32.0562733Z 276 | } 2024-09-15T17:41:32.0563054Z | ^ 2024-09-15T17:41:32.0565297Z C:\Users\runneradmin\.conan2\p\b\libel28c31abd87fda\b\src\lib\gelftrans.c:241:15: note: declared here 2024-09-15T17:41:32.0566415Z 241 | GElf_Rela buf; 2024-09-15T17:41:32.0566857Z | ^~~ 2024-09-15T17:41:32.0807622Z C:\Users\runneradmin\.conan2\p\b\libel28c31abd87fda\b\src\lib\gelftrans.c: In function 'gelf_getrel': 2024-09-15T17:41:32.0833544Z C:\Users\runneradmin\.conan2\p\b\libel28c31abd87fda\b\src\lib\gelftrans.c:346:1: warning: function may return address of local variable [-Wreturn-local-addr] 2024-09-15T17:41:32.0843650Z 346 | } 2024-09-15T17:41:32.0866823Z | ^ 2024-09-15T17:41:32.0881457Z C:\Users\runneradmin\.conan2\p\b\libel28c31abd87fda\b\src\lib\gelftrans.c:312:14: note: declared here 2024-09-15T17:41:32.0884256Z 312 | GElf_Rel buf; 2024-09-15T17:41:32.0885153Z | ^~~ 2024-09-15T17:41:32.1321932Z [ 46%] Building C object CMakeFiles/elf.dir/src/lib/getarsym.c.obj 2024-09-15T17:41:32.1592543Z [ 48%] Building C object CMakeFiles/elf.dir/src/lib/getbase.c.obj 2024-09-15T17:41:32.1658107Z [ 50%] Building C object CMakeFiles/elf.dir/src/lib/getdata.c.obj 2024-09-15T17:41:32.2641804Z [ 51%] Building C object CMakeFiles/elf.dir/src/lib/getident.c.obj 2024-09-15T17:41:32.3236189Z [ 53%] Building C object CMakeFiles/elf.dir/src/lib/getscn.c.obj 2024-09-15T17:41:32.3332057Z [ 55%] Building C object CMakeFiles/elf.dir/src/lib/hash.c.obj 2024-09-15T17:41:32.3863773Z [ 57%] Building C object CMakeFiles/elf.dir/src/lib/input.c.obj 2024-09-15T17:41:32.4505861Z [ 58%] Building C object CMakeFiles/elf.dir/src/lib/kind.c.obj 2024-09-15T17:41:32.4568772Z [ 60%] Building C object CMakeFiles/elf.dir/src/lib/memset.c.obj 2024-09-15T17:41:32.5332951Z [ 62%] Building C object CMakeFiles/elf.dir/src/lib/ndxscn.c.obj 2024-09-15T17:41:32.5640308Z [ 64%] Building C object CMakeFiles/elf.dir/src/lib/newdata.c.obj 2024-09-15T17:41:32.5734726Z [ 66%] Building C object CMakeFiles/elf.dir/src/lib/newscn.c.obj 2024-09-15T17:41:32.5938309Z [ 67%] Building C object CMakeFiles/elf.dir/src/lib/next.c.obj 2024-09-15T17:41:32.6545862Z [ 69%] Building C object CMakeFiles/elf.dir/src/lib/nextscn.c.obj 2024-09-15T17:41:32.7196411Z [ 71%] Building C object CMakeFiles/elf.dir/src/lib/nlist.c.obj 2024-09-15T17:41:32.7282950Z [ 73%] Building C object CMakeFiles/elf.dir/src/lib/opt.delscn.c.obj 2024-09-15T17:41:32.7548022Z [ 75%] Building C object CMakeFiles/elf.dir/src/lib/rand.c.obj 2024-09-15T17:41:32.7742944Z [ 76%] Building C object CMakeFiles/elf.dir/src/lib/rawdata.c.obj 2024-09-15T17:41:32.8868633Z [ 78%] Building C object CMakeFiles/elf.dir/src/lib/rawfile.c.obj 2024-09-15T17:41:32.9141886Z [ 80%] Building C object CMakeFiles/elf.dir/src/lib/strptr.c.obj 2024-09-15T17:41:32.9153482Z [ 82%] Building C object CMakeFiles/elf.dir/src/lib/swap64.c.obj 2024-09-15T17:41:32.9210867Z [ 83%] Building C object CMakeFiles/elf.dir/src/lib/update.c.obj 2024-09-15T17:41:33.0196333Z [ 85%] Building C object CMakeFiles/elf.dir/src/lib/verdef_32_tof.c.obj 2024-09-15T17:41:33.0771911Z [ 87%] Building C object CMakeFiles/elf.dir/src/lib/verdef_32_tom.c.obj 2024-09-15T17:41:33.0868350Z [ 89%] Building C object CMakeFiles/elf.dir/src/lib/verdef_64_tof.c.obj 2024-09-15T17:41:33.3133752Z [ 91%] Building C object CMakeFiles/elf.dir/src/lib/verdef_64_tom.c.obj 2024-09-15T17:41:33.3187783Z [ 92%] Building C object CMakeFiles/elf.dir/src/lib/version.c.obj 2024-09-15T17:41:33.3209934Z [ 94%] Building C object CMakeFiles/elf.dir/src/lib/x.elfext.c.obj 2024-09-15T17:41:33.3853928Z C:\Users\runneradmin\.conan2\p\b\libel28c31abd87fda\b\src\lib\version.c: In function 'elf_version': 2024-09-15T17:41:33.3859511Z C:\Users\runneradmin\.conan2\p\b\libel28c31abd87fda\b\src\lib\version.c:31:14: error: implicit declaration of function 'getenv' [-Wimplicit-function-declaration] 2024-09-15T17:41:33.3878338Z 31 | if ((s = getenv("LIBELF_SANITY_CHECKS"))) { 2024-09-15T17:41:33.3882839Z | ^~~~~~ 2024-09-15T17:41:33.3888093Z C:\Users\runneradmin\.conan2\p\b\libel28c31abd87fda\b\src\lib\version.c:21:1: note: 'getenv' is defined in header ''; this is probably fixable by adding '#include ' 2024-09-15T17:41:33.3890863Z 20 | #include 2024-09-15T17:41:33.3892164Z +++ |+#include 2024-09-15T17:41:33.3892689Z 21 | 2024-09-15T17:41:33.3894513Z C:\Users\runneradmin\.conan2\p\b\libel28c31abd87fda\b\src\lib\version.c:31:12: error: assignment to 'const char *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 2024-09-15T17:41:33.3896323Z 31 | if ((s = getenv("LIBELF_SANITY_CHECKS"))) { 2024-09-15T17:41:33.3896963Z | ^ 2024-09-15T17:41:33.3898740Z C:\Users\runneradmin\.conan2\p\b\libel28c31abd87fda\b\src\lib\version.c:32:35: error: implicit declaration of function 'strtol'; did you mean 'strtok'? [-Wimplicit-function-declaration] 2024-09-15T17:41:33.3900668Z 32 | _elf_sanity_checks = (int)strtol(s, (char**)NULL, 0); 2024-09-15T17:41:33.3901634Z | ^~~~~~ 2024-09-15T17:41:33.3902565Z | strtok 2024-09-15T17:41:33.3903400Z [ 96%] Building C object CMakeFiles/elf.dir/src/lib/x.movscn.c.obj 2024-09-15T17:41:33.3910828Z mingw32-make[2]: *** [CMakeFiles\elf.dir\build.make:841: CMakeFiles/elf.dir/src/lib/version.c.obj] Error 1 2024-09-15T17:41:33.3912340Z mingw32-make[2]: *** Waiting for unfinished jobs.... 2024-09-15T17:41:33.5024734Z mingw32-make[1]: *** [CMakeFiles\Makefile2:82: CMakeFiles/elf.dir/all] Error 2 2024-09-15T17:41:33.5035231Z mingw32-make: *** [Makefile:135: all] Error 2 2024-09-15T17:41:33.5092572Z 2024-09-15T17:41:33.5107843Z libelf/0.8.13: ERROR: 2024-09-15T17:41:33.5108624Z Package '86b06ec12f1ccc8db0d3e1aa94c57fb99817ce55' build failed 2024-09-15T17:41:33.5109966Z libelf/0.8.13: WARN: Build folder C:\Users\runneradmin\.conan2\p\b\libel28c31abd87fda\b\build\Release 2024-09-15T17:41:33.5112508Z ERROR: libelf/0.8.13: Error in build() method, line 88 2024-09-15T17:41:33.5112975Z cmake.build() 2024-09-15T17:41:33.5113276Z ConanException: Error 2 while executing 2024-09-15T17:41:33.6685134Z ##[error]Process completed with exit code 1. ```
vinaykashyaphr commented 1 month ago

Hello,

I was using:

self.requires("libxml2/2.12.7")
self.requires("qt/6.7.1")

I have changed to:

self.requires("libxml2/2.12.7", override=True)
self.requires("qt/6.7.1", override=True)

now it is working fine. I think libxml and qt have used older version of libelf which is varying from current latest version of libelf from ConanCenter.

here is my conanfile.py:

from conan import ConanFile

class ProjectRecipe(ConanFile):
    settings = ("os", "compiler", "build_type", "arch")
    generators = ("CMakeDeps", "CMakeToolchain")

    def requirements(self):
        self.requires("libxml2/2.12.7", override=True)
        self.requires("qt/6.7.1", override=True)

    def build_requirements(self):
        self.tool_requires("cmake/[>=3.30.0]")

    def configure(self):
        self.options["qt/*"].shared = False
        self.options["qt/*"].qmultimedia = True

    def layout(self):
        self.folders.build = "build"
        self.folders.source = "src"
        self.folders.generators = "build"

I think this might help you.

Regards, Vinay Kashyap

joda01 commented 1 month ago

@vinaykashyaphr Thank's a lot, this helps!