为避免恶心的版本套版本的msvcxxx,我一直用的是wdk-7600.16385.1,执行msvcbuild.bat编译,报错lib_io.obj : error LNK2019: unresolved external symbol __imp__ftelli64 referenced in function lj_cf_io_method_seek,网上搜索,问题出在_ftelli64函数,写测试代码test.c
#include <stdio.h>
void main() {void *p = (void *)_ftelli64;
}
cl test.c
成功,静态链接没问题,但是cl /MD test.c
失败,提示同样的错误,继续网上搜索,在https://github.com/raysan5/raylib/discussions/2268和https://mingw-users.narkive.com/QRKzSA73/the-procedure-entry-point-ftelli64-could-not-be-located-in-the-dynamic-link-library-msvcrt-dll找到些许线索,用dependency walker检查msvcrt.dll,果然缺少_ftelli64(特么_fseeki64倒是有),搜索luajit项目目录,只有一处地方出现_ftelli64,于是按照线索在前面加上一行#define _ftelli64(fp) _telli64(_fileno(fp))
,成功。