Overview
| Artifact ID: | be502eeb4c0508b80322c68debadef2a3d5442c9 |
|---|---|
| Ticket: | 3097212fffffffffffffffffffffffffffffffff
Linking extension with stubs |
| User & Date: | abhayh on 2010-10-28 19:14:10 |
Changes
- icomment:
#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) { #ifdef USE_TCL_STUBS Tcl_InitStubs(interp, "8.4", 0); #endif if (Tcl_PkgProvide(interp, "8.4", "1.1") == TCL_ERROR) { return TCL_ERROR; } 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); } Well, it's now showing me few linker errors. I tried to debug it , but couldn't find a way. It's getting compiled but has few unresolved symbol issues. These are the errors. 1> : error LNK2001: unresolved external symbol _tclStubsPtr 1> : error LNK2019: unresolved external symbol _Tcl_InitStubs referenced in function "int __cdecl Add_Init(struct Tcl_Interp *)" (?Add_Init@@YAHPAUTcl_Interp@@@Z) 1> : fatal error LNK1120: 2 unresolved externals 1> - 3 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== - login: "abhayh"
- mimetype: "text/plain"
- username: "abhayh"