Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[package] tk/8.6.10: Linking error when mixing shared and static libraries #25247

Open
cubanpit opened this issue Sep 12, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@cubanpit
Copy link

Description

When trying to build the Tk package as shared, it fails with this set of options:

[options]
expat/*:shared=False
fontconfig/*:shared=True
freetype/*:shared=True
zlib/*:shared=False
tcl/*:shared=True
tk/*:shared=True

While it works by only changing these two:

fontconfig/*:shared=False
freetype/*:shared=False

The error can be seen below in the full log, but it seems that zlib is included in the list of libraries to link to (-lz) while its library folder is not listed (-L/missing/libpath), therefore raising the error /usr/bin/ld: cannot find -lz.

I did not find any obvious reason for this issue, and the change in options was a good-enough solution for my case, but I believe this should work (or if it should not, then it should be more obvious why).

Package and Environment Details

  • Package Name/Version: tk/8.6.10
  • Operating System+version: Linux AlmaLinux 8.4
  • Compiler+version: GCC 12.2
  • Conan version: conan 2.6.0
  • Python version: Python 3.7.4

Conan profile

[settings]
arch=x86_64
build_type=Release
os=Linux
compiler=gcc
compiler.version=12
compiler.libcxx=libstdc++11

Steps to reproduce

conan install --requires=tk/8.6.10 --build='*' -r conancenter

Logs

Click to expand log
bin/gcc -O2  -m64 -O3 -pipe -m64  -DNDEBUG -I/build/.conan2/p/b/fontc27456ffff98db/p/include -I/build/.conan2/p/b/freet412025bec4993/p/include -I/build/.conan2/p/b/freet412025bec4993/p/include/freetype2 -I/build/.conan2/p/b/tclb16d177df42e2/p/include  -m64 -Wl,--as-needed -L/build/.conan2/p/b/fontc27456ffff98db/p/lib -L/build/.conan2/p/b/freet412025bec4993/p/lib -L/build/.conan2/p/b/tclb16d177df42e2/p/lib -shared -o libtk8.6.so tk3d.o tkArgv.o tkAtom.o tkBind.o tkBitmap.o tkBusy.o tkClipboard.o tkCmds.o tkColor.o tkConfig.o tkConsole.o tkCursor.o tkError.o tkEvent.o tkFocus.o tkFont.o tkGet.o tkGC.o tkGeometry.o tkGrab.o tkGrid.o tkMain.o tkObj.o tkOldConfig.o tkOption.o tkPack.o tkPlace.o tkSelect.o tkStyle.o tkUndo.o tkUtil.o tkVisual.o tkWindow.o tkButton.o tkEntry.o tkFrame.o tkListbox.o tkMenu.o tkMenubutton.o tkMenuDraw.o tkMessage.o tkPanedWindow.o tkScale.o tkScrollbar.o tkCanvas.o tkCanvArc.o tkCanvBmap.o tkCanvImg.o tkCanvLine.o tkCanvPoly.o tkCanvPs.o tkCanvText.o tkCanvUtil.o tkCanvWind.o tkRectOval.o tkTrig.o tkImage.o tkImgBmap.o tkImgGIF.o tkImgPNG.o tkImgPPM.o tkImgPhoto.o tkImgPhInstance.o tkText.o tkTextBTree.o tkTextDisp.o tkTextImage.o tkTextIndex.o tkTextMark.o tkTextTag.o tkTextWind.o tkStubInit.o ttkBlink.o ttkButton.o ttkCache.o ttkClamTheme.o ttkClassicTheme.o ttkDefaultTheme.o ttkElements.o ttkEntry.o ttkFrame.o ttkImage.o ttkInit.o ttkLabel.o ttkLayout.o ttkManager.o ttkNotebook.o ttkPanedwindow.o ttkProgress.o ttkScale.o ttkScrollbar.o ttkScroll.o ttkSeparator.o ttkSquare.o ttkState.o ttkTagSet.o ttkTheme.o ttkTrace.o ttkTrack.o ttkTreeview.o ttkWidget.o ttkStubInit.o tkUnix.o tkUnix3d.o tkUnixButton.o tkUnixColor.o tkUnixConfig.o tkUnixCursor.o tkUnixDraw.o tkUnixEmbed.o tkUnixEvent.o tkUnixFocus.o  tkUnixFont.o tkUnixInit.o tkUnixKey.o tkUnixMenu.o tkUnixMenubu.o tkUnixScale.o tkUnixScrlbr.o tkUnixSelect.o tkUnixSend.o tkUnixWm.o tkUnixXId.o  -lfontconfig -lfreetype -ltcl8.6 -ltclstub8.6 -lm -lpthread -lSM -luuid -lxcb-res -lxcb-ewmh -lxcb -lxcb-composite -lxcb-present -lxcb-glx -lxcb-dri2 -lxcb-cursor -lxcb-dri3 -lxcb-util -lxcb-xinerama -lxcb-xfixes -lxcb-sync -lxcb-shm -lxcb-shape -lxcb-render-util -lxcb-render -lxcb-randr -lxcb-keysyms -lxcb-image -lxcb-icccm -lxcb-xkb -lXxf86vm -lXv -lXtst -lXt -lX11 -lXss -lXRes -lXrender -lXrandr -lXpm -lXmuu -lXmu -lxkbfile -lXinerama -lXi -lXfixes -lXext -lXdmcp -lXdamage -lXcursor -lXcomposite -lXaw7 -lXau -lICE -lfontenc -lX11-xcb -ldl -lpthread  -lX11 -ldl  -lz -lpthread -lm -L/build/.conan2/p/b/tclb16d177df42e2/p/lib -ltclstub8.6   -Wl,-rpath,//lib:/build/.conan2/p/b/tclb16d177df42e2/p/lib
/usr/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
make: *** [Makefile:590: libtk8.6.so] Error 1

tk/8.6.10: ERROR: 
Package '0faa74c7baa21459ce693a707b13609425a9e4b6' build failed
tk/8.6.10: WARN: Build folder /build/.conan2/p/b/tkd327caea125e7/b/build-release
ERROR: tk/8.6.10: Error in build() method, line 216
        autotools.make()
        ConanException: Error 2 while executing
@cubanpit cubanpit added the bug Something isn't working label Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant