a compile problem .
the program can't find "GRE_GetGREPathWithProperties" in
"libxpcomglue.a"

c++ -g -o test -I ../mozilla/dist/include -DDEUBG -DXPCOM_GLUE  -I../
mozilla/dist/sdk/include -L../mozilla/dist/bin -Wl,-rpath-link,../
mozilla/dist/bin/ -L../mozilla/dist/sdk/lib ./libxpcomglue.a -
lembed_base_s -fno-rtti -fno-exceptions   test.cpp
/tmp/ccumJrf0.o(.text+0x3f): In function `main':
/home/mozilla/test/test.cpp:19: undefined reference to
`GRE_GetGREPathWithProperties'
/tmp/ccumJrf0.o(.text+0x79):/home/mozilla/test/test.cpp:24: undefined
reference to `XPCOMGlueStartup'
collect2: ld returned 1 exit status

test.cpp is very simple,as following:
--------------------------------------------------------------------------------------------
#include "stdlib.h"
#include "stdio.h"
#include "mozilla-config.h"
#include "nsXPCOM.h"
#include "nsXPCOMGlue.h"
#include "nsEmbedAPI.h"
//#define XPCOM_GLUE 1
int main()
{
        nsresult rv;
        static const GREVersionRange greVersion = {
                "1.9a", PR_TRUE,
                "2", PR_TRUE
        };
        char xpcomPath[256];
        rv = GRE_GetGREPathWithProperties(&greVersion, 1, nsnull,
0,xpcomPath, sizeof(xpcomPath));
        if (NS_FAILED(rv)) {
                fprintf(stderr, "Couldn't find a compatible GRE.\n");
                return 1;
        }
        rv = XPCOMGlueStartup(xpcomPath);
        if (NS_FAILED(rv)) {
                fprintf(stderr, "Couldn't start XPCOM.");
                return 1;
        }
        return 0;
}

-------------------------------------------------------------------------------------

thanks.
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding

Reply via email to