Composer, ChatZilla and other Mozilla applications, along with Netscape, Galeon, K-Meleon and other products.
Posts: 2
Joined: April 27th, 2011, 3:49 pm

Post Posted April 27th, 2011, 4:25 pm

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, and then the problem that I'm having.

I am using Windows Vista and Visual Studio 2005.

I installed the Windows Build Prerequisites as described here: ... requisites

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:
//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

The SpiderMonkey source code is now in c:\mozilla-central\js\src

I follow the build instructions on this page: ... umentation

I launch MozillaBuild from the command shell:
Code: Select all
    c:\mozilla-build\start-msvc8.bat  (VS 2005)

In the MozillaBuild shell, I use the following commands:
Code: Select all
  cd /c/mozilla-central/js/src

So far, so good. No errors.


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:
Code: Select all
   #define XP_WIN
   #include "jsapi.h"

In my Project/Properties, I set up the following:
    - C/C++: Additional Include Directories: "C:\mozilla-central\js\src";"C:\mozilla-central\js\src\dist\include"
    - Linker: Additional Dependencies: mozjs.lib

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

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


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.
Code: Select all
    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!


Return to Other Applications and Distributions

Who is online

Users browsing this forum: No registered users and 2 guests