Thankfully I have just build Mozilla suite including XPCOM and NSPR on
Windows using GNU/Cygwin build system and MS Visual C++ v6.0 compiler

Now I want to build the nsTestSample client using Borland C++ Builder. My
goal is to test the configuration where all my components and XPCOM libs are
built by Visual C++ and my XPCOM C++ client is built by
Borland C++ Builder 6 (BCB6).

Unfortunately there are some difficulties on the way: for example the "Glue"
classes (strings, nsCOMPtr, etc) are exported from XPCOM.DLL as regular C++
classes using Visual C++ name mangling and calling conventions. So I cannot
use them from BCB6 because BCB6's export/import conventions are different.

I tried to include Glue source files (they are independent from XPCOM
infrastructure) to my BCB6 project but then again I am getting a bunch of
errors. Looks like XPCOM header files are not aware of existence of BCB6
though they contain some #ifdef fine-tuning  for other compilers such as
MSVC or Metrowerks. I guess I just need to define some of the HAVE_something
#defines.

Another difficulty is that BCB6's import libraries (.LIB files) are not
compatible with the lib files generated by MSVC (it has something to do with
OMF, COFF formats). So I need to run implib.exe on NSPR and XPCOM DLLs to
generate LIB file that BCB can understand.

implib will do conversion "right" only for exported C functions such as
NSGetModule. All C++ exports (including Glue utilities) will be processed AS
IS and thus will be incompatible with Borland C++.

In a boader sense, I am interested to know if it is possible to use XPCOM to
achieve interoperabilty between components built by different C++ compilers
in a single application.

I am a XPCOM's newbie so please let me know if it is a FAQ.








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

Reply via email to