Skip to content
This repository has been archived by the owner on Nov 1, 2020. It is now read-only.

Link error occured when sample code build #5742

Closed
42jerrykim opened this issue Apr 24, 2018 · 3 comments
Closed

Link error occured when sample code build #5742

42jerrykim opened this issue Apr 24, 2018 · 3 comments

Comments

@42jerrykim
Copy link

42jerrykim commented Apr 24, 2018

I tring to build corert sample project in https://github.com/dotnet/corert/tree/master/samples/HelloWorld, but link error is occured

Microsoft (R) Build Engine version 15.6.84.34536 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restoring packages for /home/jerry/Downloads/Test/HelloWorld/HelloWorld.csproj...
  Generating MSBuild file /home/jerry/Downloads/Test/HelloWorld/obj/HelloWorld.csproj.nuget.g.targets.
  Restore completed in 1.24 sec for /home/jerry/Downloads/Test/HelloWorld/HelloWorld.csproj.
  HelloWorld -> /home/jerry/Downloads/Test/HelloWorld/bin/release/netcoreapp2.0/linux-x64/HelloWorld.dll
  /usr/bin/clang-3.9
  Generating native code
  /usr/bin/ld: cannot find -lcurl
  /usr/bin/ld: cannot find -lgssapi_krb5
clang : error : linker command failed with exit code 1 (use -v to see invocation) [/home/jerry/Downloads/Test/HelloWorld/HelloWorld.csproj]
/home/jerry/.nuget/packages/microsoft.dotnet.ilcompiler/1.0.0-alpha-26424-01/build/Microsoft.NETCore.Native.targets(219,5): error MSB3073: The command "clang-3.9 "obj/release/netcoreapp2.0/linux-x64/native/HelloWorld.o" -o "bin/release/netcoreapp2.0/linux-x64/native/HelloWorld" /home/jerry/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/1.0.0-alpha-26424-01/sdk/libbootstrapper.a /home/jerry/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/1.0.0-alpha-26424-01/sdk/libRuntime.a /home/jerry/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/1.0.0-alpha-26424-01/sdk/libSystem.Private.CoreLib.Native.a /home/jerry/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/1.0.0-alpha-26424-01/framework/System.Native.a /home/jerry/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/1.0.0-alpha-26424-01/framework/System.Globalization.Native.a /home/jerry/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/1.0.0-alpha-26424-01/framework/System.IO.Compression.Native.a /home/jerry/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/1.0.0-alpha-26424-01/framework/System.Net.Http.Native.a /home/jerry/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/1.0.0-alpha-26424-01/framework/System.Net.Security.Native.a /home/jerry/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/1.0.0-alpha-26424-01/framework/System.Security.Cryptography.Native.OpenSsl.a -g -Wl,-rpath,'$ORIGIN' -pthread -lstdc++ -ldl -lm -lcurl -lz -lgssapi_krb5 -lrt" exited with code 1. [/home/jerry/Downloads/Test/HelloWorld/HelloWorld.csproj]
@jkotas
Copy link
Member

jkotas commented Apr 24, 2018

Could you please try running sudo apt-get install libcurl4-openssl-dev zlib1g-dev libkrb5-dev and see whether it fixes the problem?

We have this step missing in the hello world instructions.

@42jerrykim
Copy link
Author

It works. Thank you 😄

@jkotas
Copy link
Member

jkotas commented Apr 24, 2018

We should fix the hello world instructions to mention it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants