Subj : Linking problems
To : netscape.public.mozilla.jseng
From : Jeremy Gillick
Date : Tue Jul 19 2005 12:32 am
This is a multi-part message in MIME format.
--------------080801030605030201060509
Content-Type: multipart/alternative;
boundary="------------090200020805000403000100"
--------------090200020805000403000100
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
When I try to compile a simple demo program (see attached) on my apple
powerbook, I get the following error:
ld: Undefined symbols:
_JS_Init
_JS_InitStandardClasses
_JS_NewContext
_JS_NewObject
The following files are included in the same directory as simple.c:
jsapi.h
jsautocfg.h
jscompat.h
jslong.h
jsosdep.h
jsotypes.h
jspubtd.h
jstypes.h
libjs.a
Any input or direction would be helpful.
Thanks,
Jeremy
--------------090200020805000403000100
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
When I try to
compile a simple demo program (see attached) on my apple powerbook, I
get the following error:
ld:
Undefined symbols:
_JS_Init
_JS_InitStandardClasses
_JS_NewContext
_JS_NewObject
The following files
are included in the same directory as simple.c:
jsapi.h
jsautocfg.h
jscompat.h
jslong.h
jsosdep.h
jsotypes.h
jspubtd.h
jstypes.h
libjs.a
Any input or direction
would be helpful.
Thanks,
Jeremy
--------------090200020805000403000100--
--------------080801030605030201060509
Content-Type: text/plain; x-mac-type="54455854"; x-mac-creator="522A6368";
name="simple.c"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="simple.c"
#include
#include
#include
#define XP_UNIX
#define JSFILE
#include "jsapi.h"
int main(int argc, char **argv) {
int c, i;
/*set up global JS variables, including global and custom objects */
JSVersion version;
JSRuntime *rt;
JSContext *cx;
JSClass *clasp;
JSObject *glob, *it;
JSBool builtins;
/* initialize the JS run time, and return result in rt */
rt = JS_NewRuntime(8L * 1024L * 1024L);
/* if rt does not have a value, end the program here */
if (!rt)
return 1;
/* create a context and associate it with the JS run time */
cx = JS_NewContext(rt, 8192);
/* if cx does not have a value, end the program here */
if (cx == NULL)
return 1;
/* create the global object here */
glob = JS_NewObject(cx, clasp, NULL, NULL);
/* initialize the built-in JS objects and the global object */
builtins = JS_InitStandardClasses(cx, glob);
return 0;
}
--------------080801030605030201060509--
.