1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

What format is the .lib file in the SDK?

Discussion in 'Plugins' started by p.f.moore, Jul 10, 2008.

  1. p.f.moore

    Joined:
    May 30, 2008
    Messages:
    122
    Likes Received:
    1
    Normally, I use gcc (mingw) as my C compiler, so I am not surprised
    that the TakeCmd.lib file supplied with the SDK isn't of any use to
    me. But I just now tried MS C (specifically, MS Visual C++ 2008
    Express edition from the command line, only to find that it doesn't
    seem to work with that, either!!!


    Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.21022.08 for 80x86
    Copyright (C) Microsoft Corporation. All rights reserved.

    Lua.c
    Microsoft (R) Incremental Linker Version 9.00.21022.08
    Copyright (C) Microsoft Corporation. All rights reserved.

    /out:Lua.dll
    /dll
    /implib:Lua.lib
    Lua.obj
    sdk\TakeCmd.lib
    \Utils\Lua\lib\lua51.lib
    Creating library Lua.lib and object Lua.exp
    Lua.obj : error LNK2019: unresolved external symbol
    _QueryIsFileUnicode@4 referenced in function _StdinIsUnicode
    Lua.obj : error LNK2019: unresolved external symbol
    _QueryUnicodeOutput@0 referenced in function _StdinIsUnicode
    Lua.obj : error LNK2019: unresolved external symbol _QueryIsConsole@4
    referenced in function _StdinIsUnicode
    Lua.obj : error LNK2019: unresolved external symbol _encode referenced
    in function _luaU_reader
    Lua.obj : error LNK2019: unresolved external symbol _ReadStdInput
    referenced in function _luaU_reader
    Lua.obj : error LNK2019: unresolved external symbol _FreeMem@4
    referenced in function _luaU_reader
    Lua.obj : error LNK2019: unresolved external symbol _Qprintf
    referenced in function _luaU_printerr
    Lua.obj : error LNK2019: unresolved external symbol _decode referenced
    in function _luaU_printerr
    Lua.obj : error LNK2019: unresolved external symbol _ASCIIToUnicode@12
    referenced in function __lua_version@4
    Lua.obj : error LNK2019: unresolved external symbol _Command@8
    referenced in function _tcc_exec
    Lua.obj : error LNK2019: unresolved external symbol
    _StripEnclosingQuotes@4 referenced in function _create_args

    Lua.obj : error LNK2019: unresolved external symbol _NextArgument@8
    referenced in function _create_args
    Lua.obj : error LNK2019: unresolved external symbol _NthArgument@16
    referenced in function _create_args
    Lua.obj : error LNK2019: unresolved external symbol _Printf referenced
    in function _lua@4
    Lua.dll : fatal error LNK1120: 14 unresolved externals

    So what precisely is TakeCmd.lib meant to be used for? And how should
    I use the SDK without needing to manually hack an import library for
    TakeCmd.dll?

    Paul.
     
  2. samintz

    samintz Scott Mintz

    Joined:
    May 20, 2008
    Messages:
    1,203
    Likes Received:
    11
    The functions in TakeCmd.lib are decorated names. As a simple test, try
    renaming Lua.c to Lua.cpp and recompiling and see what happens.

    -Scott

    "p.f.moore" <> wrote on 07/10/2008 04:33:43 PM:



     
  3. p.f.moore

    Joined:
    May 30, 2008
    Messages:
    122
    Likes Received:
    1
    2008/7/10 samintz <>:

    That worked, thanks. I thought I'd done the equivalent by specifying
    /Tp, but I must have got it wrong :-(

    It would still be nice to have a plain C version, for portability, but
    my ugly hacks do that.

    Paul.
     
  4. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    10,092
    Likes Received:
    85
    p.f.moore wrote:

    The disadvantage of a plain C version is that the rest of TCMD and TCC
    then wouldn't be able to use TakeCmd.dll (which is, after all, its
    reason for being!).

    Rex Conn
    JP Software
     
  5. p.f.moore

    Joined:
    May 30, 2008
    Messages:
    122
    Likes Received:
    1
    2008/7/11 rconn <>:

    I was thinking of a plain C import library *as well* as the C++
    version. After all, DLLs are supposed to be callable cross-language...

    It's not a huge issue, as I have hacks that work for me (the @4 style
    decorations take some fiddling to get rid of, the rest isn't much
    problem).

    Paul.
     

Share This Page