使用here中的说明。由于cl.exe的折旧选项而更新,因此错误
lua: error loading module 'pack' from file './pack.dll':
%1 is not a valid Win32 application.
当我开始测试已编译的pack.dll
时完整的命令行读数如下:
C:\luawin\lpack-master\pack>cl /c /W1 /Zl /Zi /MD /DWIN32 lpack.c
Microsoft (R) C/C++ Optimizing Compiler Version 19.13.26129 for x86
Copyright (C) Microsoft Corporation. All rights reserved.
lpack.c
C:\luawin\lpack-master\pack>link /dll /out:pack.dll /base:0x67400000
/machine:ix86 /export:luaopen_pack lpack.obj lua5.3.lib msvcrt.lib
Microsoft (R) Incremental Linker Version 14.13.26129.0
Copyright (C) Microsoft Corporation. All rights reserved.
Creating library pack.lib and object pack.exp
C:\luawin\lpack-master\pack>lua -e "package.cpath='./?.dll' require
'pack' print(string.pack('b3', 76, 117, 97))"
lua: error loading module 'pack' from file './pack.dll':
%1 is not a valid Win32 application.
stack traceback:
[C]: in ?
[C]: in function 'require'
(command line):1: in main chunk
[C]: in ?
我认为某种架构选项问题。