Using SpiderMonkey in a Visual Studio 2005 project

I believe I have correctly built SpiderMonkey, for Windows, from the source code. But am having a problem using SpiderMonkey within a Visual Studio project. First I’ll describe how I got the source code, and then how I built it. After that I’ll describe how I’ve set up my Visual Studio 2005 project.



I am using Windows Vista and Visual Studio 2005.



I installed the Windows Build Prerequisites as described here:

https://developer.mozilla.org/En/Developer_Guide/Build_Instructions/Windows_Prerequisites



I installed MozillaBuild:

I now have a c:mozilla-build directory with files



I installed the correct version of the Windows SDK as described by this page: https://developer.mozilla.org/En/Windows_SDK_versions

(

//Visual C++ 8 (VS2005) Professional

//Download and install the Windows 7 SDK.

//Install this Microsoft hotfix to allow linking to work correctly.



I downloaded the source code, using the following command in MozillaBuild:

hg clone http://hg.mozilla.org/mozilla-central/



The SpiderMonkey source code is now in c:mozilla-centraljssrc



I follow the build instructions on this page:

https://developer.mozilla.org/En/SpiderMonkey/Build_Documentation



I launch MozillaBuild from the command shell:

c:mozilla-buildstart-msvc8.bat (VS 2005)



In the MozillaBuild shell, I use the following commands:

cd /c/mozilla-central/js/src

autoconf-2.13

./configure

make



So far, so good. No errors.



HERE IS WHERE THINGS GET MURKY FOR ME… I’M FUMBLING AROUND AND COULD USE SOME GUIDANCE (MUCH APPRECIATED).



Now I want to create a Visual Studio 2005 project, that uses SpiderMonkey. I believe the build process creates a DLL by default. The page does describe how to create a static library as well. For now I will try to use the DLL.



First, I need to go into the “Project/Properties” menu and then go to “Configuration Properties” in the tree.

Then I use the “C/C++” and “Linker” nodes in the tree to set up some stuff.



In my source code I set up the following directives:

#define XP_WIN

#include “jsapi.h”



In my Project/Properties, I set up the following:

  • C/C++: Additional Include Directories: “C:mozilla-centraljssrc”;“C:mozilla-centraljssrcdistinclude”
  • Linker: Additional Dependencies: mozjs.lib



    Other notes. The build creates these files, they look like the relevant ones?

    mozjs.lib

    mozjs.dll



    Also, I put the mozjs.dll file in my project directory.



    Okay!



    So far this has been an 8-10 hour process figuring everything out. I’m excited, but wary.



    So in wWinMain() I put a little source code to see if I can use SpiderMonkey.

    JSRuntime *rt;

    rt = JS_NewRuntime(0x100000);



    And I am greeted by this message:

    “Unable to Locate Component”

    “The application has failed to start because MSVCR80.dll was not found.”



    So it looks as if my little project compiles okay, and links okay. But when I launch the project there’s that message about MSVCR80.dll.



    So I turn to old man Google. For 6 hours. And still I can’t figure out what my next step should be.



    Thanks in advance for any help and pointers. I don’t like asking other people to do my dirty-work for me, but I am so close, yet so far away. I can almost taste all that SpiderMonkey goodness. But I can’t figure out this last bit. Thank you!



    Cork

You are trying to make fun of us because we used a name that was used for a FireFox Javascript interpreter some years ago, right?

normen said:
You are trying to make fun of us because we used a name that was used for a FireFox Javascript interpreter some years ago, right?


No, sorry. I truly thought this site had something to do with Mozilla's SpiderMonkey. Sorry for the mis-post on your forum - I see that your engine is written in Java and is for gaming. My bad.

Cork