Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 286016c5e10fc48f02726dce99f3388bef52e27e
Ticket: 3097212fffffffffffffffffffffffffffffffff
Linking extension with stubs
User & Date: abhayh on 2010-10-28 09:16:28
Changes

  1. assignee changed to: "mdejong"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    Hi everyone. I am using MS VS 2005 to write a simple TCL extension. Below is my code.
    
    #include<tcl.h>
    #include<iostream>
    using namespace std;
    
    int Add_Nums (ClientData clientData, Tcl_Interp *interp, int objc, struct Tcl_Obj * CONST * objv);
                           //ClientData clientData, Tcl_Interp *interp, int objc, struct Tcl_Obj * CONST * objv)
    
    
    int DLLEXPORT
    Add_Init(Tcl_Interp *interp)
    {
       
        if(Tcl_InitStubs(interp,"8.4",0)==NULL){
            return TCL_ERROR;
        }
        if (Tcl_PkgProvide(interp, "add", "1.1") == TCL_ERROR) {
             return TCL_ERROR;
         }
        Tcl_Command Tcl_CreateObjCommand(interp,"add",Add_Nums,NULL,NULL);
        return TCL_OK;
    
    }
    
    
    int Add_Nums (ClientData clientData, Tcl_Interp *interp, int objc, struct Tcl_Obj * CONST * objv)    
    {
        int adding(int no1,int no2);
        return TCL_OK;
    }
    
    int adding(int no1,int no2)
    {
       
        int sum =0;
        cout<<"Enter the two numbers:"<<endl;
        cin>>no1>>no2;
       
        cout<<"Sum is "<<no1+no2<<endl;
        return(sum);
    } 
    
    When i build this , its giving me " Too many Initiallizers " pointing at Tcl_CreateObjCommand() line.
    
    How do i resolve this?
    
    Thanks
    
  4. foundin changed to: "None"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "abhayh"
  10. subsystem changed to: "70. Sample Extension"
  11. title changed to:
    "Too many Initiallizers " error with Tcl_CreateObjCommand() 
    
  12. type changed to: "Bug"