I'm compiling a very simple main.c
:
int myfunc(int x, int y){
return x + y;
}
int main(){
int res = myfunc(2,2);
return;
}
I am compiling with the following options:
clang.exe -std=c11 -g -c .\main.c
I get my main.o
as the output. Now I go to link using lld-link.exe
with the following options:
lld-link.exe -defaultlib:libcmt -libpath:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\um\x64\" .\main.o
I get the following error: lld-link: error: no input files
But there's clearly main.o
as the last parameter, which is supposedly where you put the input files. Also keep in mind that I have to link agaisnt libcmt.lib
in order to get the symbols for the mainCRTStartup
function.