nimscripter icon indicating copy to clipboard operation
nimscripter copied to clipboard

The microsoft compiler fails to compile

Open ingoogni opened this issue 8 months ago • 4 comments

The microsoft compiler fails to compile:

Microsoft Windows 11 Pro 10.0.22631 N/A Build 22631 Microsoft (R) C/C++ Optimizing Compiler Version 19.40.33813 for x64

Nim 2.2.2

nim.cfg:

cc = vcc

demo.nim

import nimscripter
proc doThing(): int = 42
exportTo(myImpl, doThing)
const 
  scriptProcs = implNimScriptModule(myImpl)
  ourScript = NimScriptFile("assert doThing() == 42")
let intr = loadScript(ourScript, scriptProcs)

output:

@m..@s..
[...]
@m..@s..@s..@[email protected]@[email protected]@[email protected]
C:\Users\ingoo\nimcache\demo_r\@m..@s..@s..@[email protected]@[email protected]@slib@spure@[email protected](2597) : fatal error C1001: Internal compiler error.
(compiler file 'D:\a\_work\1\s\src\vctools\Compiler\Utc\src\p2\main.c', line 242)
 To work around this problem, try simplifying or changing the program near the locations listed above.
If possible please provide a repro here: https://developercommunity.visualstudio.com 
Please choose the Technical Support command on the Visual C++ 
 Help menu, or open the Technical Support help file for more information

@m..@s..@s..@[email protected]@[email protected]@slib@[email protected]
[...]
@m..@s..@s..
[...]
CC: ../../../../.
[...]
CC: ../../../../.choosenim/toolchains/nim-2.2.2/compiler/vmgen.nim
Error: execution of an external compiler program 'vccexe.exe /c --platform:amd64 /nologo -DWIN32_LEAN_AND_MEAN /O2   /IC:\Users\ingoo\.choosenim\toolchains\nim-2.2.2\lib /IC:\Users\ingoo\Documents\Nim\Scripter\test2 /nologo /FoC:\Users\ingoo\nimcache\demo_r\@m..@s..@s..@[email protected]@[email protected]@slib@spure@[email protected] C:\Users\ingoo\nimcache\demo_r\@m..@s..@s..@[email protected]@[email protected]@slib@spure@[email protected]' failed with exit code: -1073741571

@m..@s..@s.. 
[...]
@m..@s..@s..@[email protected]@[email protected]@[email protected]
[Finished in 20.9s with exit code 1]

ingoogni avatar Mar 31 '25 10:03 ingoogni

Nothing in the output is remotely helpful, I do see vmgen.nim which makes me think it's not nimscripter but Nim itself that is not vcc compliant. Can you try compiling Nim with vcc and report back, I don't have a Windows machine?

beef331 avatar Mar 31 '25 17:03 beef331

Sorry, i have no idea how to do that. I tried ./koch boot --cc:vcc and that failed. The linker could not find a file in icon dir.

ingoogni avatar Apr 01 '25 05:04 ingoogni

VCC is not overly supported by Nim so don't know what to say then.

beef331 avatar Apr 01 '25 05:04 beef331

I understand. Let's leave it at that then. Or, should I report it Nim's git?

ingoogni avatar Apr 01 '25 05:04 ingoogni