tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Re: TCC:cannot find -l"xyz.dll"


From: lostgallifreyan
Subject: Re: [Tinycc-devel] Re: TCC:cannot find -l"xyz.dll"
Date: Thu, 2 Apr 2009 23:59:57 +0100

Ok, I think I found the answer myself after all.

For those who need to know, here it is:
(I hope that a mailing list archive stores this so others have an easier time 
than I did.)
This method was prepared for TCC v0.9.24. Make this DOS batch file:

  @ECHO OFF
  SET P=C:\lua-5.1.4
  IF NOT EXIST %P%\bin\nul MD %P%\bin
  REN %P%\src\lua.c lua.---
  REN %P%\src\luac.c luac.---
  C:\tcc\tcc.exe -I"%P%\src" -o"%P%\bin\lua.dll" -shared -rdynamic %P%\src\*.c
  REN %P%\src\lua.--- lua.c
  C:\tcc\tcc.exe -I"%P%\src" -o"%P%\bin\lua.exe" "%P%\bin\lua.def" 
"%P%\src\lua.c"
  REN %P%\src\lua.c lua.---
  REN %P%\src\luac.--- luac.c
  C:\tcc\tcc.exe -I"%P%\src" -o"%P%\bin\luac.exe" "%P%\bin\Lua.def" 
"%P%\src\luac.c"
  REN %P%\src\lua.--- lua.c
  DEL %P%\bin\Lua.def
  SET P=

If it runs with no output messages, you should have three files generated in a 
"bin" directory inside the Lua source dir. (Omit the deletion of Lua.def if you 
want to keep it, or get it from Lua.dll later by using tiny_impdef.exe).

It seems that while TCC built a DLL from the main Lua library without a murmur 
of complaint without the -rdynamic switch, it still needs that switch. It now 
creates the .def file, and tiny_impdef.exe will also extract one if I need it 
to. (Some explicit DLL-making and linking command examples in TCC's 
"tcc-doc.html" 'Quick Start' section would be nice).

If you did not add the -o switch for the output file as -o"C:\Output 
Directory\Lua.dll", the output file will be named based on the first 
encountered C file in the library, as will the DLL reference, so edit the first 
line of the output "Lapi.def" file from "LIBRARY LAPI.DLL" to "LIBRARY LUA.DLL" 
if this happens. Easier to just add the switch as shown in that batch script...





reply via email to

[Prev in Thread] Current Thread [Next in Thread]