Open JackHarckness opened 7 months ago
Actually running build.bat
from x64 Native Tools Command Prompt for VS 2022 solved the issue and got comilation going. I guess there is an issue within my specific configuration, maybe something is wrong with PATH. Perhaps we should consider extending the doc, since this is not an obvious solution?
Moving this as a doc improvement issue 🤔
The problem
I was trying to build a statically linked binary that Direct P/Invokes into a static dependency according to an official doc, got
error LNK2001: unresolved external symbol
while trying to do so. I then referred to an existing working example, tried to build it but got the same error. I've also tried to run the build command from a Developer Command Prompt for VS, still the same error. Commandwhere link && where cl
returns two paths pointing to msvc linker and compiler accordingly, so the absence of these is clearly not an issue.To Reproduce
On Windows, invoke
build.bat
from https://github.com/sneusse/aot-static-exampleDocument Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.