0

I've created a sample app to get an idea on .Net Core with Web -> ConsoleApp(Package). I've resolved all the dependency issues but when I try to compile natively with

dotnet-compile --native 

it's returning this error:

dotnet compile --native
Compiling DemoApp for DNXCore,Version=v5.0

Compilation succeeded.
    0 Warning(s)
    0 Error(s)

Time elapsed 00:00:09.2220793
Input Assembly: ..\Visual Studio 2015\Projects\DemoApp\
src\DemoApp\bin\Debug\dnxcore50\DemoApp.dll
libcpmt.lib(nothrow.obj) : error LNK2038: mismatch detected for '_MSC_VER': valu
e '1700' doesn't match value '1900' in Runtime.lib(RuntimeInstance.obj)
libcpmt.lib(newaop.obj) : error LNK2038: mismatch detected for '_MSC_VER': value
 '1700' doesn't match value '1900' in Runtime.lib(RuntimeInstance.obj)
Runtime.lib(objecthandle.obj) : error LNK2001: unresolved external symbol "void
__cdecl operator delete(void *,unsigned __int64)" (??3@YAXPEAX_K@Z)
Runtime.lib(stressLog.obj) : error LNK2001: unresolved external symbol "void __c
decl operator delete(void *,unsigned __int64)" (??3@YAXPEAX_K@Z)
Runtime.lib(gcwks.obj) : error LNK2001: unresolved external symbol "void __cdecl
 operator delete(void *,unsigned __int64)" (??3@YAXPEAX_K@Z)
Runtime.lib(handletablescan.obj) : error LNK2001: unresolved external symbol "vo
id __cdecl operator delete(void *,unsigned __int64)" (??3@YAXPEAX_K@Z)
Runtime.lib(module.obj) : error LNK2001: unresolved external symbol "void __cdec
l operator delete(void *,unsigned __int64)" (??3@YAXPEAX_K@Z)
Runtime.lib(allocheap.obj) : error LNK2001: unresolved external symbol "void __c
decl operator delete(void *,unsigned __int64)" (??3@YAXPEAX_K@Z)
Runtime.lib(gceewks.obj) : error LNK2001: unresolved external symbol "void __cde
cl operator delete(void *,unsigned __int64)" (??3@YAXPEAX_K@Z)
Runtime.lib(RestrictedCallouts.obj) : error LNK2001: unresolved external symbol
"void __cdecl operator delete(void *,unsigned __int64)" (??3@YAXPEAX_K@Z)
Runtime.lib(RuntimeInstance.obj) : error LNK2001: unresolved external symbol "vo
id __cdecl operator delete(void *,unsigned __int64)" (??3@YAXPEAX_K@Z)
Runtime.lib(CachedInterfaceDispatch.obj) : error LNK2001: unresolved external sy
mbol "void __cdecl operator delete(void *,unsigned __int64)" (??3@YAXPEAX_K@Z)
Runtime.lib(threadstore.obj) : error LNK2001: unresolved external symbol "void _
_cdecl operator delete(void *,unsigned __int64)" (??3@YAXPEAX_K@Z)
Runtime.lib(PalRedhawkMinWin.obj) : error LNK2001: unresolved external symbol "v
oid __cdecl operator delete(void *,unsigned __int64)" (??3@YAXPEAX_K@Z)
Runtime.lib(handletablecore.obj) : error LNK2001: unresolved external symbol __s
td_terminate
Runtime.lib(handletablecache.obj) : error LNK2001: unresolved external symbol __
std_terminate
Runtime.lib(handletablescan.obj) : error LNK2001: unresolved external symbol __s
td_terminate
Runtime.lib(RestrictedCallouts.obj) : error LNK2001: unresolved external symbol
__std_terminate
Runtime.lib(objecthandle.obj) : error LNK2001: unresolved external symbol __std_
terminate
Runtime.lib(stressLog.obj) : error LNK2001: unresolved external symbol __std_ter
minate
Runtime.lib(handletable.obj) : error LNK2001: unresolved external symbol __std_t
erminate
Runtime.lib(RuntimeInstance.obj) : error LNK2001: unresolved external symbol __s
td_terminate
Runtime.lib(CachedInterfaceDispatch.obj) : error LNK2001: unresolved external sy
mbol __std_terminate
Runtime.lib(startup.obj) : error LNK2001: unresolved external symbol __std_termi
nate
Runtime.lib(allocheap.obj) : error LNK2001: unresolved external symbol __std_ter
minate
Runtime.lib(gcwks.obj) : error LNK2019: unresolved external symbol __acrt_iob_fu
nc referenced in function printf
bootstrapper.lib(main.obj) : error LNK2001: unresolved external symbol __acrt_io
b_func
Runtime.lib(gcwks.obj) : error LNK2019: unresolved external symbol __stdio_commo
n_vfprintf referenced in function printf
bootstrapper.lib(main.obj) : error LNK2001: unresolved external symbol __stdio_c
ommon_vfprintf
bootstrapper.lib(main.obj) : error LNK2019: unresolved external symbol _Init_thr
ead_header referenced in function GetModuleSection
bootstrapper.lib(main.obj) : error LNK2019: unresolved external symbol _Init_thr
ead_footer referenced in function GetModuleSection
bootstrapper.lib(main.obj) : error LNK2019: unresolved external symbol __managed
__Main referenced in function main
bootstrapper.lib(main.obj) : error LNK2001: unresolved external symbol _Init_thr
ead_epoch
..\Visual Studio 2015\Projects\DemoApp\src\DemoApp\bin\
Debug\dnxcore50\native\DemoApp.exe : fatal error LNK1120: 8 unresolved externals

Linking of intermediate files failed.

The expected is to get exe file. Even normal dotnet publish isn't working fully as I'm only getting dll, pdb files. Exe is not getting published.

No .exe file

Can I convert this app to single .exe file ?I'm trying using x64 native command prompt to run the command.

Please suggest.

Edit: Tried installing the new installer but no luck. But dnu publish is working fine.

dnu publish result

I want the output as exe and dlls or native exe only but sadly fails.

Lex Li
  • 60,503
  • 9
  • 116
  • 147
  • Well, that's a very basic failure to get the job done. Maybe you got the beta bits mixed up. But frankly CoreRT is entirely too early to try yet, last update was 2 hours ago and lots of changes last week. You'll need to give them time to complete the project. – Hans Passant Apr 05 '16 at 09:18
  • @HansPassant - I was just wondering if it's the C++ runtime issues. I've tried updating with the latest [setup](http://dotnet.github.io/getting-started/) but issue persists. In [this question](http://stackoverflow.com/questions/34580599/building-a-net-core-app-via-command-line-so-that-it-works-on-a-machine-without), he's able to natively compile – user3231920 Apr 05 '16 at 11:02
  • As noted, what happened in January is not predictor for what happens today. This project is changing fast and you *will* have trouble. Use the proper channel to provide feedback if you want to help with this project, that is not SO, click the [New Issue button](https://github.com/dotnet/corert/issues). Or just wait a month and try again. – Hans Passant Apr 05 '16 at 11:07
  • Changed the tags, as this discussion was about RC1. Users should now upgrade to RC2, http://dot.net – Lex Li May 22 '16 at 13:39

0 Answers0