Bug #1266

CMake fails to link zlib with debug config using msvc 2015.

Added by Ben Touchette 7 months ago. Updated 7 months ago.

Status:ClosedStart date:10 Dec 2016
Priority:NormalDue date:13 Dec 2016
Assignee:Ben Touchette% Done:

100%

Category:buildEstimated time:10.00 hours
Target version:0.26

Description

Compilation fails for exiv2 and samples when using CMake with MS VS 2015 Community Edition and gives link errors about missing zlib symbols.

CMakeLists.txt is missing the zlib target_link_libraries and fails. Add this line before the expat one in the msvc check fixes the issue:

TARGET_LINK_LIBRARIES( exiv2lib ${PRIVATE_VAR} ${ZLIB_LIBRARIES} )

Adding patch for comments.

exiv2-cmake-msvc-2015-link-patch.diff Magnifier (582 Bytes) Ben Touchette, 10 Dec 2016 17:58

Associated revisions

Revision 4696
Added by Ben Touchette 7 months ago

#1266 Add path to zlib for cmake msvc to src/CMakeList.txt to fix debug buildtype build issues

History

#1 Updated by Robin Mills 7 months ago

  • Category set to build
  • Assignee set to Robin Mills
  • Target version set to 0.26

Your patch looks good. However I'm wondering how you are building Exiv2/CMake/MSVC as the buildserver has successfully built this without the patch!

So my questions is: "What are you doing and why?" If you want to debug code in VS2015, I recommend you keep away from CMake. Open msvc/exiv2.sln. The convertor will take about 5 minutes to run (why is it so slow?). Then build. Set your breakpoints and execute exiv2.exe

I see Daniel has added entries concerning CURL (and SSH) that look suspicious to me. CURL should only be linked when EXIV2_ENABLE_CURL is set.

#2 Updated by Ben Touchette 7 months ago

I don't disagree with any of the particulars, except i have a client that uses CMake in their build process and have the support libraries outside the standard paths thus it requires passing them to do CMake during the configuration phase where it finds them but fails on finding the specified path without that patch when building for the debug target during the actual build at which point the linker complains of not find it. Setting the build to release works fine though without the changes.

#3 Updated by Robin Mills 7 months ago

  • Status changed from New to Assigned
  • Assignee changed from Robin Mills to Ben Touchette

Well, if your patch is working for you, I am happy. The daily build performed for VS2015 is release/x64 and release/win32. I'll check tomorrow that it hasn't broken.

It's useful that you are working with CMake/MSVC. There may be more pain ahead, however it's only by using those horrors that we can find and fix such mysterious behaviour.

I've assigned this to you. When you're happy, please close this, set the done to 100 and update "estimated time" to account for your effort.

#4 Updated by Ben Touchette 7 months ago

I don't think it will be broken, as it worked here. Only the debug version had the issue. I'll take care of updating it tomorrow, having a rather awful morning right now and i think i need to stay away from anything critical, lol, smh.

#5 Updated by Ben Touchette 7 months ago

  • Due date set to 13 Dec 2016
  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100
  • Estimated time set to 10.00

closing.

Also available in: Atom PDF

Redmine Appliance - Powered by TurnKey Linux