in reply to Installing Javascript.pm on XP

My guess is the files are in the wrong location

There's nothing wrong with leaving them where they are, but the Makefile.PL needs to be able to find them.
Going through the Makefile.PL, it looks as though you can tell the Makefile.PL process most (if not all) of what it needs to know by setting environment variables - eg set the JS_INC environment variable to the location of the missing header (.h) files, and the JS_LIB environment variable to the location of the javascript library (.a) files.

Specifying INC and LIBS on the command line, as already mentioned by Anonymous Monk, might also work - though I can't be sure that the Makefile.PL won't clobber information that's being passed along by that method.

Cheers,
Rob

Replies are listed 'Best First'.
Re^2: Installing Javascript.pm on XP
by dogman1 (Novice) on Aug 05, 2009 at 03:17 UTC

    Hey, thanks for the responses.

    I went into Makefile.PL and manually edited the JS_INC and JS_LIB keys in the %ENV hash to the correct folders. Also it was originally giving me "-ljs", and I changed that to "-ljs32" Now when I run Makefile.PL it returns this to the command prompt:

    gcc -LC:\strawberry\js\src\WINNT5.1_OPT.OBJ -ljs32 -o C:\DOCUME~1\Steve\LOCALS~1\Temp\UCzBT5mwxB -IC:\strawberry\js\src test_js.c

    jsapi.h and other .h files are located in C:\strawberry\js\src
    js32.lib is located in C:\strawberry\js\src\WINNT5.1_OPT.OBJ

    Now it seems to know where the files are, but it's giving me a looong list of errors and warnings. Too long to copy all of it on here but here's a sample

    In file included from JavaScript_Env.h:17, from test_js.c:2: C:/strawberry/js/src/jsxml.h:59: error: field `declared' declared as a + function C:/strawberry/js/src/jsxml.h:110: error: `JSIdentityOp' declared as fu +nction returning a function C:/strawberry/js/src/jsxml.h:164: error: syntax error before "uint16" C:/strawberry/js/src/jsxml.h:164: warning: no semicolon at end of stru +ct or union C:/strawberry/js/src/jsxml.h:165: warning: data definition has no type + or storage class C:/strawberry/js/src/jsxml.h:178: error: conflicting types for 'u' C:/strawberry/js/src/jsfun.h:65: error: previous declaration of 'u' wa +s here C:/strawberry/js/src/jsxml.h:181: error: syntax error before '}' token C:/strawberry/js/src/jsxml.h:254: error: `js_GetFunctionNamespace' dec +lared as function returning a function C:/strawberry/js/src/jsxml.h:257: error: `js_GetDefaultXMLNamespace' d +eclared as function returning a function C:/strawberry/js/src/jsxml.h:260: error: `js_SetDefaultXMLNamespace' d +eclared as function returning a function C:/strawberry/js/src/jsxml.h:268: error: `js_IsXMLName' declared as fu +nction returning a function C:/strawberry/js/src/jsxml.h:271: error: `js_ToAttributeName' declared + as function returning a function C:/strawberry/js/src/jsxml.h:287: error: `js_GetAnyName' declared as f +unction returning a function C:/strawberry/js/src/jsxml.h:290: error: `js_FindXMLProperty' declared + as function returning a function C:/strawberry/js/src/jsxml.h:293: error: `js_GetXMLProperty' declared +as function returning a function C:/strawberry/js/src/jsxml.h:296: error: `js_GetXMLFunction' declared +as function returning a function C:/strawberry/js/src/jsxml.h:299: error: `js_SetXMLProperty' declared +as function returning a function C:/strawberry/js/src/jsxml.h:302: error: `js_GetXMLDescendants' declar +ed as func tion returning a function C:/strawberry/js/src/jsxml.h:305: error: `js_DeleteXMLListElements' de +clared as function returning a function C:/strawberry/js/src/jsxml.h:308: error: syntax error before "jsbyteco +de" C:/strawberry/js/src/jsxml.h:308: error: `js_FilterXMLList' declared a +s function returning a function C:/strawberry/js/src/jsopcode.h:239: warning: array 'js_EscapeMap' ass +umed to have one element

    I think all the header files are causing errors.

      Best to show us the *first* error (and the pre-amble leading up to it), as that's the important part. All other errors are often just a follow-on effect that is fixed when the first error is fixed.

      Cheers,
      Rob