Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. DLL mandatory with EXE

DLL mandatory with EXE

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++debugginghelpannouncement
9 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hi everyone, Maybe a stupid question but I have to ask... When we create a EXE and give it to somebody else, there`s is an error about some missing DLLs. I think it`s related to VC++ since they don`t have that application on their computer. Is there a way to know which DLL I have to pack with the EXE ? (Please, don`t tell me to try it on an other computer and write down the names of the DLLs that are missing X| )... Also, by default, when we create a project (like win32 application), is there a difference between debug and release configuration ? Like is the debug configuration requires those DLL and release doesn`t ? Thk in advance !

    T M D 3 Replies Last reply
    0
    • L Lost User

      Hi everyone, Maybe a stupid question but I have to ask... When we create a EXE and give it to somebody else, there`s is an error about some missing DLLs. I think it`s related to VC++ since they don`t have that application on their computer. Is there a way to know which DLL I have to pack with the EXE ? (Please, don`t tell me to try it on an other computer and write down the names of the DLLs that are missing X| )... Also, by default, when we create a project (like win32 application), is there a difference between debug and release configuration ? Like is the debug configuration requires those DLL and release doesn`t ? Thk in advance !

      T Offline
      T Offline
      Tim Smith
      wrote on last edited by
      #2

      You can avoid this problem by linking statically instead of dynamically. Release mode builds the program without debug information and with optimizations. Tim Smith I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?

      F 1 Reply Last reply
      0
      • T Tim Smith

        You can avoid this problem by linking statically instead of dynamically. Release mode builds the program without debug information and with optimizations. Tim Smith I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?

        F Offline
        F Offline
        Frederic Filiatrault
        wrote on last edited by
        #3

        Thk for the answer... And where do I go to link statically instead of dynamically ? :-O F. Filiatrault

        1 Reply Last reply
        0
        • L Lost User

          Hi everyone, Maybe a stupid question but I have to ask... When we create a EXE and give it to somebody else, there`s is an error about some missing DLLs. I think it`s related to VC++ since they don`t have that application on their computer. Is there a way to know which DLL I have to pack with the EXE ? (Please, don`t tell me to try it on an other computer and write down the names of the DLLs that are missing X| )... Also, by default, when we create a project (like win32 application), is there a difference between debug and release configuration ? Like is the debug configuration requires those DLL and release doesn`t ? Thk in advance !

          M Offline
          M Offline
          moliate
          wrote on last edited by
          #4

          Use depends or dumpbin to see what modules you might need to include. There might also be version differences between modules in your build environment and on the target system. In debug build some of the modules might be linked as their debug correspondance, for example mfc42d.dll instead of mfc42.dll. /moliate

          1 Reply Last reply
          0
          • L Lost User

            Hi everyone, Maybe a stupid question but I have to ask... When we create a EXE and give it to somebody else, there`s is an error about some missing DLLs. I think it`s related to VC++ since they don`t have that application on their computer. Is there a way to know which DLL I have to pack with the EXE ? (Please, don`t tell me to try it on an other computer and write down the names of the DLLs that are missing X| )... Also, by default, when we create a project (like win32 application), is there a difference between debug and release configuration ? Like is the debug configuration requires those DLL and release doesn`t ? Thk in advance !

            D Offline
            D Offline
            Derek Waters
            wrote on last edited by
            #5

            You can find out what DLLs your program requires by running the Dependency Walker (depends.exe) that comes with VC++. The difference between debug and release builds is that debug builds use MFC42D.DLL and MSVCRTD.DLL instead of MFC42.DLL and MSVCRT.DLL (no D's). The debug versions of these are not redistributable, so you should only distribute Release versions of your software. As described in the earlier post, linking statically removes the hassle of having to distribute these DLLs with your program, however, you may need others that depends.exe will show you. ------------------------ Derek Waters derek@lj-oz.com

            F 1 Reply Last reply
            0
            • D Derek Waters

              You can find out what DLLs your program requires by running the Dependency Walker (depends.exe) that comes with VC++. The difference between debug and release builds is that debug builds use MFC42D.DLL and MSVCRTD.DLL instead of MFC42.DLL and MSVCRT.DLL (no D's). The debug versions of these are not redistributable, so you should only distribute Release versions of your software. As described in the earlier post, linking statically removes the hassle of having to distribute these DLLs with your program, however, you may need others that depends.exe will show you. ------------------------ Derek Waters derek@lj-oz.com

              F Offline
              F Offline
              Frederic Filiatrault
              wrote on last edited by
              #6

              Hi again, thk for the answer. With DEPENDS.EXE, it shows KERNEL32.DLL & NTDLL.DLL. I don`t think I have to include those files. So, here`s two other questions : 1) How can I know which one of those DLL other users have 2) I have WinXP, what happen if I want to give my EXE to someone with a older OS version like Win98 ? thk in advance ! F. Filiatrault

              D 1 Reply Last reply
              0
              • F Frederic Filiatrault

                Hi again, thk for the answer. With DEPENDS.EXE, it shows KERNEL32.DLL & NTDLL.DLL. I don`t think I have to include those files. So, here`s two other questions : 1) How can I know which one of those DLL other users have 2) I have WinXP, what happen if I want to give my EXE to someone with a older OS version like Win98 ? thk in advance ! F. Filiatrault

                D Offline
                D Offline
                Derek Waters
                wrote on last edited by
                #7

                Frederic Filiatrault wrote: 1) How can I know which one of those DLL other users have Well, the simple answer is that you need to find the corresponding DLL on their system. Usually they will be in the C:\Winnt\System32\ or C:\windows\system\ folder. 2) I have WinXP, what happen if I want to give my EXE to someone with a older OS version like Win98 ? This one is down to your installer. As long as you are not relying on newer functions in these DLLs (MSDN help tells you which versions of DLLs each API call resides in) then you should be OK. Your program's installer should, in theory, include the versions of each DLL that your program relies on, and should check to see whether the user's version of the DLL is newer. If the user's current version is older, then you can copy (and register, if necessary) your copy of the DLL. You can also find out what versions of Windows DLLs are installed by what products by looking at the Microsoft DLL database at: http://support.microsoft.com/servicedesks/fileversion/dllinfo.asp?fr=0&sd=msdn Hope this helps. ------------------------ Derek Waters derek@lj-oz.com

                O 1 Reply Last reply
                0
                • D Derek Waters

                  Frederic Filiatrault wrote: 1) How can I know which one of those DLL other users have Well, the simple answer is that you need to find the corresponding DLL on their system. Usually they will be in the C:\Winnt\System32\ or C:\windows\system\ folder. 2) I have WinXP, what happen if I want to give my EXE to someone with a older OS version like Win98 ? This one is down to your installer. As long as you are not relying on newer functions in these DLLs (MSDN help tells you which versions of DLLs each API call resides in) then you should be OK. Your program's installer should, in theory, include the versions of each DLL that your program relies on, and should check to see whether the user's version of the DLL is newer. If the user's current version is older, then you can copy (and register, if necessary) your copy of the DLL. You can also find out what versions of Windows DLLs are installed by what products by looking at the Microsoft DLL database at: http://support.microsoft.com/servicedesks/fileversion/dllinfo.asp?fr=0&sd=msdn Hope this helps. ------------------------ Derek Waters derek@lj-oz.com

                  O Offline
                  O Offline
                  Oz Ben Eliezer
                  wrote on last edited by
                  #8

                  Hey, I have a related question. How do you deal with Unicode issues? I think (am I wrong?) that some system (or at least Microsoft) DLLs come in two flavors - Unicode and ANSI. Suppose that my application is compiled as an ANSI application, and I want to distribute it with a set of compatible DLLs - how do I avoid overwriting ANSI versions of DLLs with Unicode versions, and vice versa? Also - where can I find the redistributable DLLs? (MS surely doesn't expect me to copy them from my HD, do they?) Thanks!

                  D 1 Reply Last reply
                  0
                  • O Oz Ben Eliezer

                    Hey, I have a related question. How do you deal with Unicode issues? I think (am I wrong?) that some system (or at least Microsoft) DLLs come in two flavors - Unicode and ANSI. Suppose that my application is compiled as an ANSI application, and I want to distribute it with a set of compatible DLLs - how do I avoid overwriting ANSI versions of DLLs with Unicode versions, and vice versa? Also - where can I find the redistributable DLLs? (MS surely doesn't expect me to copy them from my HD, do they?) Thanks!

                    D Offline
                    D Offline
                    Derek Waters
                    wrote on last edited by
                    #9

                    Yep, Unicode is an issue. However, the DLLs are actually named differently. If you look in C:\winnt\system32 (or equivalent) on the machine where you installed VC++, you'll find that along with MFC42.DLL there is also a file called MFC42U.DLL, the Unicode version. Similarly for all the VC++ related DLLs. Basically, when you build a Unicode version of your program, it it linked against the Unicode DLLs. Therefore, if you try to run a Unicode program on a non-Unicode system, it will fail. Anyway, what I'm getting at is that if you build a non-Unicode application, you can update MFC42.DLL without a problem, since it is non-unicode. As for the redistributable files, in fact, the recommended way is to copy them from your VC++ CD. Do a search for "Redistributable Files" in MSDN and you'll find more info. The list of files allowed for redistribution can be found in the Program Files / MS Visual Studio folder and is called redist.txt. Hope this helps. ------------------------ Derek Waters derek@lj-oz.com

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups