sounds like you need to either link to libxpcom.so or you need to link to libxpcomglue.a

darin


goktan wrote:


sorry i'm a little late!
actuallly i'm trying to make a small web browser. i used gtkmozembed for embedding. it works fine but i couldn't handle cookies. so i looked at some pages (also the page you send!) and galeon, i saw that all of them are using nsICookie component so i'm trying yo use it. firstly i didn't put nsCCookieManager.h but it couldn't find "@mozilla.org/cookiemanager" i found it in nsCCookieManager.h! now the error is like
"kiosk_interface-browser_window.o(.text+0x12): In function `mozilla_list_cookies()':
/usr/include/c++/3.2.2/bits/stl_vector.h:890: undefined reference to `nsCOMPtr_base::~nsCOMPtr_base [not-in-charge]()'"
after nsCOMPtr<nsIServiceManager> servMan;
line
now what am i missing???
thanks form now....
goktan


Darin Fisher wrote:

Benjamin Smedberg wrote:

goktan kantarcioglu wrote:

i'm trying to compile a xpcom program with
#include <nsCOMPtr.h>
#include <nsICookieManager.h>
#include <nsCCookieManager.h>
#include <nsICookie.h>
#include <nsString.h>
#include <nsIServiceManager.h>

and linker flags -lxpcom -lnspr4 but i couldn't link the program it gs,ves me lots of undefined reference to ..... errors.




Why are you #including nsCCookieManager.h? That is a private/internal header that you shouldn't need.


nsCCookieManager.h doesn't have anything but some #defines. it isn't going to really hurt much to include that. However, please note that it was removed from the tree during the 1.6 development cycle. It will not exist in mozilla 1.6 final. So, besides your program not compiling against 1.6, there isn't really that much to worry about ;-)



Thirdly, if you are writing a component/extension you probably shouldn't be using nsString. That class is frozen and the function imports and layout can change. Instead, use nsEmbedString which is statically linked.




Ben of course meant "nsString is NOT frozen..."

For more info on writing components for mozilla, please see:
http://www.mozilla.org/projects/xpcom/book/cxc/html/index.html

It has much detail on nsEmbedString and other important things you should keep in mind.

Darin
_______________________________________________
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


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

Reply via email to