首页 > 其他分享 >.Net 7.0 AOT /usr/bin/ld: cannot find -lz

.Net 7.0 AOT /usr/bin/ld: cannot find -lz

时间:2022-12-29 02:11:06浏览次数:37  
标签:bin ld maikebing x64 7.0 oschina2022 linux dotnet

命令:

sudo dotnet publish -c Release

报错内容:
MSBuild version 17.4.0+18d5aef85 for .NET
Determining projects to restore...
All projects are up-to-date for restore.
oschina2022 -> /mnt/d/GitHub/oschina2022/oschina2022/bin/Release/net7.0/linux-x64/oschina2022.dll
/usr/bin/ld: cannot find -lz
collect2 : error : ld returned 1 exit status [/mnt/d/GitHub/oschina2022/oschina2022/oschina2022.csproj]
/usr/share/dotnet/sdk/7.0.101/Sdks/Microsoft.DotNet.ILCompiler/build/Microsoft.NETCore.Native.targets(346,5): error MSB3073: The command ""gcc" "obj/Release/net7.0/linux-x64/native/oschina2022.o" -o "bin/Release/net7.0/linux-x64/native/oschina2022" /home/maikebing/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/7.0.1/sdk/libbootstrapper.a /home/maikebing/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/7.0.1/sdk/libRuntime.WorkstationGC.a /home/maikebing/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/7.0.1/framework/libSystem.Native.a /home/maikebing/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/7.0.1/framework/libSystem.Globalization.Native.a /home/maikebing/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/7.0.1/framework/libSystem.IO.Compression.Native.a /home/maikebing/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/7.0.1/framework/libSystem.Net.Security.Native.a /home/maikebing/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/7.0.1/framework/libSystem.Security.Cryptography.Native.OpenSsl.a -g -Wl,-rpath,'$ORIGIN' -Wl,--build-id=sha1 -Wl,--as-needed -pthread -lstdc++ -ldl -lm -lz -lrt -pie -Wl,-z,relro -Wl,-z,now -Wl,--discard-all -Wl,--gc-sections" exited with code 1. [/mnt/d/GitHub/oschina2022/oschina2022/oschina2022.csproj]

解决方法:

sudo apt-get install zlib1g-dev

标签:bin,ld,maikebing,x64,7.0,oschina2022,linux,dotnet
From: https://www.cnblogs.com/MysticBoy/p/17011612.html

相关文章

  • vue3+vite build打包报错:Some chunks are larger than 500 KiB after minification. C
    看官方的解决方案:1、在rollup配置文件中添加output.manualChunks,将模块拆分成多个chunk,减小每个chunk的大小;2、build.chunkSizeWarningLimit,提高报错的阈值;3、使用动......
  • k05_HelloWorld
    你好,世界。Hello,World。学习java的时候我们需要知道真正可以运行代码的是什么,真正可以运行代码的是我们安装的jdk,而不是我们所要用的idea或者eclipseidea其实跟我们电脑......
  • 亚马逊云科技 Build On 2022 - AIot 第二季物联网专场实验心得
    亚马逊云科技BuildOn2022-AIot第二季物联网专场实验心得大家好BuildOn是什么本次BuildOn主题介绍参与本场活动您能学到什么本场实验所用到的AWS服务实验部分1.线上......
  • 亚马逊云科技 Build On - Serverless助力企业降本增效
    亚马逊云科技BuildOn-Serverless开启零售新篇章​​梅开三度​​​​活动体验​​​​实验​​​​问题总结​​​​总结​​梅开三度Hi,作为一名Builder,这也是第三次接......
  • Index Rebuild – Does it use the Index or the Table
    Acommonquestionthatgetsaskedis doesOracleaccesstheindexitselfortheparenttable duringanindexrebuildtoextractthenecessarydatafortheind......
  • java localDateTime
    #JAVA-LocalDateTime时间格式化,转换时间戳和源码分析##LocalDateTime`LocalDateTime`作为java8新加的时间类型,也是后面开发中常用的时间类型。作为时间类型,最关注的点......
  • Could not reserve enough space for object heap
    目录00问题背景01问题描述02问题原因03解决方案00问题背景编码时idea卡顿,修改完idea的一些配置后启动项目报错01问题描述错误信息Error:Abnormalbuildproces......
  • 开发体验——helloworld
    步骤:将java代码编写到扩展名为.java的文件中(新建txt文件,更改后缀名即可)classHelloChina{ publicstaticvoidmain(String[]args){ System.out.println("Hello,......
  • 使用 Spring Boot 快速构建 Spring 框架应用,PropertyPlaceholderConfigurer
    Spring框架对于很多Java开发人员来说都不陌生。自从2002年发布以来,Spring框架已经成为企业应用开发领域非常流行的基础框架。有大量的企业应用基于Spring框架来开发......
  • Biniware Run V6.1.0 快速启动工具中文版使用说明
    前言BiniwareRun是一款便携式Windows桌面工具,可让您从一个地方快速访问自己喜欢的网站地址,文件和文件夹。只需从桌面拖放任何网站地址,文件或文件夹内的彩色圆圈内,您就可......