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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...