Mozilla + Firefox extension development

Sunday, November 14, 2004

Find xpidl.exe in Gecko SDK for compiling IDL files

If you are writing a new XPCOM component and need to use xpidl.exe to compile your IDL files, you can find xpidl.exe in the Gecko SDK, the latest version of which is here:

ftp://ftp.mozilla.org/pub/mozilla.org/mozilla/releases/mozilla1.7.3/

Yes, you can alternatively download the whole freaking mozilla codebase just to build xpidl.exe.

But hold on, it's not done yet. xpidl.exe probably complains that it can't find libIDL-0.6.dll in the path. You need to download the Netscape build tools,

http://ftp.mozilla.org/pub/mozilla.org/mozilla/source/wintools.zip

unzip them into some temporary folder, say C:\buildtools, and include C:\buildtools\windows\bin\x86 in your path.

And then xpidl.exe will whine some more, e.g., it can't read nsISupports.idl and nsrootidl.idl. Just copy those files from gecko-sdk\idl over to your current directory and try to compile again.

By the way, this is how I was told to run xpidl.exe:

xpidl.exe -m typelib -w -v -I $XPIDL_INC -o nsIMyInterface nsIMyInterface.idl

Setting XPIDL_INC to include gecko-sdk\idl doesn't seem to help.

Isn't Open Source wonderful? All the information you need is out there, all for free. You just need to spend 20 hours to find them, and your life has just been reduced by 40 days due to frustration. By the end of those 20 hours, you can't even remember what you initially set out to do.

8 Comments:

  • So did it finally work or not?

    I need to do the same thing and downloading and compiling the source just takes to much time to be able to compile an xtp file.

    By Blogger Erik Arvidsson, at 2:51 AM  

  • Thanks for saving me the time it would have taken to compile xpidl. I don't have the patience to setup a full Windows build environment right now.

    FYI, I installed gecko-sdk, wintools, and glib/libIDL, and then ran this commandline:

    xpidl -I c:\gecko-sdk\idl -m typelib -w -o nsIMyInterface nsIMyInterface.idl

    -Ted

    By Anonymous Ted Mielczarek, at 6:54 PM  

  • after i did all above, i received
    some errors of missing files like:
    'can't open included file prcpucfg.h for reading'.
    Having included those files i faced the following error: `PR_BEGIN_EXTERN_C' undeclared identifier.

    By Anonymous azorea, at 1:09 AM  

  • azorea,

    I didn't have any instruction for compiling C code, so there shouldn't be any error about C include files, I think. Could you give more details about the errors?

    By Blogger David Huynh, at 8:08 AM  

  • Greetings from North Cack-A-Lacky! I enjoyed your thoughts, although I give Firefox even a little more credit than you do, I think ;) See what I mean here: internet explorer update

    By Anonymous Anonymous, at 10:19 PM  

  • Hello

    I have just discovered the wealth of information on the net contained in Blogs. I have also found an interesting site to view about cheap internet hosting
    internet. cheap internet hostingmoney

    By Blogger Health, at 4:48 AM  

  • Thanks! You saved me 20 hours, and I didn't even have to copy idl files around. \o/

    By Blogger diogoko, at 11:18 AM  

  • Thanks man, I am already lagging on my project and you saved me so much time. I just needed to copy libIDL dll and glib dll into xpcom/bin and that solved the problem.
    venkat.

    By Blogger venky, at 3:28 AM  

Post a Comment

<< Home