Hi Bob, Ah, yes, because the major part of the code is 32-, and I need 64-bit to access the memory above 64G. Even with PAE under 32-bit, I can't. Thank you for sharing your experience. I hope I won't meet what you have met;-) It is a good idea to compile all into 64-bit. But my situation is that all code is done into 32-bit, now we just find a bug and need to fix it. The possibly best way to fix it is to switch part code into 64-bit. To start from scratch is terrible to me;-)Fortunately, my 64-bit code is not complicated but only some arithmetical operations like +-*/ etc. Thanks.Qing---------------------------------------- > Subject: Re: How to compile and link 32 bit c code with 64 bit c code > From: plantz@xxxxxxxx > To: qinggwang@xxxxxxxxxxx > CC: aph@xxxxxxxxxx; gcc-help@xxxxxxxxxxx > Date: Thu, 7 Jan 2010 08:20:43 -0800 > > On Thu, 2010-01-07 at 13:46 +0800, Qing Wang wrote: >> Hi Andrew, >> >> What if I have no shared library in the project? >> All code is written by us, you can regard it as a small kernel. >> >> Thanks. >> Qing >> _________________________________________________________________ > > Hi Qing, > > If all the code is yours, why would you want to mix 32- and 64-bit?>>>From one of your earlier posts it sounds like you wish to run in 32-bit, > but switch to 64-bit when you need to access a larger memory space. To > be blunt, that's a bad idea. > > My first experience with backward compatibility was porting Data General > Nova 3 code to a DG Eclipse in 1978. That one was supposed to work "out > of the box." That is, the Eclipse was supposed to be a superset of the > Nova 3. I spent the next three months modifying the code that became > specific to the Eclipse. I've had many experiences since that show > "backward compatible" never is 100%. > > The x86-64 64-bit mode is not even supposed to be backward compatible > with 32-bit mode. They are two different modes. My prediction is that if > you try to switch back and forth between the two modes in one program, > you will be creating many headaches for yourself. > > So my question is, since the code is all yours, why not just compile it > all for 64-bit mode? > > --Bob > > _________________________________________________________________ Windows Live: Make it easier for your friends to see what you’re up to on Facebook. http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_2:092009