Subj : Linking NSPR with jsshell To : netscape.public.mozilla.jseng,netscape.public.mozilla.nspr From : ajmayo@my-deja.com (Andrew Mayo) Date : Mon Jan 19 2004 07:53 am I am investigating Spidermonkey and the standalone shell wrapper JSSHELL.EXE as a potential cross-platform scripting engine. Its purpose is to allow general scripting, mainly on Winxx platforms, but where it is not practical to download the full Internet Explorer environment (for example, older Win9x machines). I downloaded the Spidermonkey source and compiled it with no problem using Visual C++ 6 SP5 on Win2K. Then ran a test script, and hey, great, it works!. Fantastic.... BUT.... I believe there are some useful inbuilt objects, most notably the File object, which, if I understand the information I've read, require that you (a) include jsfile.c in the jsshell project (b) define JS_HAS_FILE_OBJECT and JS_THREADSAFE for this project (c) link to the NSPR library However, I hit some awkward problems when doing this. First, the code refused to compile a reference to and . I hacked around this by going to the include_old directory in visual studio and copying the System V include files over to the jsshell build directory. However, I am now stuck with a second build problem. I have added a reference to libnspr4.lib in the project's link file list, but the code now refuses to compile with two errors, both the same, as follows:- e:\js15\js\src\jsfile.c(2016) : error C2491: 'js_NewFileObject' : definition of dllimport function not allowed e:\js15\js\src\jsfile.c(2551) : error C2491: 'js_InitFileClass' : definition of dllimport function not allowed I have two questions 1. Can anyone suggest how to get NSPR to link with JSSHELL under Win32?. I can find one post where someone says they've done it but unfortunately the procedure isn't mentioned. Ideally I'd prefer to do this inside the IDE, since I can already build JSSHELL there with the supplied .MDP file 2. The README.html file for jsshell itself suggests that there are three built-in global objects, File, Environment and System. However, none of these appear to be available building jsshell 'out of the box', and trying to add the File object, I got into major hassles as noted above. Has anyone built a binary of JSSHELL that actually includes these objects for Win32, or does anyone know how to do it? (such a binary would be incredibly useful as, distributed with the necessary DLLs etc, you now have a complete scripting environment complete with file i/o etc). .