简体   繁体   English

围模板功能找不到Libz.so

[英]Wai template functions cannot find Libz.so

<command line>: can't load .so/.DLL for: libz.so (libz.so: cannot open shared object file: no such file or directory)

This is the error I'm getting while trying to install some of the WAI libraries: 这是我在尝试安装某些WAI库时遇到的错误:

  • wai-app-static-3.1.6.2 围应用静电-3.1.6.2
  • wai-websockets-3.0.1.2 围的WebSockets-3.0.1.2

This seems to be related to Template Haskell having problems with dynamic linking . 这似乎与模板Haskell有动态链接问题有关。 Other packages that link to zlib (or libz or z or libz1g or whatever the flavor of the month package manager has chosen to call the standard compression library) work fine, it is only the ones that are trying to link to it at dynamically at compile time. 链接到zlib(或libz或z或libz1g或其他任何月份包管理器选择调用标准压缩库的味道)的其他包工作正常,只有那些试图在编译时动态链接到它的包时间。

I've used nix-env -i zlib && nix-shell -p zlib 我使用过nix-env -i zlib && nix-shell -p zlib

I've done apt-get install on zlib1g , zlib1g-dev , lib32z1 , zlib1g:i386 , libc6-i386, lib32stdc++6 , lib32gcc1 , lib32ncurses5 (?!) as suggested by other zlib question. 我已经按照其他zlib问题的建议在zlib1gzlib1g-devlib32z1zlib1g:i386 ,libc6-i386, lib32stdc++6lib32gcc1lib32ncurses5lib32ncurses5 )上完成了apt-get install

whereis libz.so gives /usr/lib/x86_64-linux-gnu/libz.a /usr/lib/x86_64-linux-gnu/libz.so so I think the library is actually installed. whereis libz.so给出了/usr/lib/x86_64-linux-gnu/libz.a /usr/lib/x86_64-linux-gnu/libz.so所以我认为实际安装了库。

I got a stripped down version of wai-app-static working by stripping out all the TH code, but I cannot extract it from wai-websockets without breaking the whole package. 我通过剥离所有的TH代码得到了一个精简版的wai-app-static工作,但我无法在不打破整个包的情况下从wai-websockets中提取它。

Has anyone found a way to get these libraries to install, preferably with Nix, but at this point however I can make it happen. 有没有人找到一种方法来安装这些库,最好是使用Nix,但是在这一点上我可以实现它。 I've been trying for three days to get a working build and have blown my entire weeks side project time without getting to write a single line of my own code. 我已经尝试了三天来获得一个有效的构建,并且已经耗费了整个星期的项目时间,而没有编写我自己的代码。 I'll take any hack that will work at this point. 我会采取任何可行的黑客攻击。


Someone asked for the command line used. 有人要求使用命令行。 Here is is as generated by cabal: 这是由cabal生成的:

/home/jfmiller28/.nix-profile/bin/ghc --make -fbuilding-cabal-package -O -static -dynamic-too -dynosuf dyn_o -dynhisuf dyn_hi -outputdir dist/build -odir dist/build -hidir dist/build -stubdir dist/build -i -idist/build -i. -idist/build/autogen -idist/build/global-autogen -Idist/build/autogen -Idist/build/global-autogen -Idist/build -optP-include -optPdist/build/autogen/cabal_macros.h -this-unit-id wai-app-static-3.1.6.2-LkSB3kK5rpLKV2jrN2AtNR -hide-all-packages -Wmissing-home-modules -package-db dist/package.conf.inplace -package-id base-4.10.0.0 -package-id wai-3.2.1.2-i068T7XVUlLxs3fKcREfc -package-id bytestring-0.10.8.2 -package-id http-types-0.12.1-2xWgExX0qOl7yKh7LxUBE2 -package-id transformers-0.5.2.0 -package-id unix-compat-0.5.1-1iiashTJMVo4Z2Bo2H1Lus -package-id directory-1.3.0.2 -package-id containers-0.5.10.2 -package-id time-1.8.0.2 -package-id old-locale-1.0.0.7-7dfSJrRIye3EgzsPnyvNPA -package-id file-embed-0.0.11-8MbWlMh1peh6Y3L9VmTvZW -package-id text-1.2.3.0-1kNDH38DjPO1AsUcP35BNj -package-id cryptonite-0.25-GXzdjgRkEVOKY7fpyz8xaf -package-id memory-0.14.16-5MukHHE9BjI5qglqVrRBGo -package-id http-date-0.0.8-CG5y9eYkeUn6wOfbHom4pU -package-id blaze-html-0.9.1.1-CsJ11WXjlLxBrTMbayeoQA -package-id blaze-markup-0.8.2.1-I4KSuVAN6lL9BOh5kJrkji -package-id mime-types-0.1.0.8-2EwGkNBk8W7Io9sTyOvZ5e -package-id unordered-containers-0.2.9.0-EAgi4LFNl39D8BgT0rhlvy -package-id template-haskell-2.12.0.0 -package-id zlib-0.6.2-KD4SSz9PUL57YfOUBW0y3t -package-id filepath-1.4.1.2 -package-id wai-extra-3.0.24.2-18RlcgWRZiDEaepZgYOTPU -package-id optparse-applicative-0.12.1.0-9EJm9hUjsSHG4weMNInJgv -package-id warp-3.2.23-590EqUmbUTP1AQ3mjwuKbZ -XHaskell98 -XCPP Network.Wai.Application.Static WaiAppStatic.Storage.Filesystem WaiAppStatic.Storage.Embedded WaiAppStatic.Listing WaiAppStatic.Types WaiAppStatic.CmdLine Util WaiAppStatic.Storage.Embedded.Runtime WaiAppStatic.Storage.Embedded.TH -Wall

I feel your pain. 我感觉到你的痛苦。
You've probably already tried these, but here are some random ideas: 您可能已经尝试过这些,但这里有一些随意的想法:

  • Make sure the symlink /usr/lib/x86_64-linux-gnu/libz.so still has a valid target. 确保符号链接/usr/lib/x86_64-linux-gnu/libz.so仍然具有有效目标。
  • Add "-L /usr/lib/x86_64-linux-gnu" to the command line. 将“-L / usr / lib / x86_64-linux-gnu”添加到命令行。
  • Try using -rpath in the linker command line ( ftp://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_node/ld_3.html ) although it probably won't help. 尝试在链接器命令行( ftp://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_node/ld_3.html )中使用-rpath,尽管它可能无济于事。
  • Make sure that the compiler architecture is really x86_64-linux-gnu (gcc -print-multiarch). 确保编译器体系结构真的是x86_64-linux-gnu(gcc -print-multiarch)。

If I think of any more, I'll be back. 如果我再想一想,我会回来的。 :-) :-)

It might (or might not) help if you could post the verbatim gcc command line. 如果您可以发布verbatim gcc命令行,它可能(或可能不)帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM