Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7761807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:13:51+00:00 2026-06-01T14:13:51+00:00

I have created a simple linux 32bit shared library(.so) for my rendering wrappers but

  • 0

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………………..

This is how my code looks like:

RendIFace.h:

//Basic renderer interface
struct Renderer
{
    int type;
    ...other things
};

GLRend.c:

#include "RendIFace.h"
struct Renderer* GLRendererCreate(int width,int height,int bytesPerPixel)
{
    struct Renderer* rend = (struct Renderer*)malloc(sizeof(Renderer));

    rend->type = GLR;
    ..other things

    return rend;
}

SDLRend.c:

#include "RendIFace.h"
struct Renderer* SDLRendererCreate(int width,int height,int bytesPerPixel)
{
    struct Renderer* rend = (struct Renderer*)malloc(sizeof(Renderer));

    rend->type = SDLR;
    ..other things

    return rend;
}

And i compile both as shared 32bit libraries(.so) and load them through the main application…

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(!!!).

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 ???

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T14:13:52+00:00Added an answer on June 1, 2026 at 2:13 pm

    You must be consistent. A 64-bit application can only use 64-bit libraries and a 32-bit application can only use 32-bit libraries. Both work; either choice is fine, and it’s possible to compile the same code for both systems.

    If you go for ‘all 32-bit’, use:

    • gcc -m32

    If you go for ‘all 64-bit’, use:

    • gcc -m64

    Sometimes, I’ll tell make that the C compiler is gcc -m32 (or -m64) rather than just gcc to ensure the right value is used everywhere.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created an sample shared library, that uses libcurl. Here is the corresponding
I have created a simple wcf service which used the WCF Service Library template.
I'm using simple apache http linux mandriva server. I have created an ajax page
Could someone help me on this, I have created simple web services using axis2
How to manually create Friendly URLs? (PHP) So I have created simple php file
I am new to Repository concept and get some questions. I have created simple
I have created a simple grid of divs by left floating them and an
I have created a simple Asp.Net custom control which automatically combines all the correct
I have created some simple app in Java, and 'deployed' it using Java Web
I have created a simple test form with FormBorderStyle = FixedToolWindow by default and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.