Re: [xplc-general] Shareable binaries between gnu g++ and Microsoft Visual C++
Cross-platform lightweight components
Status: Alpha
Brought to you by:
pphaneuf
From: Lester M. <lme...@ya...> - 2006-09-26 02:07:54
|
> As long as your compiler generates COM-style vtables, that should work=0A= > just fine. Of course, it has to be an XPLC library (or wrapper) for=0A> = this to work.=0A=0AThanks for the reponse! Yes, I'm assuming an XPLC clien= t and compoent for this to work. I looked into this more today and found t= hat the vtables seem to be the same, however calling coventions between MSV= C and g++ are different. Specifically, the "this pointer" gets pushed on a= s the last item on the stack when using g++, but MSVC puts the "this pointe= r" in the ESI register. This causes problems to the method called because = it is off by 32 bits (yes, it I'm writing 32 bit code not 64) when trying t= o access parameters and it gets the "this pointer" from the wrong place if = mixing code built between the two compilers. =0A=0AHas anyone run up again= st this? =0AIs there a way to force g++ to use the same calling convention= (with regards to how the "this pointer" is handled) as MSVC?=0A=0AThanks,= =0ALM=0A=0APS. I built the libraries with MSVC .Net 2003 with no problem e= arlier today. However, I'm having problems building with Cygwin g++ 3.4.4.= Is there a Cygwin-XPLC FAQ posted anywhere? |