为什么TinyCC编译的程序在Win10 X64上调用win32 API退出码是-1073741795?

问题描述

测试程序源码:

int main(){
    MessageBoxA(0,"show msgBox ok,but exit has issue","0 LPCSTR lpCaption",0);  
    printf("[2]\n");
    printf("[3]\n");
    printf("[4]\n");
    return 0;
}

然后编译它tcc\tcc msgBox.c tcc\lib\user32.def

msgBox.exe
回声%errorlevel%

-1073741795

如果我删除 MessageBoxA API 调用echo %errorlevel% 为 0

tcc\tcc -v

tcc 版本 0.9.26 (i386 Win32)

--编辑--

tcc-0.9.27-win64 正常运行

tcc64\tcc -v
tcc version 0.9.27 (x86_64 Windows)

>tcc64\tcc msgBoxPid.c tcc64\lib\kernel32.def tcc64\lib\user32.def
msgBoxPid.c:9: warning: implicit declaration of function 'MessageBoxA'
msgBoxPid.c:10: warning: implicit declaration of function 'printf'

>msgBox.exe
[2]
[3]
[4]

>echo %errorlevel%
0

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)