Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About windows platform --> tcc: error: library 'libtcc1-32.a' not found #2

Open
Queen-Studio opened this issue Dec 25, 2024 · 2 comments

Comments

@Queen-Studio
Copy link

Queen-Studio commented Dec 25, 2024

hi, big bro
是否可以指点一二?
我的编译和测试过程如下:

  1. 到tcc主页 https://bellard.org/tcc/https://download.savannah.gnu.org/releases/tinycc/ 下载 tcc-0.9.27-win32-bin.zip
  2. 解压tcc-0.9.27-win32-bin.zip
  3. 打开VS2019的【x86 Native Tools Command Prompt for VS2019】
  4. 输入【D:】切到D盘,再输入【cd D:\Lua_Study\LuaModule_src\luacc-master\tcc-0.9.27-win32-bin\tcc】切到tcc目录
  5. 输入【lib /machine:x86 /def:libtcc\libtcc.def /out:libtcc.lib】回车,将会生成一个libtcc.lib
  6. 输入【cl /MD examples/libtcc_test.c -I libtcc libtcc.lib】回车,使用example中的libtcc_test.c去链接使用libtcc.lib库,并生成libtcc_test.exe
  7. 输入【libtcc_test.exe】回车,输出以下内容代表编译静态库是正常的,经过测试得到了以下结果,说明静态库编译成功。
    Hello World!
    fib(32) = 2178309
    add(32, 64) = 96
  8. 使用luacc.c编译为lua模块:环境为windows 10平台,lua为lua5.2.4-x86,vs2019链接器输入前面编译的libtcc.lib得到了luacc/core.dll
  9. 测试时需要把前面步骤4的tcc目录下的libtcc.dll复制到lua.exe同一目录,如果不复制则require时找不到模块
    10.复制之后,运行会报如下错误:
    tcc: error: library 'libtcc1-32.a' not found
    tcc: error: library 'msvcrt' not found
    tcc: error: library 'kernel32' not found
    tcc: error: undefined symbol '__fixdfdi'
    tcc: error: undefined symbol '_start'
    错误来源均指向于:assert(state:relocate())
    于是把前面步骤4的tcc/lib目录下的libtcc1-32.a也复制到lua.exe同一目录,仍无解,
    遂把lib文件夹及include文件夹亦复制到lua.exe同一目录,仍无解。
    我在想libtcc1-32.a应该只能在linux平台上使用。若是如此,我将尝试在linux下进行。
@cloudwu
Copy link
Owner

cloudwu commented Dec 25, 2024

编译链接问题和这个项目无关。

@Queen-Studio
Copy link
Author

编译链接问题和这个项目无关。

好的,了解。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants