0

I get several linking errors for Poco projexts with Conan package manage on Windows like the following

.conan\data\poco\1.10.1\_\_\package\d0e9f44a88e404fed65e5d6af2191422fc27fe30\lib\PocoZipmd.lib : warning LNK4272: library machine type 'x64' conflicts with target machine type 'x86'

Any ideas on how to fix it?

My CMakeLists.txt:

    cmake_minimum_required(VERSION 3.11)
    include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
    conan_basic_setup(TARGETS)

    add_executable(md5 md5.cpp)
    target_link_libraries(md5 CONAN_PKG::poco)

My conanifo file is the following:

[settings]
    arch=x86_64
    build_type=Release
    compiler=Visual Studio
    compiler.runtime=MD
    compiler.version=15
    os=Windows

[requires]
    poco/1.Y.Z

[options]


[full_settings]
    arch=x86_64
    build_type=Release
    compiler=Visual Studio
    compiler.runtime=MD
    compiler.version=15
    os=Windows

[full_requires]
    openssl/1.1.1g:6cc50b139b9c3d27b3e9042d5f5372d327b3a9f7
    poco/1.10.1:d0e9f44a88e404fed65e5d6af2191422fc27fe30

...
Theo Niko
  • 27
  • 5
  • You seem to have an architecture conflict. What commands are you using to run? – Kevin May 09 '20 at 17:05
  • conan install .. cmake .. -G"Visual Studio 15 2017" cmake --build . – Theo Niko May 09 '20 at 17:12
  • Because you do not specify an architecture when running `cmake` on the command line, the default generator is `Win32`. Try running `cmake .. -G"Visual Studio 15 2017" -A x64` instead. See the documentation [here](https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2015%202017.html). – Kevin May 09 '20 at 17:25
  • Thank you. It is fixed now but i still get some new linking erros like PocoFoundationmd.lib(Bugcheck.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in md5.obj when i try cmake --build . --config Debug. The command cmake --build . --config Release is working fine. Do you see any obvious mistake for those linking erros in debug case? – Theo Niko May 09 '20 at 17:37
  • 1
    Changing from MDd to MD in the CMAKE_CXX_FLAGS_DEBUG, resolves the issue in case of Debug as well. Thread can be closed.@squareskittles:Thank a lot for your feedback – Theo Niko May 09 '20 at 17:55

0 Answers0