Jump to content

[Linux] spidermonkey linker error


Recommended Posts

The BuildInstructions page on the wiki say's one should download spidermonkey directly from mozilla. This is not necessary anymore with the latest SVN, right?

I went to libraries/spidermonkey/src and executed the build.sh script. Anything more to do here?

Finally when building the application I get the following linker errors:


==== Building pyrogenesis ====
Linking pyrogenesis
../../../libraries/spidermonkey/lib/libjs.a(jsapi.o): In function `JS_Init':
/home/mythos/arch/games/trunk/libraries/spidermonkey/src/js/src/jsapi.c:681: undefined reference to `PR_NewLock'
/home/mythos/arch/games/trunk/libraries/spidermonkey/src/js/src/jsapi.c:684: undefined reference to `PR_NewCondVar'
/home/mythos/arch/games/trunk/libraries/spidermonkey/src/js/src/jsapi.c:687: undefined reference to `PR_NewCondVar'
/home/mythos/arch/games/trunk/libraries/spidermonkey/src/js/src/jsapi.c:693: undefined reference to `PR_NewLock'
/home/mythos/arch/games/trunk/libraries/spidermonkey/src/js/src/jsapi.c:696: undefined reference to `PR_NewCondVar'
/home/mythos/arch/games/trunk/libraries/spidermonkey/src/js/src/jsapi.c:699: undefined reference to `PR_NewLock'
/home/mythos/arch/games/trunk/libraries/spidermonkey/src/js/src/jsapi.c:702: undefined reference to `PR_NewCondVar'
/home/mythos/arch/games/trunk/libraries/spidermonkey/src/js/src/jsapi.c:705: undefined reference to `PR_NewCondVar'
../../../libraries/spidermonkey/lib/libjs.a(jsapi.o): In function `JS_Finish':
/home/mythos/arch/games/trunk/libraries/spidermonkey/src/js/src/jsapi.c:741: undefined reference to `PR_DestroyLock'
/home/mythos/arch/games/trunk/libraries/spidermonkey/src/js/src/jsapi.c:743: undefined reference to `PR_DestroyCondVar'

...

Link to comment
Share on other sites

I have the same issue. It seems that there are some link info missing with the included spidermonkey. Has anyone found a solution? Is it possible to pass options to the compiler, like with a configure script ?

Link to comment
Share on other sites

Hmm, the build.sh doesn't work for me at all (I get "ld: unrecognized option '-Wl,-R/usr/lib/nspr'", because "nspr-config --libs" says "-Wl,-R/usr/lib/nspr -L/usr/lib/nspr -lplds4 -lplc4 -lnspr4 -lpthread -ldl"). So I guess the bundled SpiderMonkey should be considered experimental, i.e. probably broken :)

Those PR_* errors come from failing to link correctly with nspr. What output do you get when running "nspr-config --cflags" and "nspr-config --libs"?

Link to comment
Share on other sites

Thanks a lot. Spidermonkey compiles on my machine. These are the outputs you requested:

[eric@shuttle gcc]$ nspr-config --cflags

-I/usr/include/nspr

[eric@shuttle gcc]$ nspr-config --libs

-L/usr/lib -lplds4 -lplc4 -lnspr4 -lpthread -ldl

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...