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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:53:10+00:00 2026-05-16T03:53:10+00:00

Today I’ve tried to get Edit & Continue to work in my solution, which

  • 0

Today I’ve tried to get Edit & Continue to work in my solution, which looks like this:

Game Engine .lib <- Game .lib <- Editor .exe

                        <- Server .exe

                        <- Client .exe

Which works nicely. But now I wanted to turn the engine and game .libs into .dlls, so I can use the Edit & Continue feature of visual studio C++.

So I got a bunch of “__declspec(dllexport)”s in there, etc. works just fine, it runs!

But in certain situations it crashes. Actually, it always crashes in a Lua function that is related to freeing memory.

The engine and the game both work with Lua, they both have their own static C++ interface functions.

I am not certain, but I suppose a .dll is a bit like an .exe without a main function, and each has its own memory somehow. So when for example Game.dll causes Lua to allocate some memory, and Engine.dll causes Lua to free it again, boom! Correct?

Any ideas on how to solve this? Of course Engine.dll should be in charge of Lua, but Game.dll should be able to extend the interface with new static functions.

EDIT: There were no more crashes after I turned Lua itself into a .dll. Before I tried this I also recompiled the statics with the same compiler as all other projects, and I double checked the run time libs, and they are all the same, and I am linking to the right debug/release libs. I am still curious what’s going on here.

Have a nice day,

Antoon

P.S. Why don’t I have control over returns at Stackoverflow?

  • 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-16T03:53:11+00:00Added an answer on May 16, 2026 at 3:53 am

    You wrote:

    The engine and the game both work with Lua, they both have their own static C++ interface functions.

    That suggests to me the possibility that the engine and game are each individually statically linked to a copy of Lua.

    If that were true, then this is exactly what you would expect to happen if a Lua state created by one copy were passed to the other. The typical result is to mess up the memory state and break the allocator. The root cause is that the implementation of the value nil depends on the address of something inside the Lua engine. A second copy of the engine linked into the same process will have a different address serving as its notion of nil. That way eventually leads to madness.

    Of course, if the game and engine share a single copy of the Lua interpreter (say by both using LUA51.DLL) then I’m barking up the wrong tree.

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

Sidebar

Related Questions

today I had a very embarrassing experience. I just called Push.payload() method like this.
Today at work, I was given a task to fix a bug within our
Today I had an interview on which I asked candidate quite usual and basic
today i need your help to get an specific sql select query. i have
Today, reading Servlet 3.0 specification, I've come across a sentence: We emphasize that this
Today I added a class which manages the connection to a MySQL Server. It
Today morning I wake with this weird issue where mongoid was creating a record
Today I tried to use const indentifier, but I find the const variable can
Today start using the new version of Netbeans 7.1.2, I get the below notice
Today I decide to make a resolution which consist of testing my Java application

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.