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 6864113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:52:15+00:00 2026-05-27T02:52:15+00:00

I have a memory corruption problem in one of my programs. I tell the

  • 0

I have a memory corruption problem in one of my programs. I tell the joke to see what my problem (or google has been able to help me)
I have a DLL THROUGH class function returns a variable of type b2World and that I can create new physical bodies (reference memory). When my program (which uses the DLL) tries to create any physical body falls, in fact to do a lot of debugging I realized that the data change when more memory is requested. However when I do exactly the same code to create the body within the same DLL, this does not fall
In the dll I have put him dllimport and dllexport all, except that linking Box2D in both statically and in program. Both dll as the dll and the program I have the code.
I’m using Visual Studio (but I have the same problems using codeblocks-mingw another compiler).

I hope you can help me because I have searched Google and have not caught nothing (probably incorrect search words).

  • DLL
  • World.h
  • World.cpp

Program:

bool Gameloop::load(){
    m_world = new World();  
    b2World &world = m_world->getWorld();
    b2BodyDef def;
    def.position.Set(100,100);
    def.type = b2_staticBody;
    b2Body *body = world.CreateBody(&def);
    b2PolygonShape box;
    box.SetAsBox(5,5);
    b2FixtureDef fixtureDef;
    fixtureDef.shape = &box;
    body->CreateFixture(&fixtureDef);
    return true;
}

(problem in CreateBody and CreateFixture)

  • 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-05-27T02:52:15+00:00Added an answer on May 27, 2026 at 2:52 am

    Probably your dll was compiled with another version of runtime library than you currently use. Normally you cannot export classes from dll you should use interfaces instead – read this http://www.codeproject.com/KB/cpp/howto_export_cpp_classes.aspx. The solution of this problem may be to recompile your dll with runtime version you currently use. The better solution in this case should be the statically linking this library to your project.

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

Sidebar

Related Questions

I have a corruption memory heap problem with an application. by using windbg and
We have a memory overwrite problem. At some point, during the course of our
I have a very strange error happening in an App that has been working
I'm still trying to debug a very sneaky memory corruption problem. I came across
following this previous question Malloc Memory Corruption in C , now i have another
The software I work (written in C++) on has a heap corruption problem at
I believe I have a double delete and some memory corruption happening somehow in
Two Windows processes have memory mapped the same shared file. If the file consists
Does gcc have memory alignment pragma, akin #pragma vector aligned in Intel compiler? I
I am trying to load an image in memory but might have memory issues

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.