Lang.dll problem

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Lang.dll problem

      I have an unusual problem. I have created a game with the code from the book as my starting point. It works great on my computer and on the school computers. But some of the people in my group cannot run the game on their home computers. It gives them an error that it cannot load lang.dll. The first thing I asked them was if lang.dll was in the same directory as the exe file and they all say it is. 4 out of the 5 other group members cannot run the game on their home comps for this same reason. All of the comps are using xp pro, working and nonworking copies.

      Does anyone know why the same executable file and the same dll file would work on some computers and not others, all running the same OS?

      Dag

      P.S. Thanks to those that helped me with my flickering problem from a few weeks ago, it has been solved.
    • RE: Lang.dll problem

      Perhaps the executable you are running is the debug or profile build? Those require the langd.dll or langp.dll, if I'm not mistaken.
      Mr.Mike
      Author, Programmer, Brewer, Patriot
    • I've double checked and rebuilt the executable and it is indeed in release mode. Tried to run the game on 3 computers at my parents house to show them the game and it didn't work on any of them. Still failed to load the dll file. Used the exact same files (from a usb device) on my computer and the school computers and it works on all of them.

      What are the typical causes of not being able to load a dll file?

      Dag

      The post was edited 1 time, last by daglamier22 ().

    • It looks like Lang.dll is dependent on the default libraries which are expected to exist in the system directory of that particular machine. To illustrate, go to your properties of the lang project and under "Linker->Input", set "Ignore All Default Libraries" to "Yes (/NODEFAULTLIB)". If you attempt to compile, you will see complaints about missing externals due to the nonuse of those default libraries in lang.dll.

      This means that Lang.dll requires those "standard" default libs in the system directory and assumes they are going to exist on the host machine. My DLL/Lib-fu is weak, so please correct me if I'm wrong (as I very well could be), but I believe that code from libs do not get incorporated into DLLs that depend on them during link time.

      A quick workaround is to trace the lib dependency that lang requires and make sure the host system has the proper libs in its system folder. (Yuck)

      There is another workaround for this. Make Lang a lib instead of a DLL and compile lang.lib into the EXE. This defeats the purpose of having Lang be a dll, for the whole reason for localization is to simply be able to replace the DLL with another lang version to have the different languages. It is for this reason that most retail games write their own localization scheme outside of this lang.dll business. If you want to go through with making your EXE a one-language app with no DLL dependency, then this might work. I'd be curious to know if it does.

      1) For lang properties, go to "Configuration Properties->General->Configuration Type" and change "Dynamic Library" to "Static Library"

      2) Make sure the output file has a lib extension

      3) Right click on the TeapotWars project in your IDE explorer (or whatever your main exe proj is) and make sure the app is dependent on the Lang project.

      That should make it so that you no longer need any lang.dll file to run. Just the exe and those other dlls. Hopefully, whatever dependency was required by lang.dll got wrapped up into the exe in self-contained form when the exe incorporated lang.lib

      Hopefully. Let me know if that works. I can't test this on my machine as I don't have the error that you're getting on those other machines.