title: Use 32bit shared library from 64bit application?
body: <p>I have created a simple linux 32bit shared library(.so) for my rendering wrappers but i've hit a wall when i figured that i can only
  use them through 32bit applications....................</p>
  
  <p>This is how my code looks like:</p>
  
  <p>RendIFace.h:</p>
  
  <pre><code>//Basic renderer interface
  struct Renderer
  {
      int type;
      ...other things
  };
  </code></pre>
  
  <p>GLRend.c:</p>
  
  <pre><code>#include "RendIFace.h"
  struct Renderer* GLRendererCreate(int width,int height,int bytesPerPixel)
  {
      struct Renderer* rend = (struct Renderer*)malloc(sizeof(Renderer));
  
      rend-&gt;type = GLR;
      ..other things
  
      return rend;
  }
  </code></pre>
  
  <p>SDLRend.c:</p>
  
  <pre><code>#include "RendIFace.h"
  struct Renderer* SDLRendererCreate(int width,int height,int bytesPerPixel)
  {
      struct Renderer* rend = (struct Renderer*)malloc(sizeof(Renderer));
  
      rend-&gt;type = SDLR;
      ..other things
  
      return rend;
  }
  </code></pre>
  
  <p>And i compile both as shared 32bit libraries(.so) and load them through the main application...</p>
  
  <p>But now there is a big problem.My libraries are all 32bit and return 32bit pointers which means that i can't use them through 
  an 64bit application without rebuilding all the library code base(!!!).</p>
  
  <p>So i would like to ask more experienced people : How do i handle this issue ? Is it possible to use just a single shared library for both architectures ???</p>