Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: ed387e26591954b73e6131646751b84d2543f102
Ticket: 403533ffffffffffffffffffffffffffffffffff
Patch from Bug 130582 (VC++ problems with stubs)
User & Date: davygrvy on 2001-07-06 14:44:26
Changes

  1. icomment:
    Logged In: YES 
    user_id=7549
    
    Anyone linking to Tcl with Stubs might use any of 4 
    combination: -MD, -MDd, -MT, -MTd.  Using -Zl when 
    compiling tclStubLib.c will not place a link requirement to 
    any of the above.  It'll have to one, sure, at link time, 
    but having the compiler place a link requirement to any of 
    these and you'll need to drop this into any source code 
    you'll be using Tcl with:
    
    #ifdef _MSC_VER
        // Only do this when MSVC++ is compiling us.
    #   ifdef USE_TCL_STUBS
    // Mark this .obj as needing tcl's Stubs library.
    #pragma comment(lib, "tclstub" \
        STRINGIFY(JOIN
    (TCL_MAJOR_VERSION,TCL_MINOR_VERSION)) ".lib")
    #if !defined(_MT) || !defined(_DLL) || defined
    (_DEBUG)
        // This fixes a bug with how the Stubs library 
    was compiled.
        // The requirement for msvcrt.lib from 
    tclstubXX.lib should
        // be removed.
    #    pragma comment(linker, "-
    nodefaultlib:msvcrt.lib")
    #endif
    #   else
        // Mark this .obj needing the import library
    #   pragma comment(lib, "tcl" \
    STRINGIFY(JOIN
    (TCL_MAJOR_VERSION,TCL_MINOR_VERSION)) ".lib")
    #   endif
    #endif
    
    It is perfectly valid to build an application that embeds 
    Tcl with the static multithreaded run-time (aka -MT(d), 
    libcmt(d).lib).  And if I build the app with symbols, and 
    choose to use LoadLibrary(tcl84.dll); without symbols for 
    Tcl, does it matter in the big picture?  If -Zl won't be 
    added, I'll just do it myself for my own stuff, and 
    probably leave that preprocessor work in my code anyways 
    now that I think about it...
    
    This trips many first time extension authors, BTW.
    
    
  2. login: "davygrvy"
  3. mimetype: "text/plain"
  4. username: "davygrvy"