{"action":"created","issue":{"url":"https://api.github.com/repos/conan-io/conan/issues/4206","repository_url":"https://api.github.com/repos/conan-io/conan","labels_url":"https://api.github.com/repos/conan-io/conan/issues/4206/labels{/name}","comments_url":"https://api.github.com/repos/conan-io/conan/issues/4206/comments","events_url":"https://api.github.com/repos/conan-io/conan/issues/4206/events","html_url":"https://github.com/conan-io/conan/issues/4206","id":394527011,"node_id":"MDU6SXNzdWUzOTQ1MjcwMTE=","number":4206,"title":"Library Incompatibility","user":{"login":"kenfred","id":1280936,"node_id":"MDQ6VXNlcjEyODA5MzY=","avatar_url":"https://avatars3.githubusercontent.com/u/1280936?v=4","gravatar_id":"","url":"https://api.github.com/users/kenfred","html_url":"https://github.com/kenfred","followers_url":"https://api.github.com/users/kenfred/followers","following_url":"https://api.github.com/users/kenfred/following{/other_user}","gists_url":"https://api.github.com/users/kenfred/gists{/gist_id}","starred_url":"https://api.github.com/users/kenfred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kenfred/subscriptions","organizations_url":"https://api.github.com/users/kenfred/orgs","repos_url":"https://api.github.com/users/kenfred/repos","events_url":"https://api.github.com/users/kenfred/events{/privacy}","received_events_url":"https://api.github.com/users/kenfred/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"jgsogo","id":1406456,"node_id":"MDQ6VXNlcjE0MDY0NTY=","avatar_url":"https://avatars2.githubusercontent.com/u/1406456?v=4","gravatar_id":"","url":"https://api.github.com/users/jgsogo","html_url":"https://github.com/jgsogo","followers_url":"https://api.github.com/users/jgsogo/followers","following_url":"https://api.github.com/users/jgsogo/following{/other_user}","gists_url":"https://api.github.com/users/jgsogo/gists{/gist_id}","starred_url":"https://api.github.com/users/jgsogo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgsogo/subscriptions","organizations_url":"https://api.github.com/users/jgsogo/orgs","repos_url":"https://api.github.com/users/jgsogo/repos","events_url":"https://api.github.com/users/jgsogo/events{/privacy}","received_events_url":"https://api.github.com/users/jgsogo/received_events","type":"User","site_admin":false},"assignees":[{"login":"jgsogo","id":1406456,"node_id":"MDQ6VXNlcjE0MDY0NTY=","avatar_url":"https://avatars2.githubusercontent.com/u/1406456?v=4","gravatar_id":"","url":"https://api.github.com/users/jgsogo","html_url":"https://github.com/jgsogo","followers_url":"https://api.github.com/users/jgsogo/followers","following_url":"https://api.github.com/users/jgsogo/following{/other_user}","gists_url":"https://api.github.com/users/jgsogo/gists{/gist_id}","starred_url":"https://api.github.com/users/jgsogo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgsogo/subscriptions","organizations_url":"https://api.github.com/users/jgsogo/orgs","repos_url":"https://api.github.com/users/jgsogo/repos","events_url":"https://api.github.com/users/jgsogo/events{/privacy}","received_events_url":"https://api.github.com/users/jgsogo/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2018-12-28T02:01:25Z","updated_at":"2018-12-28T08:37:35Z","closed_at":null,"author_association":"NONE","body":"I'm getting a library incompatibility error and the architecture of the library conan built doesn't match `conaninfo.txt`.\r\n\r\nVersion and Platform Info:\r\nConan version: 1.10.2 or 1.11.1\r\nI am using conan's GCC8 docker image and I have updated to the latest version of Conan (1.11.1).\r\n\r\nWhat happened:\r\nI told conan to build a 32-bit package. \r\n\r\n```bash\r\n> conan create . kenfred/testing -sarch=x86\r\n```\r\nBut I get this error during the package test:\r\n\r\n```bash\r\ni386:x86-64 architecture of input file `/home/conan/.conan/data/cpt_test/1.0.0/kenfred/stable/package/496879c8b4989ea0a448e12aea2f77eba94a3096/lib/libcpt_test.a(Foo.cpp.o)' is incompatible with i386 output\r\n```\r\n\r\nI can see in the `conaninfo.txt` that the arch should be`x86` and inspecting the generated Makefiles, I see `-m32` on `CXX_FLAGS`. But the architecture of the library is indeed x86_64:\r\n```bash\r\n> readelf -h ~/.conan/data/cpt_test/1.0.0/kenfred/stable/package/496879c8b4989ea0a448e12aea2f77eba94a3096/lib/libcpt_test.a | grep 'Class\\|File\\|Machine'\r\nFile: /home/conan/.conan/data/cpt_test/1.0.0/kenfred/stable/package/496879c8b4989ea0a448e12aea2f77eba94a3096/lib/libcpt_test.a(Foo.cpp.o)\r\n  Class:                             ELF64\r\n  Machine:                           Advanced Micro Devices X86-64\r\n```\r\nand\r\n```bash\r\n> objdump -a ~/.conan/data/cpt_test/1.0.0/kenfred/stable/package/496879c8b4989ea0a448e12aea2f77eba94a3096/lib/libcpt_test.a | grep 'file format'\r\nFoo.cpp.o:     file format elf64-x86-64\r\n```\r\n\r\nWhat I expect:\r\nI expect the library to be 32-bit, matching the setting I provided and the metadata in `conaninfo.txt`.\r\n\r\nSteps to reproduce:\r\n- [Clone this repo](https://github.com/kenfred/cpt_test) I made as a simple example\r\n- Attempt to create a 32-bit package: `conan create <name>/<channel> -sarch=x86`)\r\n\r\n\r\n- [x] I've read the [CONTRIBUTING guide](https://github.com/conan-io/conan/blob/develop/.github/CONTRIBUTING.md).\r\n- [x] I've specified the Conan version, operating system version and any tool that can be relevant.\r\n- [x] I've explained the steps to reproduce the error or the motivation/use case of the question/suggestion.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/conan-io/conan/issues/comments/450317953","html_url":"https://github.com/conan-io/conan/issues/4206#issuecomment-450317953","issue_url":"https://api.github.com/repos/conan-io/conan/issues/4206","id":450317953,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MDMxNzk1Mw==","user":{"login":"jgsogo","id":1406456,"node_id":"MDQ6VXNlcjE0MDY0NTY=","avatar_url":"https://avatars2.githubusercontent.com/u/1406456?v=4","gravatar_id":"","url":"https://api.github.com/users/jgsogo","html_url":"https://github.com/jgsogo","followers_url":"https://api.github.com/users/jgsogo/followers","following_url":"https://api.github.com/users/jgsogo/following{/other_user}","gists_url":"https://api.github.com/users/jgsogo/gists{/gist_id}","starred_url":"https://api.github.com/users/jgsogo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgsogo/subscriptions","organizations_url":"https://api.github.com/users/jgsogo/orgs","repos_url":"https://api.github.com/users/jgsogo/repos","events_url":"https://api.github.com/users/jgsogo/events{/privacy}","received_events_url":"https://api.github.com/users/jgsogo/received_events","type":"User","site_admin":false},"created_at":"2018-12-28T08:37:35Z","updated_at":"2018-12-28T08:37:35Z","author_association":"MEMBER","body":"Hi @kenfred \r\n\r\nIn order for Conan to apply all the information (settings, options,...) you need to include the `conanbuildinfo.cmake` in your `CMakeLists.txt`, these two lines:\r\n\r\n```cmake\r\ninclude(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)\r\nconan_basic_setup(TARGETS)\r\n```\r\n\r\nSo, [the `CMakeLists.txt`](https://github.com/kenfred/cpt_test/blob/master/CMakeLists.txt) will be:\r\n\r\n```cmake\r\ncmake_minimum_required(VERSION 3.7)\r\nproject(CptTest)\r\n\r\ninclude(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)\r\nconan_basic_setup(TARGETS)\r\n\r\nadd_library(cpt_test ${CMAKE_CURRENT_SOURCE_DIR}/Foo.cpp)\r\ntarget_include_directories(cpt_test PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})\r\n```\r\n\r\nOnce you include them, it works as expected.\r\n\r\n"}}
{"actor":{"display_login":"jgsogo"}}