If you build your app against 1.4 in "the right way", then it will work in 1.4 though 1.7. Make sure that when you build against the 1.4 gecko sdk, that you link against libembedstring, libxpcomglue, and libxpcom, like this:

-L$(GECKO_SDK)/embedstring/bin -lembedstring \
-L$(GECKO_SDK)/xpcom/bin -lxpcomglue_s -lxpcom \
-L$(GECKO_SDK)/nspr/bin -lnspr4 -lplds4 -lplc4

If you are using NS_InitEmbedding and NS_TermEmbedding, then you should change this link line to:

-L$(GECKO_SDK)/embedstring/bin -lembedstring \
-L$(GECKO_SDK)/embed_base/bin -lembed_base_s \
-L$(GECKO_SDK)/xpcom/bin -lxpcomglue_s -lxpcom \
-L$(GECKO_SDK)/nspr/bin -lnspr4 -lplds4 -lplc4

Doing this ensures that your executable has a copy of the 1.4 version of the string code. This is necessary since the string classes were never frozen, only the vtable for the string classes was frozen. The vtable is unchanged in 1.7, so a string object from the 1.4 code can be used safely by mozilla 1.7.

If you encounter further trouble, please provide the link commands that you are using. It might also be good if you provided the output of "nm -uC mozembed-test"

Regards,

-Darin


George Zhang wrote:

Hi,
I'm working to embedding Mozilla in a Java app/library. On Linux, I modified the test app (located in <MOZILLA_SRC_HOME>/embedding/browser/gtk/tests/) for Gtk Mozilla embedding widget, to add features like profile management, post data, etc.


After building it with Mozilla 1.4, it works well with Mozilla 1.4. It also works with 1.7 if the source is built with the 1.7 source.

But the executable built with Mozilla 1.4 doesn't work with Mozilla 1.7.
there is below error:
~> ./mozembed-test
./mozembed-test: relocation error: ./mozembed-test: undefined symbol:
_ZTV9nsAString

Seems that it's due to the modified code links to XPCOM APIs, and XPCOM libraries
changed between 1.4 and 1.7.


Though I want to use XPCOM Glue, but it only provides limited APIs, not satisfying
the new code. Which looks like quite a common problem, how an application work around the dependency on XPCOM APIs, since it keeps changing between Mozilla version?


Are there any other solutions to that ? or examples on how other apps solve the problem ? Thanks for any fixes or comments !

George.

_______________________________________________
Mozilla-xpcom mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-xpcom


_______________________________________________
Mozilla-xpcom mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-xpcom

Reply via email to