Subj : Re: js_GetSlotThreadSafe problems To : netscape.public.mozilla.jseng From : Mike Moening Date : Thu Mar 17 2005 11:58 am I don't include header that directly. Heres the headers I'm bringin in: #include "jsapi.h.h" #include "jsdbgapi.h" #include "jscntxt.h" #include "jsfun.h" #include "jsprf.h" //Defines JS_snprintf #include "jsutil.h" //Defines JS_ASSERT I sold some code from someplace for showing the current stack frame via printf(). Could it be related to this?? Heres the code: if(pStackFrame->fun) { if (pStackFrame->fun->atom) printf("%s(", JS_GetStringBytes(ATOM_TO_STRING(pStackFrame->fun->atom))); //Dump the arguments into the call stack trace too. for(unsigned int i=0; iargc; i++) { /* Avoid toSource bloat and fallibility for object types. */ v = pStackFrame->argv[i]; if(JSVAL_IS_STRING(v)) { std::string sValue("\""); sValue += JS_GetStringBytes(JS_ValueToString(pJSContext, v)); sValue += '"'; argsrc = JS_NewStringCopyZ(pJSContext, sValue.c_str()); } else if(JSVAL_IS_PRIMITIVE(v)) { argsrc = JS_ValueToString(pJSContext, v); } else if(JSVAL_IS_FUNCTION(pJSContext, v)) { /* XXX Avoid function decompilation bloat for now. */ argsrc = JS_GetFunctionId(JS_ValueToFunction(pJSContext, v)); if(!argsrc) argsrc = JS_ValueToString(pJSContext, v); // argsrc = JS_ValueToSource(pJSContext, v); } else { /* XXX Avoid toString on objects, it takes too long and uses too much memory, for too many classes (see Mozilla bug 166743). */ char buf[120]; JS_snprintf(buf, sizeof buf, "[object %s]", OBJ_GET_CLASS(pJSContext, JSVAL_TO_OBJECT(v))->name); argsrc = JS_NewStringCopyZ(pJSContext, buf); } //if (!argsrc) // return false; if (i > 0) printf(", "); printf("%s", argsrc ? JS_GetStringBytes(argsrc) : ""); } printf(")"); } "Brendan Eich" wrote in message news:4239B777.1090008@meer.net... > Mike Moening wrote: > > I'm trying to use spidermonkey in a DLL and I keep getting the following > > linker error. > > Note: This linker error doesn't occur if I use the js32.dll when building > > an .EXE. > > > > unresolved external symbol "__declspec(dllimport) long __cdecl > > js_GetSlotThreadSafe > > > Please tell me you're not going outside the public API by including > jsobj.h and calling OBJ_GET_SLOT or a macro that calls it, from your > .exe. Grep for jsobj.h in your code. > > /be .